Codebase list libvirt / 3038786
Fix test failures Guido Günther 10 years ago
3 changed file(s) with 102 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
1010 debian/Debianize-systemd-service-files.patch
1111 Allow-xen-toolstack-to-find-it-s-binaries.patch
1212 Skip-vircgrouptest.patch
13 tests-Don-t-crash-when-creating-the-config-object-fa.patch
14 tests-Only-use-privileged-mode-if-Qemu-user-and-grou.patch
0 From: =?utf-8?q?Guido_G=C3=BCnther?= <agx@sigxcpu.org>
1 Date: Mon, 7 Apr 2014 08:53:26 +0200
2 Subject: tests: Don't crash when creating the config object fails
3
4 ---
5 tests/qemuargv2xmltest.c | 3 +++
6 tests/qemuxml2argvtest.c | 3 +++
7 2 files changed, 6 insertions(+)
8
9 diff --git a/tests/qemuargv2xmltest.c b/tests/qemuargv2xmltest.c
10 index 6d7e23e..4cc3749 100644
11 --- a/tests/qemuargv2xmltest.c
12 +++ b/tests/qemuargv2xmltest.c
13 @@ -128,6 +128,9 @@ mymain(void)
14 int ret = 0;
15
16 driver.config = virQEMUDriverConfigNew(false);
17 + if (driver.config == NULL)
18 + return EXIT_FAILURE;
19 +
20 if ((driver.caps = testQemuCapsInit()) == NULL)
21 return EXIT_FAILURE;
22
23 diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
24 index 56854dc..13ed4f6 100644
25 --- a/tests/qemuxml2argvtest.c
26 +++ b/tests/qemuxml2argvtest.c
27 @@ -501,6 +501,9 @@ mymain(void)
28 }
29
30 driver.config = virQEMUDriverConfigNew(true);
31 + if (driver.config == NULL)
32 + return EXIT_FAILURE;
33 +
34 VIR_FREE(driver.config->spiceListen);
35 VIR_FREE(driver.config->vncListen);
36
0 From: =?utf-8?q?Guido_G=C3=BCnther?= <agx@sigxcpu.org>
1 Date: Mon, 7 Apr 2014 09:25:37 +0200
2 Subject: tests: Only use privileged mode if Qemu user and group exists
3
4 When building packages in a clean chroot the QEMU_USER and QEMU_GROUP
5 don't exist making VirQemuDriverConfigNew fail with privileged=true.
6
7 Avoid that by not requiring priviliged mode and skipping tests that need
8 it.
9 ---
10 tests/qemuxml2argvtest.c | 24 ++++++++++++++++--------
11 1 file changed, 16 insertions(+), 8 deletions(-)
12
13 diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
14 index 13ed4f6..f25ef0b 100644
15 --- a/tests/qemuxml2argvtest.c
16 +++ b/tests/qemuxml2argvtest.c
17 @@ -484,7 +484,10 @@ mymain(void)
18 {
19 int ret = 0;
20 char *map = NULL;
21 + uid_t user;
22 + gid_t group;
23 bool skipLegacyCPUs = false;
24 + bool privileged = true;
25
26 abs_top_srcdir = getenv("abs_top_srcdir");
27 if (!abs_top_srcdir)
28 @@ -500,7 +503,11 @@ mymain(void)
29 return EXIT_FAILURE;
30 }
31
32 - driver.config = virQEMUDriverConfigNew(true);
33 + if (virGetUserID(QEMU_USER, &user) < 0 ||
34 + virGetGroupID(QEMU_GROUP, &group) < 0)
35 + privileged = false;
36 +
37 + driver.config = virQEMUDriverConfigNew(privileged);
38 if (driver.config == NULL)
39 return EXIT_FAILURE;
40
41 @@ -1160,13 +1167,14 @@ mymain(void)
42 DO_TEST_FAILURE("cpu-host-passthrough", NONE);
43 DO_TEST_FAILURE("cpu-qemu-host-passthrough",
44 QEMU_CAPS_KVM, QEMU_CAPS_CPU_HOST);
45 -
46 - DO_TEST("memtune", QEMU_CAPS_NAME);
47 - DO_TEST("memtune-unlimited", QEMU_CAPS_NAME);
48 - DO_TEST("blkiotune", QEMU_CAPS_NAME);
49 - DO_TEST("blkiotune-device", QEMU_CAPS_NAME);
50 - DO_TEST("cputune", QEMU_CAPS_NAME);
51 - DO_TEST("cputune-zero-shares", QEMU_CAPS_NAME);
52 + if (privileged) {
53 + DO_TEST("memtune", QEMU_CAPS_NAME);
54 + DO_TEST("memtune-unlimited", QEMU_CAPS_NAME);
55 + DO_TEST("blkiotune", QEMU_CAPS_NAME);
56 + DO_TEST("blkiotune-device", QEMU_CAPS_NAME);
57 + DO_TEST("cputune", QEMU_CAPS_NAME);
58 + DO_TEST("cputune-zero-shares", QEMU_CAPS_NAME);
59 + }
60 DO_TEST("numatune-memory", NONE);
61 DO_TEST("numatune-auto-nodeset-invalid", NONE);
62 DO_TEST("numad", NONE);