aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2025-10-10 17:49:05 +0000
committerGerrit Code Review <review@openstack.org>2025-10-10 17:49:05 +0000
commit7be89bf91e9bcf748bfc2e10dc6d97d73829935c (patch)
treef300eb86fb5877abe9ae2bfb9efaf0e797c5ec25 /tests
parent7f824ddfc69d88dec0659b2717eeef966058701d (diff)
parentff5cbf0538ad29eea63c8d27fcd0fd895ccebbba (diff)
downloadkolla-ansible-7be89bf91e9bcf748bfc2e10dc6d97d73829935c.tar.gz
kolla-ansible-7be89bf91e9bcf748bfc2e10dc6d97d73829935c.zip
Merge "CI: Rework test-dashboard.sh to Ansible role"
Diffstat (limited to 'tests')
-rw-r--r--tests/run.yml22
-rwxr-xr-xtests/test-dashboard.sh68
2 files changed, 4 insertions, 86 deletions
diff --git a/tests/run.yml b/tests/run.yml
index c0021de33..1108ae6a4 100644
--- a/tests/run.yml
+++ b/tests/run.yml
@@ -397,14 +397,8 @@
# NOTE(yoctozepto): this is nice as the first step after the deployment
# because it waits for the services to stabilize well enough so that
# the dashboard is able to show the login prompt
- - name: Run test-dashboard.sh script
- script:
- cmd: test-dashboard.sh
- executable: /bin/bash
- chdir: "{{ kolla_ansible_src_dir }}"
- environment:
- TLS_ENABLED: "{{ tls_enabled }}"
- LE_ENABLED: "{{ le_enabled }}"
+ - import_role:
+ name: kolla-ansible-test-dashboard
when: dashboard_enabled
- name: Run init-core-openstack.sh script
@@ -740,16 +734,8 @@
KOLLA_ANSIBLE_VENV_PATH: "{{ kolla_ansible_venv_path }}"
SCENARIO: "{{ scenario }}"
- # NOTE(yoctozepto): this is nice as the first step after the upgrade
- # because it waits for the services to stabilize well enough so that
- # the dashboard is able to show the login prompt
- - name: Run test-dashboard.sh script (post upgrade)
- shell:
- cmd: tests/test-dashboard.sh
- executable: /bin/bash
- chdir: "{{ kolla_ansible_src_dir }}"
- environment:
- TLS_ENABLED: "{{ tls_enabled }}"
+ - import_role:
+ name: kolla-ansible-test-dashboard
when: dashboard_enabled
# NOTE(yoctozepto): We need the script module here to avoid
diff --git a/tests/test-dashboard.sh b/tests/test-dashboard.sh
deleted file mode 100755
index c3cb9a72c..000000000
--- a/tests/test-dashboard.sh
+++ /dev/null
@@ -1,68 +0,0 @@
-#!/bin/bash
-
-set -o xtrace
-set -o errexit
-
-export PYTHONUNBUFFERED=1
-
-
-function check_dashboard {
- # Query the dashboard, and check that the returned page looks like a login
- # page.
- DASHBOARD_URL=${OS_AUTH_URL%:*}
- output_path=$1
- args=(
- --include
- --location
- --fail
- )
- if [[ "$TLS_ENABLED" = "True" ]]; then
- args+=(--cacert $OS_CACERT)
- fi
- if ! curl "${args[@]}" $DASHBOARD_URL > $output_path; then
- return 1
- fi
- if ! grep Login $output_path >/dev/null; then
- return 1
- fi
-}
-
-function test_dashboard_logged {
- . /etc/kolla/admin-openrc.sh
-
- echo "TESTING: Dashboard"
- # The dashboard has been known to take some time to become accessible, so
- # use retries.
- output_path=$(mktemp)
- attempt=1
- while ! check_dashboard $output_path; do
- echo "Dashboard not accessible yet"
- attempt=$((attempt+1))
- if [[ $attempt -eq 30 ]]; then
- echo "FAILED: Dashboard did not become accessible. Response:"
- cat $output_path
- return 1
- fi
- sleep 10
- done
- echo "SUCCESS: Dashboard"
-}
-
-function test_dashboard {
- echo "Testing dashboard"
- log_file=/tmp/logs/ansible/test-dashboard
- if [[ -f $log_file ]]; then
- log_file=${log_file}-upgrade
- fi
- test_dashboard_logged > $log_file 2>&1
- result=$?
- if [[ $result != 0 ]]; then
- echo "Testing dashboard failed. See ansible/test-dashboard for details"
- else
- echo "Successfully tested dashboard. See ansible/test-dashboard for details"
- fi
- return $result
-}
-
-
-test_dashboard