aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMichal Nasiadka <mnasiadka@gmail.com>2025-10-08 17:02:50 +0200
committerMichal Nasiadka <mnasiadka@gmail.com>2025-10-10 07:54:33 +0000
commit45e7b9ec4435d334c5757a1e5a6352b9f342567e (patch)
tree77a9bf3ccb69c35bbc77f0d8069833b389b565c0 /tests
parent10e719f9d8b4b8d8efbc00e9a69ae6984b4a0a10 (diff)
downloadkolla-ansible-45e7b9ec4435d334c5757a1e5a6352b9f342567e.tar.gz
kolla-ansible-45e7b9ec4435d334c5757a1e5a6352b9f342567e.zip
CI: Rework test/deploy/upgrade-bifrost.sh into Ansible roles
Change-Id: I55ea22002ea81085a43dc053f619bb61cd497c69 Signed-off-by: Michal Nasiadka <mnasiadka@gmail.com>
Diffstat (limited to 'tests')
-rwxr-xr-xtests/deploy-bifrost.sh23
-rw-r--r--tests/run.yml32
-rwxr-xr-xtests/test-bifrost.sh31
-rwxr-xr-xtests/upgrade-bifrost.sh24
4 files changed, 9 insertions, 101 deletions
diff --git a/tests/deploy-bifrost.sh b/tests/deploy-bifrost.sh
deleted file mode 100755
index b06a6d769..000000000
--- a/tests/deploy-bifrost.sh
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/bin/bash
-
-set -o xtrace
-set -o errexit
-
-# Enable unbuffered output for Ansible in Jenkins.
-export PYTHONUNBUFFERED=1
-
-
-function deploy_bifrost {
- RAW_INVENTORY=/etc/kolla/inventory
-
- source $KOLLA_ANSIBLE_VENV_PATH/bin/activate
-
- # TODO(mgoddard): run prechecks.
- # Deploy the bifrost container.
- # TODO(mgoddard): add pull action when we have a local registry service in
- # CI.
- kolla-ansible deploy-bifrost -i ${RAW_INVENTORY} -vvv &> /tmp/logs/ansible/deploy-bifrost
-}
-
-
-deploy_bifrost
diff --git a/tests/run.yml b/tests/run.yml
index 0b04afa24..9178300be 100644
--- a/tests/run.yml
+++ b/tests/run.yml
@@ -780,31 +780,17 @@
when: is_upgrade
# Bifrost testing.
- - block:
- - name: Run deploy-bifrost.sh script
- shell:
- cmd: tests/deploy-bifrost.sh
- executable: /bin/bash
- chdir: "{{ kolla_ansible_src_dir }}"
- environment:
- KOLLA_ANSIBLE_VENV_PATH: "{{ kolla_ansible_venv_path }}"
+ - name: Bifrost testing
+ when: scenario == "bifrost"
+ block:
+ - import_role:
+ name: kolla-ansible-deploy-bifrost
- - name: Run test-bifrost.sh script
- shell:
- cmd: tests/test-bifrost.sh
- executable: /bin/bash
- chdir: "{{ kolla_ansible_src_dir }}"
- environment:
- CONTAINER_ENGINE: "{{ container_engine }}"
+ - import_role:
+ name: kolla-ansible-test-bifrost
- - name: Run upgrade-bifrost.sh script
- shell:
- cmd: tests/upgrade-bifrost.sh
- executable: /bin/bash
- chdir: "{{ kolla_ansible_src_dir }}"
- environment:
- KOLLA_ANSIBLE_VENV_PATH: "{{ kolla_ansible_venv_path }}"
- when: scenario == "bifrost"
+ - import_role:
+ name: kolla-ansible-upgrade-bifrost
# NOTE(yoctozepto): each host checks itself
- hosts: all
diff --git a/tests/test-bifrost.sh b/tests/test-bifrost.sh
deleted file mode 100755
index b8017c026..000000000
--- a/tests/test-bifrost.sh
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/bin/bash
-
-set -o xtrace
-set -o errexit
-
-# Enable unbuffered output for Ansible in Jenkins.
-export PYTHONUNBUFFERED=1
-
-
-function test_bifrost {
- container_engine="${1:-docker}"
-
- # TODO(mgoddard): More testing, deploy bare metal nodes.
- # TODO(mgoddard): Use openstackclient when clouds.yaml works. See
- # https://bugs.launchpad.net/bifrost/+bug/1754070.
- attempts=0
- while [[ $(sudo ${container_engine} exec bifrost_deploy bash -c "OS_CLOUD=bifrost baremetal driver list -f value" | wc -l) -eq 0 ]]; do
- attempts=$((attempts + 1))
- if [[ $attempts -gt 6 ]]; then
- echo "Timed out waiting for ironic conductor to become active"
- exit 1
- fi
- sleep 10
- done
- sudo $container_engine exec bifrost_deploy bash -c "OS_CLOUD=bifrost baremetal node list"
- sudo $container_engine exec bifrost_deploy bash -c "OS_CLOUD=bifrost baremetal node create --driver redfish --name test-node"
- sudo $container_engine exec bifrost_deploy bash -c "OS_CLOUD=bifrost baremetal node delete test-node"
-}
-
-
-test_bifrost $1
diff --git a/tests/upgrade-bifrost.sh b/tests/upgrade-bifrost.sh
deleted file mode 100755
index a5d5c3682..000000000
--- a/tests/upgrade-bifrost.sh
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/bash
-
-set -o xtrace
-set -o errexit
-
-# Enable unbuffered output for Ansible in Jenkins.
-export PYTHONUNBUFFERED=1
-
-
-function upgrade_bifrost {
- RAW_INVENTORY=/etc/kolla/inventory
-
- source $KOLLA_ANSIBLE_VENV_PATH/bin/activate
-
- # TODO(mgoddard): run prechecks.
- # TODO(mgoddard): add pull action when we have a local registry service in
- # CI.
- # TODO(mgoddard): make some configuration file changes and trigger a real
- # upgrade.
- kolla-ansible deploy-bifrost -i ${RAW_INVENTORY} -vvv &> /tmp/logs/ansible/upgrade-bifrost
-}
-
-
-upgrade_bifrost