From 6a4d3b0186ec62171d435e1b9242857a598d9295 Mon Sep 17 00:00:00 2001 From: Dusty Mabe Date: Wed, 2 Feb 2022 13:27:38 -0500 Subject: [PATCH] tests: add reboot check to ignition.kargs.basic This will further sanity check the karg persists even to subsequent boots. --- tests/kola/ignition/kargs/basic/test.sh | 27 +++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) 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"