Test bare metal node inspection

Adds a test to inspect a node in the baremetal-compute inventory group.
We also print all of the inspection rules and collect the inspection
data for debugging purposes.

Change-Id: I9d9233ea576e5cf7ce4f51db12817af00400a1cb
Signed-off-by: Will Szumski <will@stackhpc.com>
This commit is contained in:
Will Szumski
2025-09-15 17:27:46 +00:00
committed by Pierre Riteau
parent 2858b253b1
commit 03c849c6ca
5 changed files with 70 additions and 0 deletions

View File

@@ -618,6 +618,47 @@ function overcloud_test_bounce_interface {
run_kayobe overcloud host configure -t network
}
function overcloud_inspection_rule_dump {
echo "Listing inspection rules ..."
openstack baremetal inspection rule list
echo "Dumping inspection rules ..."
openstack baremetal inspection rule list -c UUID -f value | xargs -L 1 openstack baremetal inspection rule show
}
function overcloud_test_inspect {
set -eu
node=$1
environment_setup
source "${KOLLA_CONFIG_PATH:-/etc/kolla}/admin-openrc-system.sh"
overcloud_inspection_rule_dump
echo "Baremetal node: $node before inspection"
openstack baremetal node show "$node"
# NOTE(wszumski): Switch to using kayobe playbooks to manage and inspect
# when we switch to node registration
if [ "$(openstack baremetal node show -c provision_state -f value $node)" != "manageable" ]; then
openstack baremetal node manage "$node" --wait
fi
# Run inspection
openstack baremetal node inspect "$node" --wait
echo "Baremetal node: $node after inspection"
openstack baremetal node show $node
openstack baremetal node inventory save $node
# Use Kayobe to save introspection data
run_kayobe baremetal compute introspection data save --limit "baremetal-compute,controllers[0]" --output-dir /tmp/baremetal-compute-inspection-data
# Move back to available
openstack baremetal node provide "$node" --wait
}
function overcloud_test {
set -eu

16
dev/overcloud-test-inspect.sh Executable file
View File

@@ -0,0 +1,16 @@
#!/bin/bash
set -eu
set -o pipefail
PARENT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "${PARENT}/functions"
function main {
config_init
overcloud_test_inspect tk0
}
main

View File

@@ -1,2 +1,4 @@
[baremetal-compute]
hv100
tk0
tk1

View File

@@ -36,6 +36,12 @@
chdir: "{{ kayobe_src_dir }}"
executable: /bin/bash
- name: Test inspection of the baremetal machines
shell:
cmd: dev/overcloud-test-inspect.sh &> {{ logs_dir }}/ansible/overcloud-test-inspect
chdir: "{{ kayobe_src_dir }}"
executable: /bin/bash
- name: Perform testing of the baremetal machines
shell:
cmd: dev/overcloud-test-baremetal.sh &> {{ logs_dir }}/ansible/overcloud-test-baremetal

View File

@@ -151,6 +151,11 @@ copy_logs() {
cp /opt/kayobe/images/deployment_image/deployment_image.stderr /opt/kayobe/images/deployment_image/deployment_image.stdout ${LOG_DIR}/kayobe/
fi
# Baremetal inspection data
if [ -d "/tmp/baremetal-compute-inspection-data" ]; then
cp -rf /tmp/baremetal-compute-inspection-data ${LOG_DIR}
fi
# Rename files to .txt; this is so that when displayed via
# logs.openstack.org clicking results in the browser shows the
# files, rather than trying to send it to another app or make you