diff --git a/tests/reconnect.c b/tests/reconnect.c index d4aa9f398d..90af830bd4 100644 --- a/tests/reconnect.c +++ b/tests/reconnect.c @@ -2,6 +2,7 @@ #include #include +#include #include "internal.h" #include "testutils.h" @@ -20,8 +21,14 @@ mymain(void) virDomainPtr dom; int status; virCommandPtr cmd; + struct utsname ut; - /* skip test if xend is not running */ + /* Skip test if xend is not running. Calling xend on a non-xen + kernel causes some versions of xend to issue a crash report, so + we first probe uname results. */ + uname(&ut); + if (strstr(ut.release, "xen") == NULL) + return EXIT_AM_SKIP; cmd = virCommandNewArgList("/usr/sbin/xend", "status", NULL); if (virCommandRun(cmd, &status) != 0 || status != 0) { virCommandFree(cmd); diff --git a/tests/statstest.c b/tests/statstest.c index 18cdc5c515..fff69a3bd1 100644 --- a/tests/statstest.c +++ b/tests/statstest.c @@ -3,6 +3,7 @@ #include #include #include +#include #include "stats_linux.h" #include "internal.h" @@ -47,8 +48,14 @@ mymain(void) int ret = 0; int status; virCommandPtr cmd; + struct utsname ut; - /* skip test if xend is not running */ + /* Skip test if xend is not running. Calling xend on a non-xen + kernel causes some versions of xend to issue a crash report, so + we first probe uname results. */ + uname(&ut); + if (strstr(ut.release, "xen") == NULL) + return EXIT_AM_SKIP; cmd = virCommandNewArgList("/usr/sbin/xend", "status", NULL); if (virCommandRun(cmd, &status) != 0 || status != 0) { virCommandFree(cmd);