diff --git a/tests/.fmf/version b/.fmf/version similarity index 100% rename from tests/.fmf/version rename to .fmf/version diff --git a/plans/build-iso.fmf b/plans/build-iso.fmf new file mode 100644 index 0000000..210ce66 --- /dev/null +++ b/plans/build-iso.fmf @@ -0,0 +1,7 @@ +summary: Run Lorax tests (build an iso, run mkksiso on it) +prepare: + how: install + package: + - lorax-templates-rhel +execute: + script: ./tests/scripts/run_tests.sh diff --git a/tests/provision.fmf b/tests/provision.fmf deleted file mode 100644 index dd69f34..0000000 --- a/tests/provision.fmf +++ /dev/null @@ -1,5 +0,0 @@ ---- - -standard-inventory-qcow2: - qemu: - m: 4G diff --git a/tests/scripts/run_tests.sh b/tests/scripts/run_tests.sh index 02897a1..3ba4718 100755 --- a/tests/scripts/run_tests.sh +++ b/tests/scripts/run_tests.sh @@ -1,6 +1,10 @@ #!/bin/bash set -eux +ARCH=$(uname -m) +[ "$ARCH" == "x86_64" ] || [ "$ARCH" == "aarch64" ] + + FAILANY=0 BOOTISO=/var/tmp/lorax-rhel9-iso/images/boot.iso KSNAME=minimal.ks @@ -64,6 +68,14 @@ function ks_pos_only { } function test_ks { + if [ "$ARCH" == "x86_64" ]; then + test_ks_x86 + elif [ "$ARCH" == "aarch64" ]; then + test_ks_aarch64 + fi +} + +function test_ks_x86 { ## This all needs to be another function # Is there a kickstart in / of the iso? [ -e "$ISODIR/$KSNAME" ] || fail "Missing kickstart" @@ -75,6 +87,15 @@ function test_ks { grep "inst.ks=.*$KSNAME" "$ISODIR/EFI/BOOT/grub.cfg" || fail "Missing UEFI grub.cfg kickstart entry" } +function test_ks_aarch64 { + ## This all needs to be another function + # Is there a kickstart in / of the iso? + [ -e "$ISODIR/$KSNAME" ] || fail "Missing kickstart" + + # Is the kickstart in the UEFI config? + grep "inst.ks=.*$KSNAME" "$ISODIR/EFI/BOOT/grub.cfg" || fail "Missing UEFI grub.cfg kickstart entry" +} + # Add ks and cmdline function ks_serial { running "Add kickstart and serial cmdline" @@ -103,7 +124,14 @@ function only_serial { } function test_serial { + if [ "$ARCH" == "x86_64" ]; then + test_serial_x86 + elif [ "$ARCH" == "aarch64" ]; then + test_serial_aarch64 + fi +} +function test_serial_x86 { # Is the serial in the BIOS config? grep "console=ttyS0,115200n8" "$ISODIR/isolinux/isolinux.cfg" || fail "Missing isolinux.cfg cmdline entry" @@ -111,6 +139,11 @@ function test_serial { grep "console=ttyS0,115200n8" "$ISODIR/EFI/BOOT/grub.cfg" || fail "Missing UEFI grub.cfg cmdline entry" } +function test_serial_aarch64 { + # Is the serial in the UEFI config? + grep "console=ttyS0,115200n8" "$ISODIR/EFI/BOOT/grub.cfg" || fail "Missing UEFI grub.cfg cmdline entry" +} + # New VOLID function new_volid { running "Use a new VOLID" @@ -126,6 +159,14 @@ function new_volid { } function test_volid { + if [ "$ARCH" == "x86_64" ]; then + test_volid_x86 + elif [ "$ARCH" == "aarch64" ]; then + test_volid_aarch64 + fi +} + +function test_volid_x86 { # Is the VOLID in the BIOS config? grep "hd:LABEL=mkksiso-test" "$ISODIR/isolinux/isolinux.cfg" || fail "Missing isolinux.cfg kickstart entry" @@ -133,6 +174,11 @@ function test_volid { grep "hd:LABEL=mkksiso-test" "$ISODIR/EFI/BOOT/grub.cfg" || fail "Missing UEFI grub.cfg kickstart entry" } +function test_volid_aarch64 { + # Is the VOLID in the UEFI config? + grep "hd:LABEL=mkksiso-test" "$ISODIR/EFI/BOOT/grub.cfg" || fail "Missing UEFI grub.cfg kickstart entry" +} + # Add extra files function add_files { running "Add files" @@ -165,6 +211,14 @@ function remove_quiet { } function test_quiet { + if [ "$ARCH" == "x86_64" ]; then + test_quiet_x86 + elif [ "$ARCH" == "aarch64" ]; then + test_quiet_aarch64 + fi +} + +function test_quiet_x86 { # Is quiet in the BIOS config? ! grep "append.*quiet" "$ISODIR/isolinux/isolinux.cfg" || fail "quiet not removed from BIOS grub.cfg cmdline entry" @@ -172,6 +226,11 @@ function test_quiet { ! grep "linux.*quiet" "$ISODIR/EFI/BOOT/grub.cfg" || fail "quiet not removed from UEFI grub.cfg cmdline entry" } +function test_quiet_aarch64 { + # Is quiet in the UEFI config? + ! 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" diff --git a/tests/tests.yml b/tests/tests.yml deleted file mode 100644 index e8f3de2..0000000 --- a/tests/tests.yml +++ /dev/null @@ -1,16 +0,0 @@ ---- -# Run lorax with the new templates -- hosts: localhost - roles: - - role: standard-test-basic - tags: - - classic - - required_packages: - - lorax - - lorax-templates-rhel - - tests: - - simple: - dir: scripts - run: ./run_tests.sh