]> git.ipfire.org Git - thirdparty/dracut-ng.git/commitdiff
test(UEFI): prepare for testing with more than one kernel command line
authorJo Zzsi <jozzsicsataban@gmail.com>
Sun, 15 Sep 2024 18:44:14 +0000 (14:44 -0400)
committerLaszlo Gombos <laszlo.gombos@gmail.com>
Thu, 19 Sep 2024 18:46:14 +0000 (14:46 -0400)
Use SMBIOS Type 11 Strings support in systemd-stub
(io.systemd.stub.kernel-cmdline-extra).

test/TEST-18-UEFI/test.sh

index 5261f923b82f0c03a733bb38b28491d9655448af..ee18c3e6cf80fb44404f65fc9690c892175ded94 100755 (executable)
@@ -7,7 +7,13 @@ test_check() {
     [[ -n "$(ovmf_code)" ]]
 }
 
-test_run() {
+client_run() {
+    local test_name="$1"
+    shift
+    local client_opts="$*"
+
+    echo "CLIENT TEST START: $test_name"
+
     declare -a disk_args=()
     declare -i disk_index=1
     qemu_add_drive disk_index disk_args "$TESTDIR"/marker.img marker
@@ -17,10 +23,15 @@ test_run() {
     "$testdir"/run-qemu "${disk_args[@]}" -net none \
         -drive file=fat:rw:"$TESTDIR"/ESP,format=vvfat,label=EFI \
         -global driver=cfi.pflash01,property=secure,value=on \
+        -smbios type=11,value=io.systemd.stub.kernel-cmdline-extra="$client_opts" \
         -drive if=pflash,format=raw,unit=0,file="$(ovmf_code)",readonly=on
     test_marker_check || return 1
 }
 
+test_run() {
+    client_run "readonly root" "ro rd.skipfsck" || return 1
+}
+
 test_setup() {
     # Create what will eventually be our root filesystem
     "$DRACUT" -N -l --keep --tmpdir "$TESTDIR" \
@@ -46,12 +57,12 @@ test_setup() {
         ukify build \
             --linux="$VMLINUZ" \
             --initrd="$TESTDIR"/initramfs.testing \
-            --cmdline='root=/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_root ro rd.skipfsck' \
+            --cmdline='root=/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_root' \
             --output="$TESTDIR"/ESP/EFI/BOOT/BOOTX64.efi
     else
         echo "Using dracut to create UKI"
         test_dracut \
-            --kernel-cmdline 'root=/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_root ro rd.skipfsck' \
+            --kernel-cmdline 'root=/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_root' \
             --drivers 'squashfs' \
             --uefi \
             "$TESTDIR"/ESP/EFI/BOOT/BOOTX64.efi