From 2d65a0d49d4d0f6a9234c2cf162eab93882db62a Mon Sep 17 00:00:00 2001 From: Daniel Hilst <392820+dhilst@users.noreply.github.com> Date: Wed, 30 Sep 2026 12:40:44 -0300 Subject: [PATCH] fix(xcat-core): the provisioning-source bats suite asserts the wrong answer check_provisioning_source.bats held a case that required the check to FAIL when the management node logs nothing after the baseline. That is the hierarchical result, not a broken log: the management node provisions the service node before the baseline and then serves the compute node nothing. The suite passed 14 of 14 while the check could not pass on a real cluster. Two more cases cover the path filter. The compute node fetches the root image with wget from a URL that carries a double slash, so the path reaches the log as //install/netboot/..., and the filter matched neither direction: the request counted as no boot payload on the service node, and a flat provision that served it went unreported. All four cases fail against the current script. Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com> --- xCAT-test/bats/check_provisioning_source.bats | 44 ++++++++++++++++++- 1 file changed, 42 insertions(+), 2 deletions(-) diff --git a/xCAT-test/bats/check_provisioning_source.bats b/xCAT-test/bats/check_provisioning_source.bats index bcf5b76f9..58a235e84 100644 --- a/xCAT-test/bats/check_provisioning_source.bats +++ b/xCAT-test/bats/check_provisioning_source.bats @@ -198,14 +198,54 @@ 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 management node provisions the service node BEFORE this baseline, so it can serve nothing +# after it. That is the hierarchical result, and it was read as a broken log. +@test "a management node that serves nothing after the baseline 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"* ]] +} + +@test "a management node log with no entry at all fails the check instead of reading as silence" { + : >"$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 any entry could be read on mn01"* ]] +} + +# The compute node fetches the root image with wget from a URL that carries a double slash, so +# the path in the log reads //install/... and the payload filter did not match it. +@test "a boot payload requested under a doubled slash counts" { + seed_logs + take_baseline + access_line "$CN_IP" 978729607 //install/netboot/ubuntu/x86_64/compute/rootimg.cpio.gz >>"$SN_LOG" + access_line 192.0.2.21 4096 /install/rh/x86_64/ >>"$MN_LOG" + + run_check + [ "$status" -eq 0 ] + [[ "$output" == *"provisioning source ok"* ]] +} + +@test "a doubled-slash boot payload from the management node reads as a flat provision" { + seed_logs + take_baseline + access_line "$CN_IP" 12345678 /tftpboot/xcat/genesis.kernel >>"$SN_LOG" + { + access_line 192.0.2.21 4096 /install/rh/x86_64/ + access_line "$CN_IP" 978729607 //install/netboot/ubuntu/x86_64/compute/rootimg.cpio.gz + } >>"$MN_LOG" + + run_check + [ "$status" -ne 0 ] + [[ "$output" == *"this provision was flat"* ]] } @test "the Debian per-vhost log format is read as the client address" {