
The series continues effort of fixing libvirt test suite on macOS [1] and combines previous patches sent a week ago [2][3]. The tests have been fixed: qemuhotplugtest qemumemlocktest qemuxml2xmltest storagepoolxml2argvtest Number of failing tests has been reduced to two: qemusecuritytest qemuxml2argvtest Changes since v1: - Separated virpcimock patch into two (Andrea) - Fixed incorrect test mock data after glusterfs arguments were reordered, instead of intruducing darwin-only test data (Andrea) 1. https://gitlab.com/libvirt/libvirt/-/issues/58 2. https://www.redhat.com/archives/libvir-list/2020-October/msg01345.html 3. https://www.redhat.com/archives/libvir-list/2020-October/msg01347.html Roman Bolshakov (3): virpcimock: Initialize real_close before using it virpcimock: Enable on macOS storagepoolxml2argvtest: Reorder gluster arguments tests/storagepoolxml2argvdata/pool-netfs-gluster.argv | 2 +- tests/virpcimock.c | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) -- 2.28.0

real_close() is not inialized by the first invocation of close(). That causes an issue when the mock is used before others and a call of real_close() results in a jump to NULL pointer. Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com> --- tests/virpcimock.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/virpcimock.c b/tests/virpcimock.c index 064218d275..438cb7a672 100644 --- a/tests/virpcimock.c +++ b/tests/virpcimock.c @@ -1123,6 +1123,8 @@ opendir(const char *path) int close(int fd) { + init_syms(); + if (remove_fd(fd) < 0) return -1; return real_close(fd); -- 2.28.0

In general, it has little sense to use Linux pci mock on macOS but virPCIDeviceAddressGetIOMMUGroupNum() is relying on the filesystem layout mocked by virpcimock. And all tests that rely on correct execution of virPCIDeviceAddressGetIOMMUGroupNum() fail. The change fixes qemuhotplugtest, qemumemlocktest and qemuxml2xmltest. Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com> --- tests/virpcimock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/virpcimock.c b/tests/virpcimock.c index 438cb7a672..5cd688c825 100644 --- a/tests/virpcimock.c +++ b/tests/virpcimock.c @@ -18,7 +18,7 @@ #include <config.h> -#if defined(__linux__) || defined(__FreeBSD__) +#if defined(__linux__) || defined(__FreeBSD__) || defined(__APPLE__) # include "virmock.h" # include <unistd.h> # include <fcntl.h> -- 2.28.0

Commit f00cde7f1133 changed order of mount arguments in virStorageBackendFileSystemMountGlusterArgs() and introduced per-OS mount options and new test data. Old test data was left unmodified with prior order of arguments. That causes a test failure on all OSes but Linux and FreeBSD, i.e. on macOS: 15) Storage Pool XML-2-argv pool-netfs-gluster ... In '/Users/roolebo/dev/libvirt/tests/storagepoolxml2argvdata/pool-netfs-gluster.argv': Offset 39 Expect [-o direct-io-mode=1 /mnt/gluster] Actual [/mnt/gluster -o direct-io-mode=1] Fixes: f00cde7f1133 ("storage: Add default mount options for fs/netfs storage pools") Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com> --- tests/storagepoolxml2argvdata/pool-netfs-gluster.argv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/storagepoolxml2argvdata/pool-netfs-gluster.argv b/tests/storagepoolxml2argvdata/pool-netfs-gluster.argv index 4303d514ef..97be9cbeb3 100644 --- a/tests/storagepoolxml2argvdata/pool-netfs-gluster.argv +++ b/tests/storagepoolxml2argvdata/pool-netfs-gluster.argv @@ -1 +1 @@ -mount -t glusterfs example.com:/volume -o direct-io-mode=1 /mnt/gluster +mount -t glusterfs example.com:/volume /mnt/gluster -o direct-io-mode=1 -- 2.28.0

On Tue, 2020-11-03 at 17:26 +0300, Roman Bolshakov wrote:
The series continues effort of fixing libvirt test suite on macOS [1] and combines previous patches sent a week ago [2][3].
The tests have been fixed: qemuhotplugtest qemumemlocktest qemuxml2xmltest storagepoolxml2argvtest
Number of failing tests has been reduced to two: qemusecuritytest qemuxml2argvtest
Changes since v1: - Separated virpcimock patch into two (Andrea) - Fixed incorrect test mock data after glusterfs arguments were reordered, instead of intruducing darwin-only test data (Andrea)
1. https://gitlab.com/libvirt/libvirt/-/issues/58 2. https://www.redhat.com/archives/libvir-list/2020-October/msg01345.html 3. https://www.redhat.com/archives/libvir-list/2020-October/msg01347.html
Roman Bolshakov (3): virpcimock: Initialize real_close before using it virpcimock: Enable on macOS storagepoolxml2argvtest: Reorder gluster arguments
Series Reviewed-by: Andrea Bolognani <abologna@redhat.com> and pushed. Thanks! -- Andrea Bolognani / Red Hat / Virtualization
participants (2)
-
Andrea Bolognani
-
Roman Bolshakov