diff --git a/tests/kola/ignition/kargs/basic/test.sh b/tests/kola/ignition/kargs/basic/test.sh index 5e39e781d5..f4ab07118e 100755 --- a/tests/kola/ignition/kargs/basic/test.sh +++ b/tests/kola/ignition/kargs/basic/test.sh @@ -4,10 +4,25 @@ set -xeuo pipefail . $KOLA_EXT_DATA/commonlib.sh -if ! grep foobar /proc/cmdline; then - fatal "missing foobar in kernel cmdline" -fi -if grep mitigations /proc/cmdline; then - fatal "found mitigations in kernel cmdline" -fi +kargchecks() { + if ! grep foobar /proc/cmdline; then + fatal "missing foobar in kernel cmdline" + fi + if grep mitigations /proc/cmdline; then + fatal "found mitigations in kernel cmdline" + fi +} + +case "${AUTOPKGTEST_REBOOT_MARK:-}" in + "") + kargchecks + # Now reboot the machine and verify the kernel argument persists + /tmp/autopkgtest-reboot nextboot + ;; + nextboot) + kargchecks + ;; + *) fatal "unexpected mark: ${AUTOPKGTEST_REBOOT_MARK}";; +esac + ok "Ignition kargs"