From cbe6fe7cef02b92aecd12e4e13f312055f49a424 Mon Sep 17 00:00:00 2001 From: Michal Nasiadka Date: Thu, 5 Jun 2025 15:22:49 +0100 Subject: Remove ironic-inspector deployment Ironic Inspector has been retired and its functionality has been moved to Ironic. Added a change to service-ks-register to make password optional (to able to remove user without a password being passed in). Using the opportunity - increasing CI coverage to include inspection. Change-Id: If178c23249370c7c69744843737e61a6309d6a19 Signed-off-by: Michal Nasiadka --- tests/get_logs.sh | 8 +------- tests/templates/inventory.j2 | 6 ++++++ tests/templates/ironic-overrides.j2 | 5 +++++ tests/test-ironic.sh | 37 +++++++++++++++++++++++++++++++++---- 4 files changed, 45 insertions(+), 11 deletions(-) (limited to 'tests') diff --git a/tests/get_logs.sh b/tests/get_logs.sh index 55dbca03f..8633ec1c3 100644 --- a/tests/get_logs.sh +++ b/tests/get_logs.sh @@ -123,7 +123,7 @@ copy_logs() { # bifrost related logs if [[ $(${CONTAINER_ENGINE} ps --filter name=bifrost_deploy --format "{{.Names}}") ]]; then - for service in dnsmasq ironic ironic-api ironic-conductor ironic-inspector mariadb nginx; do + for service in dnsmasq ironic ironic-api ironic-conductor mariadb nginx; do mkdir -p ${LOG_DIR}/kolla/$service ${CONTAINER_ENGINE} exec bifrost_deploy systemctl status $service > ${LOG_DIR}/kolla/$service/systemd-status-$service.txt done @@ -136,12 +136,6 @@ copy_logs() { ${CONTAINER_ENGINE} exec haproxy bash -c 'echo show stat | socat stdio /var/lib/kolla/haproxy/haproxy.sock' > ${LOG_DIR}/kolla/haproxy/stats.txt fi - # FIXME: remove - if [[ $(${CONTAINER_ENGINE} ps -a --filter name=ironic_inspector --format "{{.Names}}") ]]; then - mkdir -p ${LOG_DIR}/kolla/ironic-inspector - ls -lR ${VOLUMES_DIR}/ironic_inspector_dhcp_hosts > ${LOG_DIR}/kolla/ironic-inspector/var-lib-ls.txt - fi - for container in $(${CONTAINER_ENGINE} ps -a --format "{{.Names}}"); do ${CONTAINER_ENGINE} logs --timestamps --tail=${LOGS_TAIL_PARAMETER} ${container} &> ${LOG_DIR}/container_logs/${container}.txt done diff --git a/tests/templates/inventory.j2 b/tests/templates/inventory.j2 index 9a5c879f8..ca98719a8 100644 --- a/tests/templates/inventory.j2 +++ b/tests/templates/inventory.j2 @@ -410,9 +410,15 @@ ironic [ironic-conductor:children] ironic +{# NOTE(mnasiadka): Remove in Gazpacho/2026.1 release #} +{% if is_upgrade | bool %} [ironic-inspector:children] ironic +{% endif %} +[ironic-dnsmasq:children] +ironic + [ironic-tftp:children] ironic diff --git a/tests/templates/ironic-overrides.j2 b/tests/templates/ironic-overrides.j2 index 19aa737aa..be944b307 100644 --- a/tests/templates/ironic-overrides.j2 +++ b/tests/templates/ironic-overrides.j2 @@ -1,5 +1,10 @@ +[DEFAULT] +enabled_inspect_interfaces = no-inspect, agent +default_inspect_interface = agent + [neutron] cleaning_network = public1 +inspection_network = public1 provisioning_network = public1 # This IPMI configuration has been taken from the metal3.io ironic-image diff --git a/tests/test-ironic.sh b/tests/test-ironic.sh index b182dcc52..fc3d3c7d6 100755 --- a/tests/test-ironic.sh +++ b/tests/test-ironic.sh @@ -19,7 +19,7 @@ function test_ironic_logged { # Smoke test ironic API. openstack --os-cloud kolla-admin-system-internal baremetal driver list - openstack baremetal node list + openstack --os-cloud kolla-admin-system-internal baremetal node list openstack baremetal port list openstack baremetal node show tk0 @@ -27,13 +27,42 @@ function test_ironic_logged { openstack baremetal node show tk0 openstack baremetal node manage tk0 openstack baremetal node show tk0 - openstack baremetal node provide tk0 - openstack baremetal node show tk0 openstack baremetal node validate tk0 + echo "TESTING: Server inspection" + openstack baremetal node inspect tk0 + local attempt + attempt=1 + while [[ $(openstack baremetal node show tk0 -f value -c provision_state) != "manageable" ]]; do + echo "Server not yet manageable, check $attempt - retrying" + attempt=$((attempt+1)) + if [[ $attempt -eq 16 ]]; then + echo "FAILED: Server did not finish inspection after $attempt checks" + openstack baremetal node show tk0 + return 1 + fi + sleep 60 + done + openstack baremetal node inventory save tk0 + echo "" + echo "SUCCESS: Server inspection" + echo "TESTING: Server creation" + openstack baremetal node provide tk0 + attempt=1 + while [[ $(openstack baremetal node show tk0 -f value -c provision_state) != "available" ]]; do + echo "Server not yet available, check $attempt - retrying" + attempt=$((attempt+1)) + if [[ $attempt -eq 16 ]]; then + echo "FAILED: Server did not get to available state after $attempt checks" + openstack baremetal node show tk0 + return 1 + fi + sleep 60 + done + # NOTE(mnasiadka): Wait for nova-compute-ironic to pick up the new node + sleep 60 openstack server create --image cirros --flavor test-rc --key-name mykey --network public1 kolla_bm_boot_test - local attempt attempt=1 while [[ $(openstack server show kolla_bm_boot_test -f value -c status) != "ACTIVE" ]]; do echo "Server not yet active, check $attempt - retrying" -- cgit v1.2.3