@samitouri / QOSamiQemu / commits / 5d32afbd5e

iotests: validate dmsetup result in test 128

The I/O test 128 uses 'dmsetup create' to create a device, optionally using sudo to elevate privileges. This dmsetup command works in GitLab CI, however, the test then fails with a missing device name: 1..1 # running raw 128 not ok raw 128 ----------------------------------- stderr ----------------------------------- --- /builds/berrange/qemu/tests/qemu-iotests/128.out +++ /builds/berrange/qemu/build/scratch/raw-file-128/128.out.bad @@ -1,5 +1,5 @@ QA output created by 128 == reading from error device == -read failed: Input/output error +qemu-io: can't open device /dev/mapper/eiodev16546: Could not open '/dev/mapper/eiodev16546': No such file or directory *** done (test program exited with status code 1) It is believed that this is due to the build env using a manually populated /dev, such that the device mapper node won't ever appear. It is not a race, since a test adding a sleep did not result in the device appearing. Reviewed-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>

Daniel P. Berrangé committed Jan 12, 2026 at 16:33 UTC 5d32afbd5e1a0364b1e22ec28a7c8d836a29777e
1 file changed +6
tests/qemu-iotests/128
+6
@@ -42,6 +42,12 @@ _setup_eiodev()
42 echo "0 $((1024 * 1024 * 1024 / 512)) error" | \
43 $cmd dmsetup create "$devname" 2>/dev/null
44 if [ "$?" -eq 0 ]; then
45 + DEV="/dev/mapper/$devname"
46 + if ! -e $DEV
47 + then
48 + _notrun "Device $DEV not appearing"
49 + fi
50 +
51 sudo="$cmd"
52 return
53 fi