tests: Update run_tests.sh for new mkksiso

Related: rhbz#2088631
This commit is contained in:
Brian C. Lane 2022-06-15 15:19:22 -07:00
parent b4f9339f7e
commit b10dbfa7d1

View File

@ -7,7 +7,6 @@ KSNAME=minimal.ks
KS="/usr/share/doc/lorax/$KSNAME"
OUTISO=/var/tmp/out.iso
ISODIR=/var/tmp/iso
IMGDIR=/var/tmp/img
## Functions for testing mkkiso
@ -32,12 +31,11 @@ function running {
# unmount the dirs lazily because sometimes some outside thing is still touching them
function umount_dirs {
umount --lazy "$IMGDIR"
umount --lazy "$ISODIR"
rm -f "$OUTISO"
}
[ -e "$ISODIR" ] || mkdir "$ISODIR"
[ -e "$IMGDIR" ] || mkdir "$IMGDIR"
# Only add kickstart
function ks_only {
@ -61,8 +59,7 @@ function test_ks {
grep "inst.ks=.*$KSNAME" "$ISODIR/isolinux/isolinux.cfg" || fail "Missing isolinux.cfg kickstart entry"
# Is the kickstart in the UEFI config?
mount "$ISODIR/images/efiboot.img" "$IMGDIR" || exit 1
grep "inst.ks=.*$KSNAME" "$IMGDIR/EFI/BOOT/grub.cfg" || fail "Missing UEFI grub.cfg kickstart entry"
grep "inst.ks=.*$KSNAME" "$ISODIR/EFI/BOOT/grub.cfg" || fail "Missing UEFI grub.cfg kickstart entry"
}
# Add ks and cmdline
@ -85,7 +82,7 @@ function test_ks_serial {
grep "console=ttyS0,115200n8" "$ISODIR/isolinux/isolinux.cfg" || fail "Missing isolinux.cfg cmdline entry"
# Is the serial in the UEFI config?
grep "console=ttyS0,115200n8" "$IMGDIR/EFI/BOOT/grub.cfg" || fail "Missing UEFI grub.cfg cmdline entry"
grep "console=ttyS0,115200n8" "$ISODIR/EFI/BOOT/grub.cfg" || fail "Missing UEFI grub.cfg cmdline entry"
}
# New VOLID
@ -107,7 +104,7 @@ function test_volid {
grep "hd:LABEL=mkksiso-test" "$ISODIR/isolinux/isolinux.cfg" || fail "Missing isolinux.cfg kickstart entry"
# Is the VOLID in the UEFI config?
grep "hd:LABEL=mkksiso-test" "$IMGDIR/EFI/BOOT/grub.cfg" || fail "Missing UEFI grub.cfg kickstart entry"
grep "hd:LABEL=mkksiso-test" "$ISODIR/EFI/BOOT/grub.cfg" || fail "Missing UEFI grub.cfg kickstart entry"
}
# Add extra files
@ -158,9 +155,11 @@ if [ -z "$REPOS" ]; then
fi
# Run lorax using the host's repository configuration file
if [ ! -e "$BOOTISO" ]; then
running "Build boot.iso with lorax"
lorax --product="Red Hat Enterprise Linux" --version=9 --release=9 --volid="RHEL-9-test" \
$REPOS --isfinal /var/tmp/lorax-rhel9-iso/ || exit 1
fi
# Test mkksiso on the new boot.iso
ks_only