Skip to content
Snippets Groups Projects
Verified Commit cf3863d3 authored by Varac's avatar Varac
Browse files

Use FQDN env var for cert test

parent 23109e87
No related branches found
No related tags found
No related merge requests found
......@@ -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:
......
......@@ -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
......
......@@ -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"]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment