From ed5c5b723c4d43dc22e2ec51597952dd102fec55 Mon Sep 17 00:00:00 2001 From: Daniel Hilst <392820+dhilst@users.noreply.github.com> Date: Mon, 9 Nov 2026 09:28:37 -0300 Subject: [PATCH] fix(xcat-core): two Ubuntu root handler bats cases fail on an Ubuntu runner "the online hook calls the handler with dracut's three arguments" and "a second interface does not fetch the image again" fail in the GitHub CI with "called: No such file or directory". Both cases source xcat-online.sh from sh. On Ubuntu sh is dash, and the dash "." builtin passes no arguments, so the hook sees no interface and returns before it calls the stub handler. The initramfs links sh to bash, so the cases now source the hook from bash. Run on an Ubuntu host, both cases fail before this change and pass after it. Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com> --- xCAT-test/bats/ubuntu_netboot_root_handler.bats | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xCAT-test/bats/ubuntu_netboot_root_handler.bats b/xCAT-test/bats/ubuntu_netboot_root_handler.bats index 192d194b53..b484f6058c 100644 --- a/xCAT-test/bats/ubuntu_netboot_root_handler.bats +++ b/xCAT-test/bats/ubuntu_netboot_root_handler.bats @@ -74,7 +74,7 @@ SH sed -e 's#/lib/dracut-lib.sh#${BATS_TEST_TMPDIR}/lib/dracut-lib.sh#' \ -e 's#/sbin/xcatroot#${bin}/sbin/xcatroot#g' \ -e 's#/tmp/xcat.rootimg.done#${BATS_TEST_TMPDIR}/done#' '$hook' > ./hook.sh - sh -c '. ./hook.sh eth0'" + bash -c '. ./hook.sh eth0'" [ "$status" -eq 0 ] [ "$(cat "${BATS_TEST_TMPDIR}/called")" = 'eth0 xcat /sysroot' ] } @@ -93,7 +93,7 @@ SH sed -e 's#/lib/dracut-lib.sh#${BATS_TEST_TMPDIR}/lib/dracut-lib.sh#' \ -e 's#/sbin/xcatroot#${bin}/sbin/xcatroot#g' \ -e 's#/tmp/xcat.rootimg.done#${BATS_TEST_TMPDIR}/done#' '$hook' > ./hook.sh - sh -c '. ./hook.sh eth0; . ./hook.sh eth1'" + bash -c '. ./hook.sh eth0; . ./hook.sh eth1'" [ "$status" -eq 0 ] [ "$(wc -l < "${BATS_TEST_TMPDIR}/count")" -eq 1 ] }