From 83f3df2487b6c473f2d36da0ba44e089c31f84fc 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 dcfad77c3c..c31163c6fe 100755 --- a/tests/kola/ignition/kargs/basic/test.sh +++ b/tests/kola/ignition/kargs/basic/test.sh @@ -6,10 +6,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"