From 0f708b96a6856ec84f847993b3661236334c80dc Mon Sep 17 00:00:00 2001 From: Daniel Hilst <392820+dhilst@users.noreply.github.com> Date: Wed, 30 Sep 2026 12:01:50 -0300 Subject: [PATCH] fix(xcat-core): a correct hierarchical provision fails the provisioning-source check check_provisioning_source.sh required the management node's httpd access log to gain lines after the baseline. The three hierarchy cases take the baseline after SN_setup_case has provisioned the service node. After that point a correct hierarchical provision leaves the management node serving nothing, so its log does not grow. On the xcat42 EL9 cell the service node served the compute node 252 boot-payload requests and the management node served 0, and the check still reported "no httpd access log with new entries could be read on xcat42-mn-dhilst". reg_linux_diskless_installation_hierarchy failed for that message. The guard now requires the log to hold lines, not to hold new ones. An empty log still fails, because it makes "the management node served nothing" a property of the file instead of a measurement. check_provisioning_source.bats asserted the removed behavior in "a management node log with nothing new fails the check instead of reading as silence". That case now asserts the opposite, and a second case covers the empty log. Both fail against the unfixed script. Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com> --- .../commoncmd/check_provisioning_source.sh | 9 ++++---- xCAT-test/bats/check_provisioning_source.bats | 21 +++++++++++++++++-- 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/xCAT-test/autotest/testcase/commoncmd/check_provisioning_source.sh b/xCAT-test/autotest/testcase/commoncmd/check_provisioning_source.sh index 9b6f7f632..ea18505a7 100755 --- a/xCAT-test/autotest/testcase/commoncmd/check_provisioning_source.sh +++ b/xCAT-test/autotest/testcase/commoncmd/check_provisioning_source.sh @@ -202,10 +202,11 @@ if [ "$SN_STATE" != ok ]; then RC=1 fi -# The management node provisioned the service node over http, so its log gains lines on every -# hierarchical run. A log with nothing new cannot show that the management node served nothing. -if [ "$MN_STATE" != ok ] || [ "$MN_NEW" -eq 0 ]; then - echo "provisioning source error: no httpd access log with new entries could be read on $MN" >&2 +# An empty log makes "the management node served nothing" a property of the file, not a +# measurement. New lines are NOT required: the service node is provisioned before the baseline, so +# after it a correct hierarchical run leaves the management node's log unchanged. +if [ "$MN_STATE" != ok ] || [ "$MN_LINES" -eq 0 ]; then + echo "provisioning source error: no httpd access log with entries could be read on $MN" >&2 RC=1 fi diff --git a/xCAT-test/bats/check_provisioning_source.bats b/xCAT-test/bats/check_provisioning_source.bats index bcf5b76f9..4f05322ce 100644 --- a/xCAT-test/bats/check_provisioning_source.bats +++ b/xCAT-test/bats/check_provisioning_source.bats @@ -198,14 +198,31 @@ seed_logs() [[ "$output" == *"no httpd access log could be read on $SN"* ]] } -@test "a management node log with nothing new fails the check instead of reading as silence" { +# The service node is provisioned before the baseline, so on a correct hierarchical run the +# management node serves nothing after it and its log does not grow. Every other case here appends +# a management-node line after the baseline, so none of them reaches this state. +@test "a management node log that does not grow after the baseline still passes" { seed_logs take_baseline access_line "$CN_IP" 12345678 /tftpboot/xcat/genesis.kernel >>"$SN_LOG" + run_check + [ "$status" -eq 0 ] + [[ "$output" == *"provisioning source ok"* ]] +} + +# The guard the case above relaxes still has a job. An empty log makes "the management node served +# nothing" a property of the file, not a measurement. +@test "an empty management node log fails the check instead of passing it" { + : >"$MN_LOG" + access_line 192.0.2.30 512 /install/rh/x86_64/ >"$SN_LOG" + take_baseline + access_line "$CN_IP" 12345678 /tftpboot/xcat/genesis.kernel >>"$SN_LOG" + run_check [ "$status" -ne 0 ] - [[ "$output" == *"no httpd access log with new entries could be read on mn01"* ]] + [[ "$output" == *"no httpd access log with entries could be read on"* ]] + [[ "$output" != *"provisioning source ok"* ]] } @test "the Debian per-vhost log format is read as the client address" {