diff --git a/tests/scripts/run_tests.sh b/tests/scripts/run_tests.sh index 5b62988..0be981b 100755 --- a/tests/scripts/run_tests.sh +++ b/tests/scripts/run_tests.sh @@ -41,7 +41,7 @@ function umount_dirs { function ks_only { running "Add kickstart to iso" - mkksiso $KS $BOOTISO $OUTISO || exit 1 + mkksiso --ks $KS $BOOTISO $OUTISO || exit 1 mount $OUTISO $ISODIR || exit 1 test_ks @@ -66,17 +66,30 @@ function test_ks { function ks_serial { running "Add kickstart and serial cmdline" - mkksiso -c "console=ttyS0,115200n8" $KS $BOOTISO $OUTISO || exit 1 + mkksiso -c "console=ttyS0,115200n8" --ks $KS $BOOTISO $OUTISO || exit 1 mount $OUTISO $ISODIR || exit 1 test_ks - test_ks_serial + test_serial status "Add kickstart and serial cmdline" umount_dirs } -function test_ks_serial { +# Only add serial console to cmdline +function only_serial { + running "Add serial cmdline (no ks)" + + mkksiso -c "console=ttyS0,115200n8" $BOOTISO $OUTISO || exit 1 + mount $OUTISO $ISODIR || exit 1 + + test_serial + + status "Add kickstart and serial cmdline" + umount_dirs +} + +function test_serial { # Is the serial in the BIOS config? grep "console=ttyS0,115200n8" "$ISODIR/boot/grub2/grub.cfg" || fail "Missing BIOS grub.cfg cmdline entry" @@ -89,7 +102,7 @@ function test_ks_serial { function new_volid { running "Use a new VOLID" - mkksiso -V "mkksiso-test" $KS $BOOTISO $OUTISO || exit 1 + mkksiso -V "mkksiso-test" --ks $KS $BOOTISO $OUTISO || exit 1 mount $OUTISO $ISODIR || exit 1 test_ks @@ -111,7 +124,7 @@ function test_volid { function add_files { running "Add files" - mkksiso -a /etc/services $KS $BOOTISO $OUTISO || exit 1 + mkksiso -a /etc/services --ks $KS $BOOTISO $OUTISO || exit 1 mount $OUTISO $ISODIR || exit 1 test_ks @@ -121,6 +134,28 @@ function add_files { umount_dirs } +# Remove quiet from the cmdline +function remove_quiet { + running "remove quiet from cmdline (no ks)" + + mkksiso --rm "quiet" $BOOTISO $OUTISO || exit 1 + mount $OUTISO $ISODIR || exit 1 + + test_quiet + + status "Remove quiet from cmdline" + umount_dirs +} + +function test_quiet { + # Is quiet in the BIOS config? + ! grep "append.*quiet" "$ISODIR/boot/grub2/grub.cfg" || fail "quiet not removed from BIOS grub.cfg cmdline entry" + + # Is quiet in the UEFI config? + ! grep "linux.*quiet" "$ISODIR/EFI/BOOT/grub.cfg" || fail "quiet not removed from UEFI grub.cfg cmdline entry" +} + + function test_files { [ -e "$ISODIR/services" ] || fail "Missing file from iso" } @@ -129,13 +164,14 @@ function test_files { function run_all { running "Use all the options" - mkksiso -a /etc/services -V "mkksiso-test" -c "console=ttyS0,115200n8" $KS $BOOTISO $OUTISO || exit 1 + mkksiso -a /etc/services -V "mkksiso-test" -c "console=ttyS0,115200n8" --rm "quiet" --ks $KS $BOOTISO $OUTISO || exit 1 mount $OUTISO $ISODIR || exit 1 test_ks - test_ks_serial + test_serial test_volid test_files + test_quiet status "Use all the options" umount_dirs @@ -161,8 +197,10 @@ fi # Test mkksiso on the new boot.iso ks_only ks_serial +only_serial new_volid add_files +remove_quiet run_all exit $FAILANY