Skip to content
Snippets Groups Projects
Commit 30387864 authored by Guido Günther's avatar Guido Günther
Browse files

Fix test failures

parent 66f2a93d
No related branches found
No related tags found
No related merge requests found
......@@ -11,3 +11,5 @@ Reduce-udevadm-settle-timeout-to-10-seconds.patch
debian/Debianize-systemd-service-files.patch
Allow-xen-toolstack-to-find-it-s-binaries.patch
Skip-vircgrouptest.patch
tests-Don-t-crash-when-creating-the-config-object-fa.patch
tests-Only-use-privileged-mode-if-Qemu-user-and-grou.patch
From: =?utf-8?q?Guido_G=C3=BCnther?= <agx@sigxcpu.org>
Date: Mon, 7 Apr 2014 08:53:26 +0200
Subject: tests: Don't crash when creating the config object fails
---
tests/qemuargv2xmltest.c | 3 +++
tests/qemuxml2argvtest.c | 3 +++
2 files changed, 6 insertions(+)
diff --git a/tests/qemuargv2xmltest.c b/tests/qemuargv2xmltest.c
index 6d7e23e..4cc3749 100644
--- a/tests/qemuargv2xmltest.c
+++ b/tests/qemuargv2xmltest.c
@@ -128,6 +128,9 @@ mymain(void)
int ret = 0;
driver.config = virQEMUDriverConfigNew(false);
+ if (driver.config == NULL)
+ return EXIT_FAILURE;
+
if ((driver.caps = testQemuCapsInit()) == NULL)
return EXIT_FAILURE;
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 56854dc..13ed4f6 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -501,6 +501,9 @@ mymain(void)
}
driver.config = virQEMUDriverConfigNew(true);
+ if (driver.config == NULL)
+ return EXIT_FAILURE;
+
VIR_FREE(driver.config->spiceListen);
VIR_FREE(driver.config->vncListen);
From: =?utf-8?q?Guido_G=C3=BCnther?= <agx@sigxcpu.org>
Date: Mon, 7 Apr 2014 09:25:37 +0200
Subject: tests: Only use privileged mode if Qemu user and group exists
When building packages in a clean chroot the QEMU_USER and QEMU_GROUP
don't exist making VirQemuDriverConfigNew fail with privileged=true.
Avoid that by not requiring priviliged mode and skipping tests that need
it.
---
tests/qemuxml2argvtest.c | 24 ++++++++++++++++--------
1 file changed, 16 insertions(+), 8 deletions(-)
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 13ed4f6..f25ef0b 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -484,7 +484,10 @@ mymain(void)
{
int ret = 0;
char *map = NULL;
+ uid_t user;
+ gid_t group;
bool skipLegacyCPUs = false;
+ bool privileged = true;
abs_top_srcdir = getenv("abs_top_srcdir");
if (!abs_top_srcdir)
@@ -500,7 +503,11 @@ mymain(void)
return EXIT_FAILURE;
}
- driver.config = virQEMUDriverConfigNew(true);
+ if (virGetUserID(QEMU_USER, &user) < 0 ||
+ virGetGroupID(QEMU_GROUP, &group) < 0)
+ privileged = false;
+
+ driver.config = virQEMUDriverConfigNew(privileged);
if (driver.config == NULL)
return EXIT_FAILURE;
@@ -1160,13 +1167,14 @@ mymain(void)
DO_TEST_FAILURE("cpu-host-passthrough", NONE);
DO_TEST_FAILURE("cpu-qemu-host-passthrough",
QEMU_CAPS_KVM, QEMU_CAPS_CPU_HOST);
-
- DO_TEST("memtune", QEMU_CAPS_NAME);
- DO_TEST("memtune-unlimited", QEMU_CAPS_NAME);
- DO_TEST("blkiotune", QEMU_CAPS_NAME);
- DO_TEST("blkiotune-device", QEMU_CAPS_NAME);
- DO_TEST("cputune", QEMU_CAPS_NAME);
- DO_TEST("cputune-zero-shares", QEMU_CAPS_NAME);
+ if (privileged) {
+ DO_TEST("memtune", QEMU_CAPS_NAME);
+ DO_TEST("memtune-unlimited", QEMU_CAPS_NAME);
+ DO_TEST("blkiotune", QEMU_CAPS_NAME);
+ DO_TEST("blkiotune-device", QEMU_CAPS_NAME);
+ DO_TEST("cputune", QEMU_CAPS_NAME);
+ DO_TEST("cputune-zero-shares", QEMU_CAPS_NAME);
+ }
DO_TEST("numatune-memory", NONE);
DO_TEST("numatune-auto-nodeset-invalid", NONE);
DO_TEST("numad", NONE);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment