From bcb4a77f1a6626be75f079478acbf2355d3fb98f Mon Sep 17 00:00:00 2001 From: Daniel Hilst <392820+dhilst@users.noreply.github.com> Date: Wed, 30 Sep 2026 13:09:38 -0300 Subject: [PATCH] fix(xcat-core): the provisioning-source check reads the host log beside the test one local_logs added XCAT_HTTPD_ACCESS_LOG to the list of candidate logs and then read the system paths as well. On a build host that runs apache, the check counted the host's own /var/log/apache2/access.log beside the file the test pointed at, so a test could not control what it measured. The empty-log case read 64 lines it did not write. An explicit XCAT_HTTPD_ACCESS_LOG now replaces the search instead of extending it. Production behaviour is unchanged: nothing sets that variable there. Without this change the bats case for an empty management-node log fails on a host that serves apache, and passes on one that does not. Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com> --- .../testcase/commoncmd/check_provisioning_source.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/xCAT-test/autotest/testcase/commoncmd/check_provisioning_source.sh b/xCAT-test/autotest/testcase/commoncmd/check_provisioning_source.sh index 1f4883d6a..fec31edd3 100755 --- a/xCAT-test/autotest/testcase/commoncmd/check_provisioning_source.sh +++ b/xCAT-test/autotest/testcase/commoncmd/check_provisioning_source.sh @@ -38,8 +38,14 @@ STATE="${XCAT_PROV_SOURCE_STATE:-/var/tmp/xcat-provisioning-source.base}" # Debian per-vhost format puts the vhost there and the client in field 2. local_logs() { - for f in ${XCAT_HTTPD_ACCESS_LOG:-} \ - /var/log/httpd/access_log \ + # An explicit log REPLACES the search. Without this a test that points here still reads the + # host's own apache log, so it cannot control what the check counts. + if [ -n "${XCAT_HTTPD_ACCESS_LOG:-}" ]; then + [ -r "$XCAT_HTTPD_ACCESS_LOG" ] && echo "$XCAT_HTTPD_ACCESS_LOG" + return 0 + fi + + for f in /var/log/httpd/access_log \ /var/log/apache2/access.log \ /var/log/apache2/access_log \ /var/log/apache2/other_vhosts_access.log