From 6382bf81e2529ca14951003ee9a4451faed0da92 Mon Sep 17 00:00:00 2001 From: Daniel Hilst <392820+dhilst@users.noreply.github.com> Date: Wed, 30 Sep 2026 12:41:05 -0300 Subject: [PATCH] fix(xcat-core): the provisioning-source check fails a correct hierarchical run On the Ubuntu 24.04 hierarchy cell the check reported the right counts and then failed: "xcat22-sn served xcat22-cn 277 boot-payload request(s)", "xcat22-mn-dhilst served xcat22-cn 0", and then "no httpd access log with new entries could be read on xcat22-mn-dhilst". The guard required the management node log to gain lines after the baseline. It does not: the management node provisions the service node in SN_setup_case, before the baseline the hierarchy case takes, and it is then idle. Its silence is the result the check exists to find. The guard now asks that the log hold at least one line, which is what makes a count of 0 mean something, and no longer asks for activity in the measured window. The path filter also missed a doubled leading slash. The compute node fetches the root image with wget as //install/netboot///compute/rootimg.cpio.gz, which the service node logged and the filter did not count. check_provisioning_source.bats covers both. The four cases added in the commit before this one fail without this change. Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com> --- .../commoncmd/check_provisioning_source.sh | 14 ++++++++------ 1 file changed, 8 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..0310e6fb3 100755 --- a/xCAT-test/autotest/testcase/commoncmd/check_provisioning_source.sh +++ b/xCAT-test/autotest/testcase/commoncmd/check_provisioning_source.sh @@ -21,7 +21,8 @@ # Run --baseline before provisioning: an earlier flat run leaves management-node requests for the # same address, and counting the whole log fails a later hierarchical run for them. And only a # request under /install or /tftpboot is a boot payload: a 404 for /favicon.ico is a request from -# the compute node that carries no payload, and it must not stand for one. +# the compute node that carries no payload, and it must not stand for one. wget asks for the root +# image as //install/..., so the leading slash repeats. # # Scope: the PXE ROM exchange hands out xcat/xnba.kpxe over TFTP and httpd never sees it. # xnba.kpxe is the same binary on both servers, so it decides nothing about the fetch source. @@ -102,7 +103,7 @@ count_local_requests() if ($1 != ip && $2 != ip) next path = "" for (i = 1; i <= NF; i++) if ($i ~ /^"(GET|HEAD|POST)$/) { path = $(i + 1); break } - if (path ~ /^\/(install|tftpboot)\//) payload++ + if (path ~ /^\/+(install|tftpboot)\//) payload++ } END { print token, "ok", payload + 0, fresh + 0, total + 0 } ' $logs @@ -202,10 +203,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 answers nothing: it counts 0 whether the management node served the compute node +# or not. It does NOT have to gain lines after the baseline -- it provisions the service node +# before it and is then idle, and that silence is the hierarchical result. +if [ "$MN_STATE" != ok ] || [ "$MN_LINES" -eq 0 ]; then + echo "provisioning source error: no httpd access log with any entry could be read on $MN" >&2 RC=1 fi