]> xenbits.xensource.com Git - libvirt.git/commitdiff
tests: Fix some test cases on macOS
authorAndrea Bolognani <abologna@redhat.com>
Wed, 25 Oct 2023 14:48:18 +0000 (16:48 +0200)
committerAndrea Bolognani <abologna@redhat.com>
Thu, 26 Oct 2023 09:31:06 +0000 (11:31 +0200)
Test cases that depend on duplicating fds are using fairly big
values as targets.

This works fine on Linux, where RLIMIT_NOFILE is 1024 by
default, but fails on macOS which uses 256 as the default.

Decrease the values so that they're valid across all platforms.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
tests/qemuxml2argvdata/disk-source-fd.x86_64-latest.args
tests/qemuxml2argvdata/disk-vhostvdpa.x86_64-latest.args
tests/qemuxml2argvtest.c

index 9d8109a8f4be501dca3e84794ee8fe11fbb02180..1341b7d032e4c0bf3d08e4a48dddaad4d1b3f200 100644 (file)
@@ -27,18 +27,18 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
 -no-shutdown \
 -boot strict=on \
 -device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0x2"}' \
--add-fd set=2,fd=700,opaque=libvirt-4-storage0 \
--add-fd set=2,fd=705,opaque=libvirt-4-storage1 \
+-add-fd set=2,fd=200,opaque=libvirt-4-storage0 \
+-add-fd set=2,fd=205,opaque=libvirt-4-storage1 \
 -blockdev '{"driver":"file","filename":"/dev/fdset/2","node-name":"libvirt-4-storage","auto-read-only":true,"discard":"unmap"}' \
 -blockdev '{"node-name":"libvirt-4-format","read-only":false,"driver":"qcow2","file":"libvirt-4-storage"}' \
 -device '{"driver":"virtio-blk-pci","bus":"pci.0","addr":"0x2","drive":"libvirt-4-format","id":"virtio-disk4","bootindex":1}' \
 -blockdev '{"driver":"file","filename":"/var/lib/libvirt/images/rhel7.1484071876","node-name":"libvirt-3-storage","auto-read-only":true,"discard":"unmap"}' \
 -blockdev '{"node-name":"libvirt-3-format","read-only":true,"driver":"qcow2","file":"libvirt-3-storage","backing":null}' \
--add-fd set=1,fd=777,opaque=libvirt-2-storage0 \
--add-fd set=1,fd=778,opaque=libvirt-2-storage1 \
+-add-fd set=1,fd=247,opaque=libvirt-2-storage0 \
+-add-fd set=1,fd=248,opaque=libvirt-2-storage1 \
 -blockdev '{"driver":"file","filename":"/dev/fdset/1","node-name":"libvirt-2-storage","auto-read-only":true,"discard":"unmap"}' \
 -blockdev '{"node-name":"libvirt-2-format","read-only":true,"driver":"qcow2","file":"libvirt-2-storage","backing":"libvirt-3-format"}' \
--add-fd set=0,fd=704,opaque=libvirt-1-storage0 \
+-add-fd set=0,fd=204,opaque=libvirt-1-storage0 \
 -blockdev '{"driver":"file","filename":"/dev/fdset/0","node-name":"libvirt-1-storage","read-only":false,"discard":"unmap"}' \
 -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"qcow2","file":"libvirt-1-storage","backing":"libvirt-2-format"}' \
 -device '{"driver":"virtio-blk-pci","bus":"pci.0","addr":"0x3","drive":"libvirt-1-format","id":"virtio-disk5"}' \
index b987455ee4f31c06aedc665ca21f017e0a225a9e..27035184ad932c9ff1b8fea102b5b3fc8a27019b 100644 (file)
@@ -27,7 +27,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
 -no-shutdown \
 -boot strict=on \
 -device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0x2"}' \
--add-fd set=0,fd=801,opaque=libvirt-1-storage-vdpa \
+-add-fd set=0,fd=201,opaque=libvirt-1-storage-vdpa \
 -blockdev '{"driver":"virtio-blk-vhost-vdpa","path":"/dev/fdset/0","node-name":"libvirt-1-storage","cache":{"direct":true,"no-flush":false},"auto-read-only":true,"discard":"unmap"}' \
 -blockdev '{"node-name":"libvirt-1-format","read-only":false,"cache":{"direct":true,"no-flush":false},"driver":"raw","file":"libvirt-1-storage"}' \
 -device '{"driver":"virtio-blk-pci","bus":"pci.0","addr":"0x2","drive":"libvirt-1-format","id":"virtio-disk0","bootindex":1,"write-cache":"on"}' \
index 48058cb9241d5a9394f9bc76903970106f9e1f50..4fda68a4cee43b72dc40c6142f76d84d7abdf999 100644 (file)
@@ -1186,7 +1186,7 @@ mymain(void)
     DO_TEST_CAPS_LATEST("disk-vhostuser-numa");
     DO_TEST_CAPS_LATEST("disk-vhostuser");
     DO_TEST_CAPS_ARCH_LATEST_FULL("disk-vhostvdpa", "x86_64",
-                                  ARG_VDPA_FD, "/dev/vhost-vdpa-0", 801);
+                                  ARG_VDPA_FD, "/dev/vhost-vdpa-0", 201);
     DO_TEST_CAPS_LATEST_PARSE_ERROR("disk-device-lun-type-invalid");
     DO_TEST_CAPS_LATEST_PARSE_ERROR("disk-attaching-partition-nosupport");
     DO_TEST_CAPS_LATEST("disk-usb-device");
@@ -1226,9 +1226,9 @@ mymain(void)
     DO_TEST_CAPS_LATEST("disk-backing-chains-index");
     DO_TEST_CAPS_LATEST("disk-backing-chains-noindex");
     DO_TEST_CAPS_ARCH_LATEST_FULL("disk-source-fd", "x86_64",
-                                  ARG_FD_GROUP, "testgroup2", 2, 700, 705,
-                                  ARG_FD_GROUP, "testgroup5", 1, 704,
-                                  ARG_FD_GROUP, "testgroup6", 2, 777, 778);
+                                  ARG_FD_GROUP, "testgroup2", 2, 200, 205,
+                                  ARG_FD_GROUP, "testgroup5", 1, 204,
+                                  ARG_FD_GROUP, "testgroup6", 2, 247, 248);
 
     DO_TEST_CAPS_LATEST("disk-slices");
     DO_TEST_CAPS_LATEST("disk-rotation");