]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: Make sure serial is always set explicitly for scsi-hd qemu devices
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 26 Mar 2025 09:26:36 +0000 (10:26 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 26 Mar 2025 13:40:14 +0000 (14:40 +0100)
Now that mkosi uses -blockdev instead -drive, the device_id property
of scsi-hd devices is not populated automatically anymore so we have to
make sure to always specify serial= to make sure /dev/disk/by-id is populated
as expected in the test.

test/TEST-24-CRYPTSETUP/meson.build
test/TEST-64-UDEV-STORAGE/meson.build

index af41f161bfe95978ab9c4618f0d964caa2a7b991..ccf6f1ede86680ac13b3ad999475fc6544095f5f 100644 (file)
@@ -16,7 +16,7 @@ integration_tests += [
                 ],
                 'qemu-args' : [
                         '-drive', 'id=keydev,if=none,format=raw,cache=unsafe,file=@0@'.format(project_build_root / 'mkosi.output/keydev.raw'),
-                        '-device', 'scsi-hd,drive=keydev',
+                        '-device', 'scsi-hd,drive=keydev,serial=keydev',
                 ],
                 'mkosi-args' : integration_test_template['mkosi-args'] + [
                         '--runtime-size=11G',
index 6b4cc74fe56b7ef7a7bd617ea6672a7487b2d605..acd6b191d0c712973cc1b71925c0848b83c90893 100644 (file)
@@ -160,7 +160,7 @@ foreach i : range(128)
         cmdline += [f'--drive=@id@:1M::']
         div = i / 32
         mod = i % 32
-        qemu_args += ['-device', f'scsi-hd,drive=@id@,bus=scsi@div@.0,channel=0,scsi-id=@mod@,lun=0']
+        qemu_args += ['-device', f'scsi-hd,drive=@id@,serial=@id@,bus=scsi@div@.0,channel=0,scsi-id=@mod@,lun=0']
 endforeach
 
 udev_storage_tests += {
@@ -233,7 +233,7 @@ if qemu.found()
                 foreach i : range(16)
                         id = f'drive@i@'
                         cmdline += [f'--drive=@id@:40M::']
-                        qemu_args += ['-device', f'scsi-hd,drive=@id@,bus=scsi0.0,channel=0,scsi-id=0,lun=@i@']
+                        qemu_args += ['-device', f'scsi-hd,drive=@id@,serial=@id@,bus=scsi0.0,channel=0,scsi-id=0,lun=@i@']
                 endforeach
 
                 udev_storage_tests += {