From 6d5f8bcec5f9dbd690d9dd3707b41ca098447441 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Ferr=C3=A3o?= <2031761+viniciusferrao@users.noreply.github.com> Date: Fri, 30 Oct 2026 16:25:40 -0300 Subject: [PATCH] test(netboot): cover the EL10 initrd network handoff The dracut_105 xcatroot must not copy dhclient leases or write an ifcfg file. With the earlier script the case fails on the "cannot stat" and ifcfg errors that an EL10 boot printed. --- xCAT-test/bats/xcatroot_rootimg_checksum.bats | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/xCAT-test/bats/xcatroot_rootimg_checksum.bats b/xCAT-test/bats/xcatroot_rootimg_checksum.bats index 195707595e..550c56d9ab 100644 --- a/xCAT-test/bats/xcatroot_rootimg_checksum.bats +++ b/xCAT-test/bats/xcatroot_rootimg_checksum.bats @@ -174,7 +174,7 @@ run_xcatroot() done # genimage puts the helper in every initial ramdisk that can receive the root image over UFTP. [ -n "$NO_UFTP_HELPER" ] || sandbox+=(--ro-bind "$(repo_path xCAT-server/share/xcat/netboot/imgutils/xcat-rootimg-fetch.sh)" /lib/xcat-rootimg-fetch.sh) - echo "imgurl=$URL XCAT=192.0.2.1:3001 nonodestatus $CMDLINE $UFTP" >"$FX/cmdline" + echo "imgurl=$URL XCAT=192.0.2.1:3001 nonodestatus $CMDLINE $UFTP $KERNEL_ARGS" >"$FX/cmdline" echo "$IMAGE_PLAN" >"$FX/image.plan" echo "$CHECKSUM_PLAN" >"$FX/checksum.plan" echo "${MAXWAITS:-100}" >"$FX/maxwaits" @@ -309,3 +309,11 @@ check_each_script() CMDLINE= SCRIPTS=$UFTP_SCRIPTS UFTP="xcat.uftp=1045 xcat.uftpfp=$FP" check_each_script 'packed image' "$URL " 0 'Cannot receive .*rootimg.cpio.gz over UFTP' } + +@test 'the EL10 initial ramdisk copies no dhclient lease and writes no ifcfg file' { + SCRIPTS='xCAT-server/share/xcat/netboot/rh/dracut_105/stateless/xcatroot bash' + KERNEL_ARGS='ifname=eth0:52:54:00:12:34:56' + check_each_script 'packed image' "$URL.sha256 $URL $URL.sha256 " 0 '' + run grep -E 'dhclient|network-scripts' "$FX/console" + [ "$status" -eq 1 ] || { echo "$output"; return 1; } +}