2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-10-02 08:51:44 +00:00

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>
This commit is contained in:
Daniel Hilst
2026-09-30 12:01:50 -03:00
parent 045d1ce584
commit 0f708b96a6
2 changed files with 24 additions and 6 deletions
@@ -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
+19 -2
View File
@@ -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" {