tests: Update run_tests.sh for new mkksiso syntax

The new version requires '--ks KS' to be passed to it and now supports
removing cmdline values before adding new ones.

Related: rhbz#2037015
This commit is contained in:
Brian C. Lane 2022-06-28 16:01:05 -07:00
parent 7f3b52ec74
commit 3222ecb13b

View File

@ -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/isolinux/isolinux.cfg" || fail "Missing isolinux.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
@ -125,17 +138,40 @@ function test_files {
[ -e "$ISODIR/services" ] || fail "Missing file from iso"
}
# 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/isolinux/isolinux.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"
}
# All of the changes
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
@ -164,8 +200,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