tests: Add test for positional kickstart usage

This commit is contained in:
Brian C. Lane 2022-07-25 10:39:21 -07:00
parent 131e3892a1
commit 76539177e1

View File

@ -39,14 +39,27 @@ function umount_dirs {
# Only add kickstart # Only add kickstart
function ks_only { function ks_only {
running "Add kickstart to iso" running "Add kickstart to iso using --ks"
mkksiso --ks $KS $BOOTISO $OUTISO || exit 1 mkksiso --ks $KS $BOOTISO $OUTISO || exit 1
mount $OUTISO $ISODIR || exit 1 mount $OUTISO $ISODIR || exit 1
test_ks test_ks
status "Add kickstart" status "Add kickstart to iso using --ks"
umount_dirs
}
# Only add kickstart
function ks_pos_only {
running "Add kickstart to iso using positional argument"
mkksiso $KS $BOOTISO $OUTISO || exit 1
mount $OUTISO $ISODIR || exit 1
test_ks
status "Add kickstart to iso using positional argument"
umount_dirs umount_dirs
} }
@ -155,6 +168,15 @@ function test_quiet {
! grep "linux.*quiet" "$ISODIR/EFI/BOOT/grub.cfg" || fail "quiet not removed from UEFI grub.cfg cmdline entry" ! grep "linux.*quiet" "$ISODIR/EFI/BOOT/grub.cfg" || fail "quiet not removed from UEFI grub.cfg cmdline entry"
} }
# Test error if passing both --ks FILE and 3 arguments
function test_two_kickstarts {
running "Test two kickstart error"
mkksiso --ks $KS $KS $BOOTISO $OUTISO && fail "No error using --ks and positional argument"
status "Test two kickstart error"
}
function test_files { function test_files {
[ -e "$ISODIR/services" ] || fail "Missing file from iso" [ -e "$ISODIR/services" ] || fail "Missing file from iso"
@ -214,11 +236,13 @@ fi
# Test mkksiso on the new boot.iso # Test mkksiso on the new boot.iso
ks_only ks_only
ks_pos_only
ks_serial ks_serial
only_serial only_serial
new_volid new_volid
add_files add_files
remove_quiet remove_quiet
test_two_kickstarts
run_all run_all
run_as_user run_as_user