Skip to content
Snippets Groups Projects
Forked from stackspin / stackspin
6625 commits behind the upstream repository.
Arie Peterson's avatar
86465ec8

Run testinfra tests

Test host configured in test/inventory.yml

py.test -v --ansible-inventory=../inventory.yml --hosts='ansible://*'

Specify host manually:

py.test -v --hosts='ssh://root@example.openappstack.net'

Run cert test manually using the ansible inventory file:

ADDRESS='example.openappstack.net' py.test -v -m 'certs' \
  --connection=ansible \
  --ansible-inventory=../ansible/inventory.yml \
  --hosts='ansible://*'

Run cert test manually against a different cluster, not configured in any ansible inventory file, either by using pytest:

ADDRESS='example.openappstack.net' py.test -v -m 'certs'

or directly (allows better debugging since pytest won't eat stdout):

ADDRESS='example.openappstack.net' pytest/test_certs.py

Issues

  • Default ssh backend is paramiko, which doesn't work oout of the box. It fails to connect to the host because the ed25519 hostkey was not verified. Therefore we need to force plain ssh:// with either connection=ssh or --hosts=ssh://…

Running bootstrap CI with local gitlab-runner docker executor

Export the following environment variables like this:

export CI_REGISTRY_IMAGE='open.greenhost.net:4567/openappstack/openappstack'
export SSH_PRIVATE_KEY="$(cat ~/.ssh/id_ed25519_oas_ci)"
export COSMOS_API_TOKEN='…'

then:

gitlab-runner exec docker --env CI_REGISTRY_IMAGE="$CI_REGISTRY_IMAGE" --env SSH_PRIVATE_KEY="$SSH_PRIVATE_KEY" --env COSMOS_API_TOKEN="$COSMOS_API_TOKEN" bootstrap