diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index dd502e6de5fb077d1941b93e9f680d5f9d20cd86..48bcec935142a3829285dc7919593ea4cdfbe16b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -15,7 +15,7 @@ variables: # Repeated values, because we're not allowed to use a variable in a variable SUBDOMAIN: "${CI_COMMIT_REF_SLUG}.ci" DOMAIN: "openappstack.net" - ADDRESS: "${CI_COMMIT_REF_SLUG}.ci.openappstack.net" + FQDN: "${CI_COMMIT_REF_SLUG}.ci.openappstack.net" ANSIBLE_HOST_KEY_CHECKING: "False" KANIKO_BUILD_IMAGENAME: "openappstack-ci" INVENTORY: "/builds/openappstack/openappstack/clusters/${CI_COMMIT_REF_SLUG}/inventory.yml" @@ -37,7 +37,7 @@ ci_test_image: create-vps: stage: create-vps script: - - echo "hostname $HOSTNAME, subdomain $SUBDOMAIN, domain $DOMAIN, address $ADDRESS"; + - echo "hostname $HOSTNAME, subdomain $SUBDOMAIN, domain $DOMAIN, FQDN $FQDN"; - ls clusters/${HOSTNAME} || echo "directory clusters/${HOSTNAME} not found" # Creates the VPS only if an old VPS for this branch is not re-usable - sh .gitlab/ci_scripts/create_vps.sh @@ -141,8 +141,6 @@ certs: prometheus-alerts: stage: health-test - variables: - OAS_DOMAIN: '${CI_COMMIT_REF_SLUG}.ci.openappstack.net' allow_failure: true script: - cd test/ @@ -159,9 +157,9 @@ behave-nextcloud: stage: integration-test script: # Wait until flux creates the NextCloud HelmRelease. - - ssh root@$ADDRESS '/bin/bash -c "while true; do kubectl get hr -n oas-apps nextcloud; if [ \$? -eq 0 ]; then break; fi; sleep 20; done"' + - ssh root@$FQDN '/bin/bash -c "while true; do kubectl get hr -n oas-apps nextcloud; if [ \$? -eq 0 ]; then break; fi; sleep 20; done"' # Wait until NextCloud is ready. - - ssh root@$ADDRESS '/bin/bash -c "kubectl wait -n oas-apps hr/nextcloud --for condition=Released --timeout=20m"' + - ssh root@$FQDN '/bin/bash -c "kubectl wait -n oas-apps hr/nextcloud --for condition=Released --timeout=20m"' # Run the behave tests for NextCloud. - python3 -m openappstack $HOSTNAME test --behave-headless --behave-tags nextcloud || python3 -m openappstack $HOSTNAME test --behave-headless --behave-rerun-failing --behave-tags nextcloud artifacts: diff --git a/test/README.md b/test/README.md index 4863ae121cd8bb7ce13ac2e30c63d1783ff11b60..7da4ce188e7f5fa928eb6679f55a575806549076 100644 --- a/test/README.md +++ b/test/README.md @@ -38,11 +38,11 @@ Run cert test manually using the ansible inventory file: Run cert test manually against a different cluster, not configured in any ansible inventory file, either by using pytest: - DOMAIN='example.openappstack.net' py.test -sv -m 'certs' + FQDN='example.openappstack.net' py.test -sv -m 'certs' or directly: - DOMAIN='example.openappstack.net' pytest/test_certs.py + FQDN='example.openappstack.net' pytest/test_certs.py ## Run *behave* tests diff --git a/test/pytest/test_certs.py b/test/pytest/test_certs.py index e4037ea51583f9a6e9148cbfef5d684376509748..93feb1a5a8e7f8014533c9d82601a22b9d1c2a96 100755 --- a/test/pytest/test_certs.py +++ b/test/pytest/test_certs.py @@ -101,11 +101,11 @@ def test_cert_validation(host): Check is executed on the local provisioning machine. """ - # Use DOMAIN env var if set, otherwise use domain var from + # Use FQDN env var if set, otherwise use domain var from # settings.yml. - domain = os.environ.get("DOMAIN") + domain = os.environ.get("FQDN") if domain: - print("Using domain %s from DOMAIN environment variable." % domain) + print("Using domain %s from FQDN environment variable." % domain) else: ansible_vars = host.ansible.get_variables() domain = ansible_vars["domain"]