mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35:25 +00:00
tests: Rename virtTestRun to virTestRun.
This function doesn't follow our convention of naming functions.
This commit is contained in:
parent
09b406a756
commit
cd7dd1508d
@ -136,7 +136,7 @@ mymain(void)
|
||||
static struct testInfo info = { \
|
||||
name, (flags) \
|
||||
}; \
|
||||
if (virtTestRun("BHYVE XML-2-ARGV " name, \
|
||||
if (virTestRun("BHYVE XML-2-ARGV " name, \
|
||||
testCompareXMLToArgvHelper, &info) < 0) \
|
||||
ret = -1; \
|
||||
} while (0)
|
||||
|
@ -55,7 +55,7 @@ mymain(void)
|
||||
# define DO_TEST_FULL(name, is_different) \
|
||||
do { \
|
||||
const struct testInfo info = {name, is_different}; \
|
||||
if (virtTestRun("BHYVE XML-2-XML " name, \
|
||||
if (virTestRun("BHYVE XML-2-XML " name, \
|
||||
testCompareXMLToXMLHelper, &info) < 0) \
|
||||
ret = -1; \
|
||||
} while (0)
|
||||
|
@ -1186,8 +1186,8 @@ mymain(void)
|
||||
environ = (char **)newenv;
|
||||
|
||||
# define DO_TEST(NAME) \
|
||||
if (virtTestRun("Command Exec " #NAME " test", \
|
||||
NAME, NULL) < 0) \
|
||||
if (virTestRun("Command Exec " #NAME " test", \
|
||||
NAME, NULL) < 0) \
|
||||
ret = -1
|
||||
|
||||
DO_TEST(test0);
|
||||
|
@ -479,7 +479,7 @@ cpuTestRun(const char *name, const struct data *data)
|
||||
tmp = virtTestLogContentAndReset();
|
||||
VIR_FREE(tmp);
|
||||
|
||||
if (virtTestRun(label, cpuTest[data->api], data) < 0) {
|
||||
if (virTestRun(label, cpuTest[data->api], data) < 0) {
|
||||
if (virTestGetDebug()) {
|
||||
char *log;
|
||||
if ((log = virtTestLogContentAndReset()) &&
|
||||
|
@ -250,7 +250,7 @@ mymain(void)
|
||||
.type = Type, \
|
||||
.capsType = CapsType, \
|
||||
}; \
|
||||
if (virtTestRun(Name, test_virDomainCapsFormat, &data) < 0) \
|
||||
if (virTestRun(Name, test_virDomainCapsFormat, &data) < 0) \
|
||||
ret = -1; \
|
||||
} while (0)
|
||||
|
||||
@ -274,7 +274,7 @@ mymain(void)
|
||||
.capsName = CapsName, \
|
||||
.capsOpaque = cfg, \
|
||||
}; \
|
||||
if (virtTestRun(name, test_virDomainCapsFormat, &data) < 0) \
|
||||
if (virTestRun(name, test_virDomainCapsFormat, &data) < 0) \
|
||||
ret = -1; \
|
||||
VIR_FREE(name); \
|
||||
} while (0)
|
||||
|
@ -97,7 +97,7 @@ mymain(void)
|
||||
.path = fspath, \
|
||||
.expectEntry = expect, \
|
||||
}; \
|
||||
if (virtTestRun("Get FS " fspath, testGetFilesystem, &data) < 0) \
|
||||
if (virTestRun("Get FS " fspath, testGetFilesystem, &data) < 0) \
|
||||
ret = -1; \
|
||||
} while (0)
|
||||
|
||||
|
@ -175,8 +175,8 @@ mymain(void)
|
||||
const struct testInfo info = {abs_srcdir "/" inpath "/" name ".xml", \
|
||||
abs_srcdir "/" outpath "/" name ".xml", \
|
||||
uuid, internal, redefine}; \
|
||||
if (virtTestRun("SNAPSHOT XML-2-XML " prefix " " name, \
|
||||
testCompareXMLToXMLHelper, &info) < 0) \
|
||||
if (virTestRun("SNAPSHOT XML-2-XML " prefix " " name, \
|
||||
testCompareXMLToXMLHelper, &info) < 0) \
|
||||
ret = -1; \
|
||||
} while (0)
|
||||
|
||||
|
@ -249,8 +249,8 @@ mymain(void)
|
||||
|
||||
# define DO_TEST(_name) \
|
||||
do { \
|
||||
if (virtTestRun("VMware "#_name, test##_name, \
|
||||
NULL) < 0) { \
|
||||
if (virTestRun("VMware "#_name, test##_name, \
|
||||
NULL) < 0) { \
|
||||
result = -1; \
|
||||
} \
|
||||
} while (0)
|
||||
|
@ -92,7 +92,7 @@ testEventReport(const char *name, bool failed, const char *msg, ...)
|
||||
|
||||
data.failed = failed;
|
||||
data.msg = str;
|
||||
ignore_value(virtTestRun(name, testEventResultCallback, &data));
|
||||
ignore_value(virTestRun(name, testEventResultCallback, &data));
|
||||
|
||||
va_end(vargs);
|
||||
VIR_FREE(str);
|
||||
|
@ -169,15 +169,15 @@ mymain(void)
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (virtTestRun("test1", test1, NULL) < 0)
|
||||
if (virTestRun("test1", test1, NULL) < 0)
|
||||
ret = -1;
|
||||
if (virtTestRun("test2", test2, NULL) < 0)
|
||||
if (virTestRun("test2", test2, NULL) < 0)
|
||||
ret = -1;
|
||||
if (virtTestRun("test3", test3, NULL) < 0)
|
||||
if (virTestRun("test3", test3, NULL) < 0)
|
||||
ret = -1;
|
||||
if (virtTestRun("test4", test4, NULL) < 0)
|
||||
if (virTestRun("test4", test4, NULL) < 0)
|
||||
ret = -1;
|
||||
if (virtTestRun("test5", test5, NULL) < 0)
|
||||
if (virTestRun("test5", test5, NULL) < 0)
|
||||
ret = -1;
|
||||
|
||||
cleanup:
|
||||
|
@ -327,13 +327,13 @@ mymain(void)
|
||||
abort();
|
||||
}
|
||||
|
||||
if (virtTestRun("Stream read blocking ", testFDStreamReadBlock, scratchdir) < 0)
|
||||
if (virTestRun("Stream read blocking ", testFDStreamReadBlock, scratchdir) < 0)
|
||||
ret = -1;
|
||||
if (virtTestRun("Stream read non-blocking ", testFDStreamReadNonblock, scratchdir) < 0)
|
||||
if (virTestRun("Stream read non-blocking ", testFDStreamReadNonblock, scratchdir) < 0)
|
||||
ret = -1;
|
||||
if (virtTestRun("Stream write blocking ", testFDStreamWriteBlock, scratchdir) < 0)
|
||||
if (virTestRun("Stream write blocking ", testFDStreamWriteBlock, scratchdir) < 0)
|
||||
ret = -1;
|
||||
if (virtTestRun("Stream write non-blocking ", testFDStreamWriteNonblock, scratchdir) < 0)
|
||||
if (virTestRun("Stream write non-blocking ", testFDStreamWriteNonblock, scratchdir) < 0)
|
||||
ret = -1;
|
||||
|
||||
if (getenv("LIBVIRT_SKIP_CLEANUP") == NULL)
|
||||
|
@ -64,8 +64,8 @@ mymain(void)
|
||||
do { \
|
||||
const struct testInfo info = {name, is_different, inactive, \
|
||||
expectResult}; \
|
||||
if (virtTestRun("GENERIC XML-2-XML " name, \
|
||||
testCompareXMLToXMLHelper, &info) < 0) \
|
||||
if (virTestRun("GENERIC XML-2-XML " name, \
|
||||
testCompareXMLToXMLHelper, &info) < 0) \
|
||||
ret = -1; \
|
||||
} while (0)
|
||||
|
||||
|
@ -70,8 +70,8 @@ mymain(void)
|
||||
int ret = 0;
|
||||
|
||||
#define DO_TEST(name) \
|
||||
if (virtTestRun("Interface XML-2-XML " name, \
|
||||
testCompareXMLToXMLHelper, (name)) < 0) \
|
||||
if (virTestRun("Interface XML-2-XML " name, \
|
||||
testCompareXMLToXMLHelper, (name)) < 0) \
|
||||
ret = -1
|
||||
|
||||
DO_TEST("ethernet-dhcp");
|
||||
|
@ -319,7 +319,7 @@ mymain(void)
|
||||
#define DO_TEST_FULL(name, cmd, doc, expect, pass) \
|
||||
do { \
|
||||
struct testInfo info = { doc, expect, pass }; \
|
||||
if (virtTestRun(name, testJSON ## cmd, &info) < 0) \
|
||||
if (virTestRun(name, testJSON ## cmd, &info) < 0) \
|
||||
ret = -1; \
|
||||
} while (0)
|
||||
|
||||
|
@ -231,7 +231,7 @@ mymain(void)
|
||||
STRPREFIX(filedata + params[i], "keepalive_required") ||
|
||||
STRPREFIX(filedata + params[i], "admin_keepalive_required"))
|
||||
continue;
|
||||
if (virtTestRun("Test corruption", testCorrupt, &data) < 0)
|
||||
if (virTestRun("Test corruption", testCorrupt, &data) < 0)
|
||||
ret = -1;
|
||||
}
|
||||
|
||||
|
@ -101,9 +101,9 @@ mymain(void)
|
||||
# define DO_TEST(name, expectError) \
|
||||
do { \
|
||||
const struct testInfo info = { name, expectError }; \
|
||||
if (virtTestRun("LXC Native-2-XML " name, \
|
||||
testCompareXMLToConfigHelper, \
|
||||
&info) < 0) \
|
||||
if (virTestRun("LXC Native-2-XML " name, \
|
||||
testCompareXMLToConfigHelper, \
|
||||
&info) < 0) \
|
||||
ret = EXIT_FAILURE; \
|
||||
} while (0)
|
||||
|
||||
|
@ -70,8 +70,8 @@ mymain(void)
|
||||
do { \
|
||||
const struct testInfo info = {name, is_different, inactive, \
|
||||
parse_flags}; \
|
||||
if (virtTestRun("LXC XML-2-XML " name, \
|
||||
testCompareXMLToXMLHelper, &info) < 0) \
|
||||
if (virTestRun("LXC XML-2-XML " name, \
|
||||
testCompareXMLToXMLHelper, &info) < 0) \
|
||||
ret = -1; \
|
||||
} while (0)
|
||||
|
||||
|
@ -256,8 +256,8 @@ testTextMetadata(const void *data)
|
||||
test.data = DATA; \
|
||||
test.fail = FAIL; \
|
||||
\
|
||||
if (virtTestRun("text metadata: " #TYPE " " INDEX " ", \
|
||||
testTextMetadata, &test) < 0) \
|
||||
if (virTestRun("text metadata: " #TYPE " " INDEX " ", \
|
||||
testTextMetadata, &test) < 0) \
|
||||
ret = EXIT_FAILURE; \
|
||||
} while (0)
|
||||
|
||||
@ -281,11 +281,11 @@ mymain(void)
|
||||
|
||||
virtTestQuiesceLibvirtErrors(false);
|
||||
|
||||
if (virtTestRun("Assign metadata ", testAssignMetadata, &test) < 0)
|
||||
if (virTestRun("Assign metadata ", testAssignMetadata, &test) < 0)
|
||||
ret = EXIT_FAILURE;
|
||||
if (virtTestRun("Rewrite Metadata ", testRewriteMetadata, &test) < 0)
|
||||
if (virTestRun("Rewrite Metadata ", testRewriteMetadata, &test) < 0)
|
||||
ret = EXIT_FAILURE;
|
||||
if (virtTestRun("Erase metadata ", testEraseMetadata, &test) < 0)
|
||||
if (virTestRun("Erase metadata ", testEraseMetadata, &test) < 0)
|
||||
ret = EXIT_FAILURE;
|
||||
|
||||
TEST_TITLE("1", "qwert");
|
||||
|
@ -105,8 +105,8 @@ mymain(void)
|
||||
\
|
||||
info.name = xname; \
|
||||
info.caps = xcaps; \
|
||||
if (virtTestRun("Network XML-2-Conf " xname, \
|
||||
testCompareXMLToConfHelper, &info) < 0) { \
|
||||
if (virTestRun("Network XML-2-Conf " xname, \
|
||||
testCompareXMLToConfHelper, &info) < 0) { \
|
||||
ret = -1; \
|
||||
} \
|
||||
} while (0)
|
||||
|
@ -123,8 +123,8 @@ mymain(void)
|
||||
static struct testInfo info = { \
|
||||
name, \
|
||||
}; \
|
||||
if (virtTestRun("Network XML-2-iptables " name, \
|
||||
testCompareXMLToIPTablesHelper, &info) < 0) \
|
||||
if (virTestRun("Network XML-2-iptables " name, \
|
||||
testCompareXMLToIPTablesHelper, &info) < 0) \
|
||||
ret = -1; \
|
||||
} while (0)
|
||||
|
||||
|
@ -112,8 +112,8 @@ mymain(void)
|
||||
#define DO_TEST_FULL(name, flags, expectResult) \
|
||||
do { \
|
||||
const struct testInfo info = {name, flags, expectResult}; \
|
||||
if (virtTestRun("Network XML-2-XML " name, \
|
||||
testCompareXMLToXMLHelper, &info) < 0) \
|
||||
if (virTestRun("Network XML-2-XML " name, \
|
||||
testCompareXMLToXMLHelper, &info) < 0) \
|
||||
ret = -1; \
|
||||
} while (0)
|
||||
#define DO_TEST(name) \
|
||||
|
@ -118,8 +118,8 @@ mymain(void)
|
||||
const struct testInfo info = {name, updatexml, netxml, outxml, \
|
||||
command, section, flags, \
|
||||
parentIndex, expectFailure}; \
|
||||
if (virtTestRun("Network XML-2-XML " name, \
|
||||
testCompareXMLToXMLHelper, &info) < 0) \
|
||||
if (virTestRun("Network XML-2-XML " name, \
|
||||
testCompareXMLToXMLHelper, &info) < 0) \
|
||||
ret = -1; \
|
||||
} while (0)
|
||||
|
||||
|
@ -70,8 +70,8 @@ mymain(void)
|
||||
int ret = 0;
|
||||
|
||||
#define DO_TEST(name) \
|
||||
if (virtTestRun("Node device XML-2-XML " name, \
|
||||
testCompareXMLToXMLHelper, (name)) < 0) \
|
||||
if (virTestRun("Node device XML-2-XML " name, \
|
||||
testCompareXMLToXMLHelper, (name)) < 0) \
|
||||
ret = -1
|
||||
|
||||
DO_TEST("computer");
|
||||
|
@ -245,13 +245,13 @@ mymain(void)
|
||||
return EXIT_FAILURE;
|
||||
|
||||
for (i = 0; i < ARRAY_CARDINALITY(nodeData); i++)
|
||||
if (virtTestRun(nodeData[i].testName, linuxTestNodeInfo, &nodeData[i]) != 0)
|
||||
if (virTestRun(nodeData[i].testName, linuxTestNodeInfo, &nodeData[i]) != 0)
|
||||
ret = -1;
|
||||
|
||||
# define DO_TEST_CPU_STATS(name, ncpus) \
|
||||
do { \
|
||||
static struct nodeCPUStatsData data = { name, ncpus }; \
|
||||
if (virtTestRun("CPU stats " name, linuxTestNodeCPUStats, &data) < 0) \
|
||||
if (virTestRun("CPU stats " name, linuxTestNodeCPUStats, &data) < 0) \
|
||||
ret = -1; \
|
||||
} while (0)
|
||||
|
||||
|
@ -180,7 +180,7 @@ mymain(void)
|
||||
struct testNSSData data = { \
|
||||
.hostname = name, .ipAddr = addr, .af = family, \
|
||||
}; \
|
||||
if (virtTestRun(name, testGetHostByName, &data) < 0) \
|
||||
if (virTestRun(name, testGetHostByName, &data) < 0) \
|
||||
ret = -1; \
|
||||
} while (0)
|
||||
|
||||
|
@ -530,39 +530,39 @@ mymain(void)
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (virtTestRun("ebiptablesAllTeardown",
|
||||
testNWFilterEBIPTablesAllTeardown,
|
||||
NULL) < 0)
|
||||
if (virTestRun("ebiptablesAllTeardown",
|
||||
testNWFilterEBIPTablesAllTeardown,
|
||||
NULL) < 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("ebiptablesTearOldRules",
|
||||
testNWFilterEBIPTablesTearOldRules,
|
||||
NULL) < 0)
|
||||
if (virTestRun("ebiptablesTearOldRules",
|
||||
testNWFilterEBIPTablesTearOldRules,
|
||||
NULL) < 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("ebiptablesRemoveBasicRules",
|
||||
testNWFilterEBIPTablesRemoveBasicRules,
|
||||
NULL) < 0)
|
||||
if (virTestRun("ebiptablesRemoveBasicRules",
|
||||
testNWFilterEBIPTablesRemoveBasicRules,
|
||||
NULL) < 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("ebiptablesTearNewRules",
|
||||
testNWFilterEBIPTablesTearNewRules,
|
||||
NULL) < 0)
|
||||
if (virTestRun("ebiptablesTearNewRules",
|
||||
testNWFilterEBIPTablesTearNewRules,
|
||||
NULL) < 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("ebiptablesApplyBasicRules",
|
||||
testNWFilterEBIPTablesApplyBasicRules,
|
||||
NULL) < 0)
|
||||
if (virTestRun("ebiptablesApplyBasicRules",
|
||||
testNWFilterEBIPTablesApplyBasicRules,
|
||||
NULL) < 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("ebiptablesApplyDHCPOnlyRules",
|
||||
testNWFilterEBIPTablesApplyDHCPOnlyRules,
|
||||
NULL) < 0)
|
||||
if (virTestRun("ebiptablesApplyDHCPOnlyRules",
|
||||
testNWFilterEBIPTablesApplyDHCPOnlyRules,
|
||||
NULL) < 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("ebiptablesApplyDropAllRules",
|
||||
testNWFilterEBIPTablesApplyDropAllRules,
|
||||
NULL) < 0)
|
||||
if (virTestRun("ebiptablesApplyDropAllRules",
|
||||
testNWFilterEBIPTablesApplyDropAllRules,
|
||||
NULL) < 0)
|
||||
ret = -1;
|
||||
|
||||
cleanup:
|
||||
|
@ -460,8 +460,8 @@ mymain(void)
|
||||
static struct testInfo info = { \
|
||||
name, \
|
||||
}; \
|
||||
if (virtTestRun("NWFilter XML-2-firewall " name, \
|
||||
testCompareXMLToIPTablesHelper, &info) < 0) \
|
||||
if (virTestRun("NWFilter XML-2-firewall " name, \
|
||||
testCompareXMLToIPTablesHelper, &info) < 0) \
|
||||
ret = -1; \
|
||||
} while (0)
|
||||
|
||||
|
@ -92,8 +92,8 @@ mymain(void)
|
||||
.name = NAME, \
|
||||
.expect_warning = EXPECT_WARN, \
|
||||
}; \
|
||||
if (virtTestRun("NWFilter XML-2-XML " NAME, \
|
||||
testCompareXMLToXMLHelper, (&tp)) < 0) \
|
||||
if (virTestRun("NWFilter XML-2-XML " NAME, \
|
||||
testCompareXMLToXMLHelper, (&tp)) < 0) \
|
||||
ret = -1; \
|
||||
} while (0)
|
||||
|
||||
|
@ -549,31 +549,31 @@ mymain(void)
|
||||
virtTestQuiesceLibvirtErrors(false);
|
||||
|
||||
/* Domain event tests */
|
||||
if (virtTestRun("Domain createXML start event (old API)",
|
||||
testDomainCreateXMLOld, &test) < 0)
|
||||
if (virTestRun("Domain createXML start event (old API)",
|
||||
testDomainCreateXMLOld, &test) < 0)
|
||||
ret = EXIT_FAILURE;
|
||||
if (virtTestRun("Domain createXML start event (new API)",
|
||||
testDomainCreateXMLNew, &test) < 0)
|
||||
if (virTestRun("Domain createXML start event (new API)",
|
||||
testDomainCreateXMLNew, &test) < 0)
|
||||
ret = EXIT_FAILURE;
|
||||
if (virtTestRun("Domain createXML start event (both API)",
|
||||
testDomainCreateXMLMixed, &test) < 0)
|
||||
if (virTestRun("Domain createXML start event (both API)",
|
||||
testDomainCreateXMLMixed, &test) < 0)
|
||||
ret = EXIT_FAILURE;
|
||||
if (virtTestRun("Domain (un)define events", testDomainDefine, &test) < 0)
|
||||
if (virTestRun("Domain (un)define events", testDomainDefine, &test) < 0)
|
||||
ret = EXIT_FAILURE;
|
||||
if (virtTestRun("Domain start stop events", testDomainStartStopEvent, &test) < 0)
|
||||
if (virTestRun("Domain start stop events", testDomainStartStopEvent, &test) < 0)
|
||||
ret = EXIT_FAILURE;
|
||||
|
||||
/* Network event tests */
|
||||
/* Tests requiring the test network not to be set up*/
|
||||
if (virtTestRun("Network createXML start event ", testNetworkCreateXML, &test) < 0)
|
||||
if (virTestRun("Network createXML start event ", testNetworkCreateXML, &test) < 0)
|
||||
ret = EXIT_FAILURE;
|
||||
if (virtTestRun("Network (un)define events", testNetworkDefine, &test) < 0)
|
||||
if (virTestRun("Network (un)define events", testNetworkDefine, &test) < 0)
|
||||
ret = EXIT_FAILURE;
|
||||
|
||||
/* Define a test network */
|
||||
if (!(test.net = virNetworkDefineXML(test.conn, networkDef)))
|
||||
ret = EXIT_FAILURE;
|
||||
if (virtTestRun("Network start stop events ", testNetworkStartStopEvent, &test) < 0)
|
||||
if (virTestRun("Network start stop events ", testNetworkStartStopEvent, &test) < 0)
|
||||
ret = EXIT_FAILURE;
|
||||
|
||||
/* Cleanup */
|
||||
|
@ -143,7 +143,7 @@ mymain(void)
|
||||
|
||||
# define DO_TEST(_name) \
|
||||
do { \
|
||||
if (virtTestRun("OpenVZ "#_name, test##_name, \
|
||||
if (virTestRun("OpenVZ "#_name, test##_name, \
|
||||
NULL) < 0) { \
|
||||
result = -1; \
|
||||
} \
|
||||
|
@ -923,7 +923,7 @@ mymain(void)
|
||||
virEventRegisterDefaultImpl();
|
||||
|
||||
#define DO_TEST(name) \
|
||||
if (virtTestRun(# name, testQemuAgent ## name, driver.xmlopt) < 0) \
|
||||
if (virTestRun(# name, testQemuAgent ## name, driver.xmlopt) < 0) \
|
||||
ret = -1
|
||||
|
||||
DO_TEST(FSFreeze);
|
||||
|
@ -158,8 +158,8 @@ mymain(void)
|
||||
# define DO_TEST_FULL(name, flags) \
|
||||
do { \
|
||||
const struct testInfo info = { name, (flags) }; \
|
||||
if (virtTestRun("QEMU ARGV-2-XML " name, \
|
||||
testCompareXMLToArgvHelper, &info) < 0) \
|
||||
if (virTestRun("QEMU ARGV-2-XML " name, \
|
||||
testCompareXMLToArgvHelper, &info) < 0) \
|
||||
ret = -1; \
|
||||
} while (0)
|
||||
|
||||
|
@ -156,7 +156,7 @@ mymain(void)
|
||||
do { \
|
||||
data.archName = arch; \
|
||||
data.base = name; \
|
||||
if (virtTestRun(name "(" arch ")", testQemuCaps, &data) < 0) \
|
||||
if (virTestRun(name "(" arch ")", testQemuCaps, &data) < 0) \
|
||||
ret = -1; \
|
||||
} while (0)
|
||||
|
||||
|
@ -178,7 +178,7 @@ mymain(void)
|
||||
#define DO_TEST_FULL(name, guest) \
|
||||
data.base = name; \
|
||||
data.guestarch = guest; \
|
||||
if (virtTestRun(name, testQemuCapsXML, &data) < 0) \
|
||||
if (virTestRun(name, testQemuCapsXML, &data) < 0) \
|
||||
ret = -1
|
||||
|
||||
#define DO_TEST(name) DO_TEST_FULL(name, VIR_ARCH_I686)
|
||||
|
@ -86,9 +86,9 @@ mymain(void)
|
||||
do { \
|
||||
data1.props = PROPS; \
|
||||
data1.expectprops = EXPECT; \
|
||||
if (virtTestRun(virtTestCounterNext(), \
|
||||
testQemuCommandBuildObjectFromJSON, \
|
||||
&data1) < 0) \
|
||||
if (virTestRun(virtTestCounterNext(), \
|
||||
testQemuCommandBuildObjectFromJSON, \
|
||||
&data1) < 0) \
|
||||
ret = -1; \
|
||||
} while (0)
|
||||
|
||||
|
@ -140,8 +140,8 @@ mymain(void)
|
||||
if (!(info.flags = virQEMUCapsNew())) \
|
||||
return EXIT_FAILURE; \
|
||||
virQEMUCapsSetList(info.flags, __VA_ARGS__, QEMU_CAPS_LAST); \
|
||||
if (virtTestRun("QEMU Help String Parsing " name, \
|
||||
testHelpStrParsing, &info) < 0) \
|
||||
if (virTestRun("QEMU Help String Parsing " name, \
|
||||
testHelpStrParsing, &info) < 0) \
|
||||
ret = -1; \
|
||||
virObjectUnref(info.flags); \
|
||||
} while (0)
|
||||
|
@ -379,7 +379,7 @@ mymain(void)
|
||||
data.mon = my_mon; \
|
||||
data.keep = kep; \
|
||||
data.deviceDeletedEvent = event; \
|
||||
if (virtTestRun(name, testQemuHotplug, &data) < 0) \
|
||||
if (virTestRun(name, testQemuHotplug, &data) < 0) \
|
||||
ret = -1; \
|
||||
} while (0)
|
||||
|
||||
|
@ -2336,26 +2336,26 @@ mymain(void)
|
||||
virEventRegisterDefaultImpl();
|
||||
|
||||
#define DO_TEST(name) \
|
||||
if (virtTestRun(# name, testQemuMonitorJSON ## name, driver.xmlopt) < 0) \
|
||||
if (virTestRun(# name, testQemuMonitorJSON ## name, driver.xmlopt) < 0) \
|
||||
ret = -1
|
||||
|
||||
#define DO_TEST_SIMPLE(CMD, FNC, ...) \
|
||||
#define DO_TEST_SIMPLE(CMD, FNC, ...) \
|
||||
simpleFunc = (testQemuMonitorJSONSimpleFuncData) {.cmd = CMD, .func = FNC, \
|
||||
.xmlopt = driver.xmlopt, __VA_ARGS__ }; \
|
||||
if (virtTestRun(# FNC, testQemuMonitorJSONSimpleFunc, &simpleFunc) < 0) \
|
||||
if (virTestRun(# FNC, testQemuMonitorJSONSimpleFunc, &simpleFunc) < 0) \
|
||||
ret = -1
|
||||
|
||||
#define DO_TEST_GEN(name, ...) \
|
||||
simpleFunc = (testQemuMonitorJSONSimpleFuncData) {.xmlopt = driver.xmlopt, \
|
||||
__VA_ARGS__ }; \
|
||||
if (virtTestRun(# name, testQemuMonitorJSON ## name, &simpleFunc) < 0) \
|
||||
if (virTestRun(# name, testQemuMonitorJSON ## name, &simpleFunc) < 0) \
|
||||
ret = -1
|
||||
|
||||
#define DO_TEST_CPU_DATA(name) \
|
||||
do { \
|
||||
struct testCPUData data = { name, driver.xmlopt }; \
|
||||
const char *label = "GetCPUData(" name ")"; \
|
||||
if (virtTestRun(label, testQemuMonitorJSONGetCPUData, &data) < 0) \
|
||||
if (virTestRun(label, testQemuMonitorJSONGetCPUData, &data) < 0) \
|
||||
ret = -1; \
|
||||
} while (0)
|
||||
|
||||
|
@ -176,8 +176,8 @@ mymain(void)
|
||||
|
||||
# define DO_TEST(_name) \
|
||||
do { \
|
||||
if (virtTestRun("qemu monitor "#_name, test##_name, \
|
||||
driver.xmlopt) < 0) { \
|
||||
if (virTestRun("qemu monitor "#_name, test##_name, \
|
||||
driver.xmlopt) < 0) { \
|
||||
result = -1; \
|
||||
} \
|
||||
} while (0)
|
||||
|
@ -521,42 +521,42 @@ mymain(void)
|
||||
if (VIR_STRDUP_QUIET(driver.config->spicePassword, "123456") < 0)
|
||||
return EXIT_FAILURE;
|
||||
|
||||
# define DO_TEST_FULL(name, migrateFrom, migrateFd, flags, \
|
||||
parseFlags, gic, ...) \
|
||||
do { \
|
||||
static struct testInfo info = { \
|
||||
name, NULL, migrateFrom, migrateFd, (flags), parseFlags \
|
||||
}; \
|
||||
if (testPrepareExtraFlags(&info, skipLegacyCPUs, gic) < 0) \
|
||||
return EXIT_FAILURE; \
|
||||
# define DO_TEST_FULL(name, migrateFrom, migrateFd, flags, \
|
||||
parseFlags, gic, ...) \
|
||||
do { \
|
||||
static struct testInfo info = { \
|
||||
name, NULL, migrateFrom, migrateFd, (flags), parseFlags \
|
||||
}; \
|
||||
if (testPrepareExtraFlags(&info, skipLegacyCPUs, gic) < 0) \
|
||||
return EXIT_FAILURE; \
|
||||
virQEMUCapsSetList(info.extraFlags, __VA_ARGS__, QEMU_CAPS_LAST);\
|
||||
if (virtTestRun("QEMU XML-2-ARGV " name, \
|
||||
testCompareXMLToArgvHelper, &info) < 0) \
|
||||
ret = -1; \
|
||||
virObjectUnref(info.extraFlags); \
|
||||
if (virTestRun("QEMU XML-2-ARGV " name, \
|
||||
testCompareXMLToArgvHelper, &info) < 0) \
|
||||
ret = -1; \
|
||||
virObjectUnref(info.extraFlags); \
|
||||
} while (0)
|
||||
|
||||
# define DO_TEST(name, ...) \
|
||||
# define DO_TEST(name, ...) \
|
||||
DO_TEST_FULL(name, NULL, -1, 0, 0, GIC_NONE, __VA_ARGS__)
|
||||
|
||||
# define DO_TEST_GIC(name, gic, ...) \
|
||||
# define DO_TEST_GIC(name, gic, ...) \
|
||||
DO_TEST_FULL(name, NULL, -1, 0, 0, gic, __VA_ARGS__)
|
||||
|
||||
# define DO_TEST_FAILURE(name, ...) \
|
||||
DO_TEST_FULL(name, NULL, -1, FLAG_EXPECT_FAILURE, \
|
||||
# define DO_TEST_FAILURE(name, ...) \
|
||||
DO_TEST_FULL(name, NULL, -1, FLAG_EXPECT_FAILURE, \
|
||||
0, GIC_NONE, __VA_ARGS__)
|
||||
|
||||
# define DO_TEST_PARSE_ERROR(name, ...) \
|
||||
DO_TEST_FULL(name, NULL, -1, \
|
||||
FLAG_EXPECT_PARSE_ERROR | FLAG_EXPECT_FAILURE, \
|
||||
# define DO_TEST_PARSE_ERROR(name, ...) \
|
||||
DO_TEST_FULL(name, NULL, -1, \
|
||||
FLAG_EXPECT_PARSE_ERROR | FLAG_EXPECT_FAILURE, \
|
||||
0, GIC_NONE, __VA_ARGS__)
|
||||
|
||||
# define DO_TEST_PARSE_FLAGS_ERROR(name, parseFlags, ...) \
|
||||
DO_TEST_FULL(name, NULL, -1, \
|
||||
FLAG_EXPECT_PARSE_ERROR | FLAG_EXPECT_FAILURE, \
|
||||
# define DO_TEST_PARSE_FLAGS_ERROR(name, parseFlags, ...) \
|
||||
DO_TEST_FULL(name, NULL, -1, \
|
||||
FLAG_EXPECT_PARSE_ERROR | FLAG_EXPECT_FAILURE, \
|
||||
parseFlags, GIC_NONE, __VA_ARGS__)
|
||||
|
||||
# define DO_TEST_LINUX(name, ...) \
|
||||
# define DO_TEST_LINUX(name, ...) \
|
||||
DO_TEST_LINUX_FULL(name, NULL, -1, 0, 0, GIC_NONE, __VA_ARGS__)
|
||||
|
||||
# ifdef __linux__
|
||||
@ -565,12 +565,12 @@ mymain(void)
|
||||
* cooperation is expected (e.g. we need a fixed time,
|
||||
* predictable NUMA topology and so on). On non-Linux
|
||||
* platforms the macro just consume its argument. */
|
||||
# define DO_TEST_LINUX_FULL(name, ...) \
|
||||
# define DO_TEST_LINUX_FULL(name, ...) \
|
||||
DO_TEST_FULL(name, __VA_ARGS__)
|
||||
# else /* __linux__ */
|
||||
# define DO_TEST_LINUX_FULL(name, ...) \
|
||||
do { \
|
||||
const char *tmp ATTRIBUTE_UNUSED = name; \
|
||||
# define DO_TEST_LINUX_FULL(name, ...) \
|
||||
do { \
|
||||
const char *tmp ATTRIBUTE_UNUSED = name; \
|
||||
} while (0)
|
||||
# endif /* __linux__ */
|
||||
|
||||
|
@ -272,23 +272,23 @@ mymain(void)
|
||||
# define DO_TEST_FULL(name, when, gic, ...) \
|
||||
do { \
|
||||
if (testInfoSet(&info, name, when, gic) < 0) { \
|
||||
VIR_TEST_DEBUG("Failed to generate test data for '%s'", name); \
|
||||
VIR_TEST_DEBUG("Failed to generate test data for '%s'", name); \
|
||||
return -1; \
|
||||
} \
|
||||
virQEMUCapsSetList(info.qemuCaps, __VA_ARGS__, QEMU_CAPS_LAST); \
|
||||
\
|
||||
if (info.outInactiveName) { \
|
||||
if (virtTestRun("QEMU XML-2-XML-inactive " name, \
|
||||
if (virTestRun("QEMU XML-2-XML-inactive " name, \
|
||||
testXML2XMLInactive, &info) < 0) \
|
||||
ret = -1; \
|
||||
} \
|
||||
\
|
||||
if (info.outActiveName) { \
|
||||
if (virtTestRun("QEMU XML-2-XML-active " name, \
|
||||
if (virTestRun("QEMU XML-2-XML-active " name, \
|
||||
testXML2XMLActive, &info) < 0) \
|
||||
ret = -1; \
|
||||
\
|
||||
if (virtTestRun("QEMU XML-2-XML-status " name, \
|
||||
if (virTestRun("QEMU XML-2-XML-status " name, \
|
||||
testCompareStatusXMLToXMLFiles, &info) < 0) \
|
||||
ret = -1; \
|
||||
} \
|
||||
|
@ -280,14 +280,14 @@ mymain(void)
|
||||
}
|
||||
VIR_DEBUG("Reading from '%s'", scsihost_class_path);
|
||||
|
||||
if (virtTestRun("testVirReadSCSIUniqueId",
|
||||
testVirReadSCSIUniqueId, NULL) < 0) {
|
||||
if (virTestRun("testVirReadSCSIUniqueId",
|
||||
testVirReadSCSIUniqueId, NULL) < 0) {
|
||||
ret = -1;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (virtTestRun("testVirFindSCSIHostByPCI",
|
||||
testVirFindSCSIHostByPCI, NULL) < 0) {
|
||||
if (virTestRun("testVirFindSCSIHostByPCI",
|
||||
testVirFindSCSIHostByPCI, NULL) < 0) {
|
||||
ret = -1;
|
||||
goto cleanup;
|
||||
}
|
||||
|
@ -71,8 +71,8 @@ mymain(void)
|
||||
#define DO_TEST(name) \
|
||||
do { \
|
||||
const struct testInfo info = {name, false}; \
|
||||
if (virtTestRun("Secret XML->XML " name, \
|
||||
testCompareXMLToXMLHelper, &info) < 0) \
|
||||
if (virTestRun("Secret XML->XML " name, \
|
||||
testCompareXMLToXMLHelper, &info) < 0) \
|
||||
ret = -1; \
|
||||
} while (0)
|
||||
|
||||
|
@ -367,7 +367,7 @@ mymain(void)
|
||||
return EXIT_FAILURE;
|
||||
|
||||
#define DO_TEST_LABELING(name) \
|
||||
if (virtTestRun("Labelling " # name, testSELinuxLabeling, name) < 0) \
|
||||
if (virTestRun("Labelling " # name, testSELinuxLabeling, name) < 0) \
|
||||
ret = -1;
|
||||
|
||||
setcon((security_context_t)"system_r:system_u:libvirtd_t:s0:c0.c1023");
|
||||
|
@ -279,19 +279,19 @@ mymain(void)
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
#define DO_TEST_GEN_LABEL(desc, pidcon, \
|
||||
dynamic, label, baselabel, \
|
||||
user, role, imageRole, \
|
||||
type, imageType, \
|
||||
sensMin, sensMax, catMin, catMax) \
|
||||
do { \
|
||||
struct testSELinuxGenLabelData data = { \
|
||||
mgr, pidcon, dynamic, label, baselabel, \
|
||||
user, role, imageRole, type, imageType, \
|
||||
sensMin, sensMax, catMin, catMax \
|
||||
}; \
|
||||
if (virtTestRun("GenLabel " # desc, testSELinuxGenLabel, &data) < 0) \
|
||||
ret = -1; \
|
||||
#define DO_TEST_GEN_LABEL(desc, pidcon, \
|
||||
dynamic, label, baselabel, \
|
||||
user, role, imageRole, \
|
||||
type, imageType, \
|
||||
sensMin, sensMax, catMin, catMax) \
|
||||
do { \
|
||||
struct testSELinuxGenLabelData data = { \
|
||||
mgr, pidcon, dynamic, label, baselabel, \
|
||||
user, role, imageRole, type, imageType, \
|
||||
sensMin, sensMax, catMin, catMax \
|
||||
}; \
|
||||
if (virTestRun("GenLabel " # desc, testSELinuxGenLabel, &data) < 0) \
|
||||
ret = -1; \
|
||||
} while (0)
|
||||
|
||||
DO_TEST_GEN_LABEL("dynamic unconfined, s0, c0.c1023",
|
||||
|
@ -125,8 +125,8 @@ mymain(void)
|
||||
do { \
|
||||
struct testInfo info = { in, out }; \
|
||||
virResetLastError(); \
|
||||
if (virtTestRun("Xen SEXPR-2-XML " in " -> " out, \
|
||||
testCompareHelper, &info) < 0) \
|
||||
if (virTestRun("Xen SEXPR-2-XML " in " -> " out, \
|
||||
testCompareHelper, &info) < 0) \
|
||||
ret = -1; \
|
||||
} while (0)
|
||||
|
||||
|
@ -279,36 +279,36 @@ mymain(void)
|
||||
virSocketAddr addr; \
|
||||
struct testParseData data = { &addr, addrstr, family, pass }; \
|
||||
memset(&addr, 0, sizeof(addr)); \
|
||||
if (virtTestRun("Test parse " addrstr " family " #family, \
|
||||
testParseHelper, &data) < 0) \
|
||||
if (virTestRun("Test parse " addrstr " family " #family, \
|
||||
testParseHelper, &data) < 0) \
|
||||
ret = -1; \
|
||||
struct testFormatData data2 = { &addr, addrstr, pass }; \
|
||||
if (virtTestRun("Test format " addrstr " family " #family, \
|
||||
testFormatHelper, &data2) < 0) \
|
||||
if (virTestRun("Test format " addrstr " family " #family, \
|
||||
testFormatHelper, &data2) < 0) \
|
||||
ret = -1; \
|
||||
} while (0)
|
||||
|
||||
#define DO_TEST_PARSE_AND_CHECK_FORMAT(addrstr, addrformated, family, pass) \
|
||||
do { \
|
||||
virSocketAddr addr; \
|
||||
struct testParseData data = { &addr, addrstr, family, true}; \
|
||||
memset(&addr, 0, sizeof(addr)); \
|
||||
if (virtTestRun("Test parse " addrstr " family " #family, \
|
||||
testParseHelper, &data) < 0) \
|
||||
ret = -1; \
|
||||
struct testFormatData data2 = { &addr, addrformated, pass }; \
|
||||
if (virtTestRun("Test format " addrstr " family " #family, \
|
||||
testFormatHelper, &data2) < 0) \
|
||||
ret = -1; \
|
||||
do { \
|
||||
virSocketAddr addr; \
|
||||
struct testParseData data = { &addr, addrstr, family, true}; \
|
||||
memset(&addr, 0, sizeof(addr)); \
|
||||
if (virTestRun("Test parse " addrstr " family " #family, \
|
||||
testParseHelper, &data) < 0) \
|
||||
ret = -1; \
|
||||
struct testFormatData data2 = { &addr, addrformated, pass }; \
|
||||
if (virTestRun("Test format " addrstr " family " #family, \
|
||||
testFormatHelper, &data2) < 0) \
|
||||
ret = -1; \
|
||||
} while (0)
|
||||
|
||||
#define DO_TEST_RANGE(saddr, eaddr, netaddr, prefix, size, pass) \
|
||||
do { \
|
||||
struct testRangeData data \
|
||||
= { saddr, eaddr, netaddr, prefix, size, pass }; \
|
||||
if (virtTestRun("Test range " saddr " -> " eaddr "(" netaddr \
|
||||
"/" #prefix") size " #size, \
|
||||
testRangeHelper, &data) < 0) \
|
||||
if (virTestRun("Test range " saddr " -> " eaddr "(" netaddr \
|
||||
"/" #prefix") size " #size, \
|
||||
testRangeHelper, &data) < 0) \
|
||||
ret = -1; \
|
||||
} while (0)
|
||||
|
||||
@ -316,39 +316,39 @@ mymain(void)
|
||||
do { \
|
||||
struct testRangeData data \
|
||||
= { saddr, eaddr, NULL, 0, size, pass }; \
|
||||
if (virtTestRun("Test range " saddr " -> " eaddr "size " #size, \
|
||||
testRangeHelper, &data) < 0) \
|
||||
if (virTestRun("Test range " saddr " -> " eaddr "size " #size, \
|
||||
testRangeHelper, &data) < 0) \
|
||||
ret = -1; \
|
||||
} while (0)
|
||||
|
||||
#define DO_TEST_NETMASK(addr1, addr2, netmask, pass) \
|
||||
do { \
|
||||
struct testNetmaskData data = { addr1, addr2, netmask, pass }; \
|
||||
if (virtTestRun("Test netmask " addr1 " + " addr2 " in " netmask, \
|
||||
testNetmaskHelper, &data) < 0) \
|
||||
ret = -1; \
|
||||
#define DO_TEST_NETMASK(addr1, addr2, netmask, pass) \
|
||||
do { \
|
||||
struct testNetmaskData data = { addr1, addr2, netmask, pass }; \
|
||||
if (virTestRun("Test netmask " addr1 " + " addr2 " in " netmask, \
|
||||
testNetmaskHelper, &data) < 0) \
|
||||
ret = -1; \
|
||||
} while (0)
|
||||
|
||||
#define DO_TEST_MASK_NETWORK(addr1, prefix, network) \
|
||||
do { \
|
||||
struct testMaskNetworkData data = { addr1, prefix, network }; \
|
||||
if (virtTestRun("Test mask network " addr1 " / " #prefix " == " network, \
|
||||
testMaskNetworkHelper, &data) < 0) \
|
||||
ret = -1; \
|
||||
#define DO_TEST_MASK_NETWORK(addr1, prefix, network) \
|
||||
do { \
|
||||
struct testMaskNetworkData data = { addr1, prefix, network }; \
|
||||
if (virTestRun("Test mask network " addr1 " / " #prefix " == " network, \
|
||||
testMaskNetworkHelper, &data) < 0) \
|
||||
ret = -1; \
|
||||
} while (0)
|
||||
|
||||
#define DO_TEST_WILDCARD(addr, pass) \
|
||||
do { \
|
||||
struct testWildcardData data = { addr, pass}; \
|
||||
if (virtTestRun("Test wildcard " addr, \
|
||||
testWildcardHelper, &data) < 0) \
|
||||
if (virTestRun("Test wildcard " addr, \
|
||||
testWildcardHelper, &data) < 0) \
|
||||
ret = -1; \
|
||||
} while (0)
|
||||
|
||||
#define DO_TEST_NUMERIC_FAMILY(addr, pass) \
|
||||
do { \
|
||||
struct testNumericData data = { addr, pass }; \
|
||||
if (virtTestRun("Test Numeric Family" addr, \
|
||||
if (virTestRun("Test Numeric Family" addr, \
|
||||
testNumericHelper, &data) < 0) \
|
||||
ret = -1; \
|
||||
} while (0)
|
||||
@ -356,7 +356,7 @@ mymain(void)
|
||||
#define DO_TEST_LOCALHOST(addr, pass) \
|
||||
do { \
|
||||
struct testIsLocalhostData data = { addr, pass }; \
|
||||
if (virtTestRun("Test localhost " addr, \
|
||||
if (virTestRun("Test localhost " addr, \
|
||||
testIsLocalhostHelper, &data) < 0) \
|
||||
ret = -1; \
|
||||
} while (0)
|
||||
|
@ -191,8 +191,8 @@ mymain(void)
|
||||
.data = collie, \
|
||||
.poolxml = poolxml, \
|
||||
}; \
|
||||
if (virtTestRun("node_info_parser", test_node_info_parser, \
|
||||
&data) < 0) \
|
||||
if (virTestRun("node_info_parser", test_node_info_parser, \
|
||||
&data) < 0) \
|
||||
ret = -1; \
|
||||
} while (0)
|
||||
|
||||
@ -209,8 +209,8 @@ mymain(void)
|
||||
.poolxml = poolxml, \
|
||||
.volxml = volxml, \
|
||||
}; \
|
||||
if (virtTestRun("vdi_list_parser", test_vdi_list_parser, \
|
||||
&data) < 0) \
|
||||
if (virTestRun("vdi_list_parser", test_vdi_list_parser, \
|
||||
&data) < 0) \
|
||||
ret = -1; \
|
||||
} while (0)
|
||||
|
||||
|
@ -69,8 +69,8 @@ mymain(void)
|
||||
int ret = 0;
|
||||
|
||||
#define DO_TEST(name) \
|
||||
if (virtTestRun("Storage Pool XML-2-XML " name, \
|
||||
testCompareXMLToXMLHelper, (name)) < 0) \
|
||||
if (virTestRun("Storage Pool XML-2-XML " name, \
|
||||
testCompareXMLToXMLHelper, (name)) < 0) \
|
||||
ret = -1
|
||||
|
||||
DO_TEST("pool-dir");
|
||||
|
@ -187,8 +187,8 @@ mymain(void)
|
||||
do { \
|
||||
struct testInfo info = { shouldFail, pool, vol, inputpool, inputvol, \
|
||||
cmdline, flags, imgformat, parseflags }; \
|
||||
if (virtTestRun("Storage Vol XML-2-argv " cmdline, \
|
||||
testCompareXMLToArgvHelper, &info) < 0) \
|
||||
if (virTestRun("Storage Vol XML-2-argv " cmdline, \
|
||||
testCompareXMLToArgvHelper, &info) < 0) \
|
||||
ret = -1; \
|
||||
} \
|
||||
while (0);
|
||||
|
@ -89,8 +89,8 @@ mymain(void)
|
||||
#define DO_TEST_FULL(pool, name, flags) \
|
||||
do { \
|
||||
struct testInfo info = { pool, name, flags }; \
|
||||
if (virtTestRun("Storage Vol XML-2-XML " name, \
|
||||
testCompareXMLToXMLHelper, &info) < 0) \
|
||||
if (virTestRun("Storage Vol XML-2-XML " name, \
|
||||
testCompareXMLToXMLHelper, &info) < 0) \
|
||||
ret = -1; \
|
||||
} \
|
||||
while (0);
|
||||
|
@ -112,7 +112,7 @@ sysinfotest_run(const char *test,
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (virtTestRun(test, testSysinfo, &testdata) < 0)
|
||||
if (virTestRun(test, testSysinfo, &testdata) < 0)
|
||||
goto error;
|
||||
|
||||
ret = EXIT_SUCCESS;
|
||||
|
@ -152,8 +152,8 @@ virTestShowTrace(void)
|
||||
* returns: -1 = error, 0 = success
|
||||
*/
|
||||
int
|
||||
virtTestRun(const char *title,
|
||||
int (*body)(const void *data), const void *data)
|
||||
virTestRun(const char *title,
|
||||
int (*body)(const void *data), const void *data)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
|
@ -48,9 +48,9 @@ extern char *progname;
|
||||
|
||||
bool virtTestOOMActive(void);
|
||||
|
||||
int virtTestRun(const char *title,
|
||||
int (*body)(const void *data),
|
||||
const void *data);
|
||||
int virTestRun(const char *title,
|
||||
int (*body)(const void *data),
|
||||
const void *data);
|
||||
int virtTestLoadFile(const char *file, char **buf);
|
||||
int virtTestCaptureProgramOutput(const char *const argv[], char **buf, int maxlen);
|
||||
|
||||
|
@ -267,8 +267,8 @@ mymain(void)
|
||||
|
||||
#define DO_TEST(_name) \
|
||||
do { \
|
||||
if (virtTestRun("Util "#_name, test##_name, \
|
||||
NULL) < 0) { \
|
||||
if (virTestRun("Util "#_name, test##_name, \
|
||||
NULL) < 0) { \
|
||||
result = -1; \
|
||||
} \
|
||||
} while (0)
|
||||
|
@ -135,8 +135,8 @@ mymain(void)
|
||||
}
|
||||
|
||||
# define DO_TEST(name) \
|
||||
if (virtTestRun("VBox Snapshot XML-2-XML " name, \
|
||||
testCompareXMLToXMLHelper, (name)) < 0) \
|
||||
if (virTestRun("VBox Snapshot XML-2-XML " name, \
|
||||
testCompareXMLToXMLHelper, (name)) < 0) \
|
||||
ret = -1
|
||||
|
||||
DO_TEST("2disks-nosnap");
|
||||
|
@ -423,19 +423,19 @@ mymain(void)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
if (virtTestRun("alloc scalar", testAllocScalar, NULL) < 0)
|
||||
if (virTestRun("alloc scalar", testAllocScalar, NULL) < 0)
|
||||
ret = -1;
|
||||
if (virtTestRun("alloc array", testAllocArray, NULL) < 0)
|
||||
if (virTestRun("alloc array", testAllocArray, NULL) < 0)
|
||||
ret = -1;
|
||||
if (virtTestRun("realloc array", testReallocArray, NULL) < 0)
|
||||
if (virTestRun("realloc array", testReallocArray, NULL) < 0)
|
||||
ret = -1;
|
||||
if (virtTestRun("expand array", testExpandArray, NULL) < 0)
|
||||
if (virTestRun("expand array", testExpandArray, NULL) < 0)
|
||||
ret = -1;
|
||||
if (virtTestRun("resize array", testResizeArray, NULL) < 0)
|
||||
if (virTestRun("resize array", testResizeArray, NULL) < 0)
|
||||
ret = -1;
|
||||
if (virtTestRun("insert array", testInsertArray, NULL) < 0)
|
||||
if (virTestRun("insert array", testInsertArray, NULL) < 0)
|
||||
ret = -1;
|
||||
if (virtTestRun("dispose tests", testDispose, NULL) < 0)
|
||||
if (virTestRun("dispose tests", testDispose, NULL) < 0)
|
||||
ret = -1;
|
||||
|
||||
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
|
||||
|
@ -167,9 +167,9 @@ mymain(void)
|
||||
if (virThreadInitialize() < 0)
|
||||
return -1;
|
||||
|
||||
if (virtTestRun("types", testTypes, NULL) < 0)
|
||||
if (virTestRun("types", testTypes, NULL) < 0)
|
||||
ret = -1;
|
||||
if (virtTestRun("threads", testThreads, NULL) < 0)
|
||||
if (virTestRun("threads", testThreads, NULL) < 0)
|
||||
ret = -1;
|
||||
|
||||
return ret;
|
||||
|
@ -92,14 +92,14 @@ mymain(void)
|
||||
|
||||
signal(SIGPIPE, SIG_IGN);
|
||||
|
||||
#define TEST_LOOKUP(config, hostname, service, credname, expect) \
|
||||
do { \
|
||||
const struct ConfigLookupData data = { \
|
||||
config, hostname, service, credname, expect \
|
||||
}; \
|
||||
if (virtTestRun("Test Lookup " hostname "-" service "-" credname, \
|
||||
testAuthLookup, &data) < 0) \
|
||||
ret = -1; \
|
||||
#define TEST_LOOKUP(config, hostname, service, credname, expect) \
|
||||
do { \
|
||||
const struct ConfigLookupData data = { \
|
||||
config, hostname, service, credname, expect \
|
||||
}; \
|
||||
if (virTestRun("Test Lookup " hostname "-" service "-" credname, \
|
||||
testAuthLookup, &data) < 0) \
|
||||
ret = -1; \
|
||||
} while (0)
|
||||
|
||||
const char *confdata =
|
||||
|
@ -645,7 +645,7 @@ test12(const void *opaque ATTRIBUTE_UNUSED)
|
||||
testBinaryOpData.a = A; \
|
||||
testBinaryOpData.b = B; \
|
||||
testBinaryOpData.res = RES; \
|
||||
if (virtTestRun(virtTestCounterNext(), FUNC, &testBinaryOpData) < 0) \
|
||||
if (virTestRun(virtTestCounterNext(), FUNC, &testBinaryOpData) < 0) \
|
||||
ret = -1;
|
||||
|
||||
static int
|
||||
@ -654,25 +654,25 @@ mymain(void)
|
||||
struct testBinaryOpData testBinaryOpData;
|
||||
int ret = 0;
|
||||
|
||||
if (virtTestRun("test1", test1, NULL) < 0)
|
||||
if (virTestRun("test1", test1, NULL) < 0)
|
||||
ret = -1;
|
||||
if (virtTestRun("test2", test2, NULL) < 0)
|
||||
if (virTestRun("test2", test2, NULL) < 0)
|
||||
ret = -1;
|
||||
if (virtTestRun("test3", test3, NULL) < 0)
|
||||
if (virTestRun("test3", test3, NULL) < 0)
|
||||
ret = -1;
|
||||
if (virtTestRun("test4", test4, NULL) < 0)
|
||||
if (virTestRun("test4", test4, NULL) < 0)
|
||||
ret = -1;
|
||||
if (virtTestRun("test5", test5, NULL) < 0)
|
||||
if (virTestRun("test5", test5, NULL) < 0)
|
||||
ret = -1;
|
||||
if (virtTestRun("test6", test6, NULL) < 0)
|
||||
if (virTestRun("test6", test6, NULL) < 0)
|
||||
ret = -1;
|
||||
if (virtTestRun("test7", test7, NULL) < 0)
|
||||
if (virTestRun("test7", test7, NULL) < 0)
|
||||
ret = -1;
|
||||
if (virtTestRun("test8", test8, NULL) < 0)
|
||||
if (virTestRun("test8", test8, NULL) < 0)
|
||||
ret = -1;
|
||||
if (virtTestRun("test9", test9, NULL) < 0)
|
||||
if (virTestRun("test9", test9, NULL) < 0)
|
||||
ret = -1;
|
||||
if (virtTestRun("test10", test10, NULL) < 0)
|
||||
if (virTestRun("test10", test10, NULL) < 0)
|
||||
ret = -1;
|
||||
|
||||
virtTestCounterReset("test11-");
|
||||
@ -684,7 +684,7 @@ mymain(void)
|
||||
TESTBINARYOP("0-3", "0,^0", "0-3", test11);
|
||||
TESTBINARYOP("0,2", "1,3", "0,2", test11);
|
||||
|
||||
if (virtTestRun("test12", test12, NULL) < 0)
|
||||
if (virTestRun("test12", test12, NULL) < 0)
|
||||
ret = -1;
|
||||
|
||||
return ret;
|
||||
|
@ -384,7 +384,7 @@ mymain(void)
|
||||
#define DO_TEST(msg, cb, data) \
|
||||
do { \
|
||||
struct testInfo info = { data }; \
|
||||
if (virtTestRun("Buf: " msg, cb, &info) < 0) \
|
||||
if (virTestRun("Buf: " msg, cb, &info) < 0) \
|
||||
ret = -1; \
|
||||
} while (0)
|
||||
|
||||
@ -397,7 +397,7 @@ mymain(void)
|
||||
#define DO_TEST_ADD_STR(DATA, EXPECT) \
|
||||
do { \
|
||||
struct testBufAddStrData info = { DATA, EXPECT }; \
|
||||
if (virtTestRun("Buf: AddStr", testBufAddStr, &info) < 0) \
|
||||
if (virTestRun("Buf: AddStr", testBufAddStr, &info) < 0) \
|
||||
ret = -1; \
|
||||
} while (0)
|
||||
|
||||
@ -409,7 +409,7 @@ mymain(void)
|
||||
#define DO_TEST_ESCAPE(data, expect) \
|
||||
do { \
|
||||
struct testBufAddStrData info = { data, expect }; \
|
||||
if (virtTestRun("Buf: EscapeStr", testBufEscapeStr, &info) < 0) \
|
||||
if (virTestRun("Buf: EscapeStr", testBufEscapeStr, &info) < 0) \
|
||||
ret = -1; \
|
||||
} while (0)
|
||||
|
||||
|
@ -143,8 +143,8 @@ mymain(void)
|
||||
struct virCapabilitiesFormatData data = {filename, max_cells, \
|
||||
max_cpus_in_cell, \
|
||||
max_mem_in_cell}; \
|
||||
if (virtTestRun(filename, test_virCapabilitiesFormat, &data) < 0) \
|
||||
ret = -1; \
|
||||
if (virTestRun(filename, test_virCapabilitiesFormat, &data) < 0) \
|
||||
ret = -1; \
|
||||
} while (0)
|
||||
|
||||
DO_TEST("basic-4-4-2G", 4, 4, 2*1024*1024);
|
||||
|
@ -323,22 +323,22 @@ mymain(void)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
if (virtTestRun("virCapabilitiesGetCpusForNodemask",
|
||||
test_virCapabilitiesGetCpusForNodemask, NULL) < 0)
|
||||
if (virTestRun("virCapabilitiesGetCpusForNodemask",
|
||||
test_virCapabilitiesGetCpusForNodemask, NULL) < 0)
|
||||
ret = -1;
|
||||
#ifdef WITH_QEMU
|
||||
if (virtTestRun("virCapsDomainDataLookupQEMU",
|
||||
test_virCapsDomainDataLookupQEMU, NULL) < 0)
|
||||
if (virTestRun("virCapsDomainDataLookupQEMU",
|
||||
test_virCapsDomainDataLookupQEMU, NULL) < 0)
|
||||
ret = -1;
|
||||
#endif
|
||||
#ifdef WITH_XEN
|
||||
if (virtTestRun("virCapsDomainDataLookupXen",
|
||||
test_virCapsDomainDataLookupXen, NULL) < 0)
|
||||
if (virTestRun("virCapsDomainDataLookupXen",
|
||||
test_virCapsDomainDataLookupXen, NULL) < 0)
|
||||
ret = -1;
|
||||
#endif
|
||||
#ifdef WITH_LXC
|
||||
if (virtTestRun("virCapsDomainDataLookupLXC",
|
||||
test_virCapsDomainDataLookupLXC, NULL) < 0)
|
||||
if (virTestRun("virCapsDomainDataLookupLXC",
|
||||
test_virCapsDomainDataLookupLXC, NULL) < 0)
|
||||
ret = -1;
|
||||
#endif /* WITH_LXC */
|
||||
|
||||
|
@ -869,9 +869,9 @@ mymain(void)
|
||||
|
||||
# define DETECT_MOUNTS(file) \
|
||||
do { \
|
||||
if (virtTestRun("Detect cgroup mounts for " file, \
|
||||
testCgroupDetectMounts, \
|
||||
file) < 0) \
|
||||
if (virTestRun("Detect cgroup mounts for " file, \
|
||||
testCgroupDetectMounts, \
|
||||
file) < 0) \
|
||||
ret = -1; \
|
||||
} while (0)
|
||||
|
||||
@ -886,53 +886,53 @@ mymain(void)
|
||||
DETECT_MOUNTS("all-in-one");
|
||||
DETECT_MOUNTS("no-cgroups");
|
||||
|
||||
if (virtTestRun("New cgroup for self", testCgroupNewForSelf, NULL) < 0)
|
||||
if (virTestRun("New cgroup for self", testCgroupNewForSelf, NULL) < 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("New cgroup for partition", testCgroupNewForPartition, NULL) < 0)
|
||||
if (virTestRun("New cgroup for partition", testCgroupNewForPartition, NULL) < 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("New cgroup for partition nested", testCgroupNewForPartitionNested, NULL) < 0)
|
||||
if (virTestRun("New cgroup for partition nested", testCgroupNewForPartitionNested, NULL) < 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("New cgroup for partition nested deeply", testCgroupNewForPartitionNestedDeep, NULL) < 0)
|
||||
if (virTestRun("New cgroup for partition nested deeply", testCgroupNewForPartitionNestedDeep, NULL) < 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("New cgroup for domain partition", testCgroupNewForPartitionDomain, NULL) < 0)
|
||||
if (virTestRun("New cgroup for domain partition", testCgroupNewForPartitionDomain, NULL) < 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("New cgroup for domain partition escaped", testCgroupNewForPartitionDomainEscaped, NULL) < 0)
|
||||
if (virTestRun("New cgroup for domain partition escaped", testCgroupNewForPartitionDomainEscaped, NULL) < 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("Cgroup available", testCgroupAvailable, (void*)0x1) < 0)
|
||||
if (virTestRun("Cgroup available", testCgroupAvailable, (void*)0x1) < 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("Cgroup controller available", testCgroupControllerAvailable, NULL) < 0)
|
||||
if (virTestRun("Cgroup controller available", testCgroupControllerAvailable, NULL) < 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("virCgroupGetBlkioIoServiced works", testCgroupGetBlkioIoServiced, NULL) < 0)
|
||||
if (virTestRun("virCgroupGetBlkioIoServiced works", testCgroupGetBlkioIoServiced, NULL) < 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("virCgroupGetBlkioIoDeviceServiced works", testCgroupGetBlkioIoDeviceServiced, NULL) < 0)
|
||||
if (virTestRun("virCgroupGetBlkioIoDeviceServiced works", testCgroupGetBlkioIoDeviceServiced, NULL) < 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("virCgroupGetMemoryUsage works", testCgroupGetMemoryUsage, NULL) < 0)
|
||||
if (virTestRun("virCgroupGetMemoryUsage works", testCgroupGetMemoryUsage, NULL) < 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("virCgroupGetPercpuStats works", testCgroupGetPercpuStats, NULL) < 0)
|
||||
if (virTestRun("virCgroupGetPercpuStats works", testCgroupGetPercpuStats, NULL) < 0)
|
||||
ret = -1;
|
||||
|
||||
setenv("VIR_CGROUP_MOCK_MODE", "allinone", 1);
|
||||
if (virtTestRun("New cgroup for self (allinone)", testCgroupNewForSelfAllInOne, NULL) < 0)
|
||||
if (virTestRun("New cgroup for self (allinone)", testCgroupNewForSelfAllInOne, NULL) < 0)
|
||||
ret = -1;
|
||||
if (virtTestRun("Cgroup available", testCgroupAvailable, (void*)0x1) < 0)
|
||||
if (virTestRun("Cgroup available", testCgroupAvailable, (void*)0x1) < 0)
|
||||
ret = -1;
|
||||
unsetenv("VIR_CGROUP_MOCK_MODE");
|
||||
|
||||
setenv("VIR_CGROUP_MOCK_MODE", "logind", 1);
|
||||
if (virtTestRun("New cgroup for self (logind)", testCgroupNewForSelfLogind, NULL) < 0)
|
||||
if (virTestRun("New cgroup for self (logind)", testCgroupNewForSelfLogind, NULL) < 0)
|
||||
ret = -1;
|
||||
if (virtTestRun("Cgroup available", testCgroupAvailable, (void*)0x0) < 0)
|
||||
if (virTestRun("Cgroup available", testCgroupAvailable, (void*)0x0) < 0)
|
||||
ret = -1;
|
||||
unsetenv("VIR_CGROUP_MOCK_MODE");
|
||||
|
||||
|
@ -136,7 +136,7 @@ mymain(void)
|
||||
.input = i, \
|
||||
.output = o, \
|
||||
}; \
|
||||
if (virtTestRun("Hash " i, testCryptoHash, &data) < 0) \
|
||||
if (virTestRun("Hash " i, testCryptoHash, &data) < 0) \
|
||||
ret = -1; \
|
||||
} while (0)
|
||||
|
||||
@ -163,7 +163,7 @@ mymain(void)
|
||||
.ciphertext = c, \
|
||||
.ciphertextlen = cl, \
|
||||
}; \
|
||||
if (virtTestRun("Encrypt " n, testCryptoEncrypt, &data) < 0) \
|
||||
if (virTestRun("Encrypt " n, testCryptoEncrypt, &data) < 0) \
|
||||
ret = -1; \
|
||||
} while (0)
|
||||
|
||||
|
@ -704,25 +704,25 @@ mymain(void)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
if (virtTestRun("Test message simple ", testMessageSimple, NULL) < 0)
|
||||
if (virTestRun("Test message simple ", testMessageSimple, NULL) < 0)
|
||||
ret = -1;
|
||||
if (virtTestRun("Test message variant ", testMessageVariant, NULL) < 0)
|
||||
if (virTestRun("Test message variant ", testMessageVariant, NULL) < 0)
|
||||
ret = -1;
|
||||
if (virtTestRun("Test message array ", testMessageArray, NULL) < 0)
|
||||
if (virTestRun("Test message array ", testMessageArray, NULL) < 0)
|
||||
ret = -1;
|
||||
if (virtTestRun("Test message array empty ref ", testMessageEmptyArrayRef, NULL) < 0)
|
||||
if (virTestRun("Test message array empty ref ", testMessageEmptyArrayRef, NULL) < 0)
|
||||
ret = -1;
|
||||
if (virtTestRun("Test message array single ref ", testMessageSingleArrayRef, NULL) < 0)
|
||||
if (virTestRun("Test message array single ref ", testMessageSingleArrayRef, NULL) < 0)
|
||||
ret = -1;
|
||||
if (virtTestRun("Test message array ref ", testMessageArrayRef, NULL) < 0)
|
||||
if (virTestRun("Test message array ref ", testMessageArrayRef, NULL) < 0)
|
||||
ret = -1;
|
||||
if (virtTestRun("Test message struct ", testMessageStruct, NULL) < 0)
|
||||
if (virTestRun("Test message struct ", testMessageStruct, NULL) < 0)
|
||||
ret = -1;
|
||||
if (virtTestRun("Test message dict ", testMessageDict, NULL) < 0)
|
||||
if (virTestRun("Test message dict ", testMessageDict, NULL) < 0)
|
||||
ret = -1;
|
||||
if (virtTestRun("Test message dict empty ref ", testMessageEmptyDictRef, NULL) < 0)
|
||||
if (virTestRun("Test message dict empty ref ", testMessageEmptyDictRef, NULL) < 0)
|
||||
ret = -1;
|
||||
if (virtTestRun("Test message dict ref ", testMessageDictRef, NULL) < 0)
|
||||
if (virTestRun("Test message dict ref ", testMessageDictRef, NULL) < 0)
|
||||
ret = -1;
|
||||
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
|
||||
}
|
||||
|
@ -47,10 +47,10 @@ mymain(void)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
#define TEST(name, dep1) \
|
||||
do { \
|
||||
if (virtTestRun("Test driver " # name, testDriverModule, name) < 0) \
|
||||
ret = -1; \
|
||||
#define TEST(name, dep1) \
|
||||
do { \
|
||||
if (virTestRun("Test driver " # name, testDriverModule, name) < 0) \
|
||||
ret = -1; \
|
||||
} while (0)
|
||||
|
||||
#ifdef WITH_NETWORK
|
||||
|
@ -91,9 +91,9 @@ mymain(void)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
if (virtTestRun("test1", test1, NULL) < 0)
|
||||
if (virTestRun("test1", test1, NULL) < 0)
|
||||
ret = -1;
|
||||
if (virtTestRun("test2", test2, NULL) < 0)
|
||||
if (virTestRun("test2", test2, NULL) < 0)
|
||||
ret = -1;
|
||||
|
||||
return ret;
|
||||
|
@ -146,7 +146,7 @@ mymain(void)
|
||||
struct testFileGetMountSubtreeData data = { \
|
||||
path, prefix, mounts, ARRAY_CARDINALITY(mounts), rev \
|
||||
}; \
|
||||
if (virtTestRun(name, testFileGetMountSubtree, &data) < 0) \
|
||||
if (virTestRun(name, testFileGetMountSubtree, &data) < 0) \
|
||||
ret = -1; \
|
||||
} while (0)
|
||||
|
||||
@ -160,8 +160,8 @@ mymain(void)
|
||||
do { \
|
||||
data1.path = PATH; \
|
||||
data1.expect = EXPECT; \
|
||||
if (virtTestRun(virtTestCounterNext(), testFileSanitizePath, \
|
||||
&data1) < 0) \
|
||||
if (virTestRun(virtTestCounterNext(), testFileSanitizePath, \
|
||||
&data1) < 0) \
|
||||
ret = -1; \
|
||||
} while (0)
|
||||
|
||||
|
@ -1134,12 +1134,12 @@ mymain(void)
|
||||
data.tryBackend = VIR_FIREWALL_BACKEND_AUTOMATIC; \
|
||||
data.expectBackend = VIR_FIREWALL_BACKEND_DIRECT; \
|
||||
data.fwDisabled = true; \
|
||||
if (virtTestRun(name " auto direct", method, &data) < 0) \
|
||||
if (virTestRun(name " auto direct", method, &data) < 0) \
|
||||
ret = -1; \
|
||||
data.tryBackend = VIR_FIREWALL_BACKEND_DIRECT; \
|
||||
data.expectBackend = VIR_FIREWALL_BACKEND_DIRECT; \
|
||||
data.fwDisabled = true; \
|
||||
if (virtTestRun(name " manual direct", method, &data) < 0) \
|
||||
if (virTestRun(name " manual direct", method, &data) < 0) \
|
||||
ret = -1; \
|
||||
} while (0)
|
||||
|
||||
@ -1150,12 +1150,12 @@ mymain(void)
|
||||
data.tryBackend = VIR_FIREWALL_BACKEND_AUTOMATIC; \
|
||||
data.expectBackend = VIR_FIREWALL_BACKEND_FIREWALLD; \
|
||||
data.fwDisabled = false; \
|
||||
if (virtTestRun(name " auto firewalld", method, &data) < 0) \
|
||||
if (virTestRun(name " auto firewalld", method, &data) < 0) \
|
||||
ret = -1; \
|
||||
data.tryBackend = VIR_FIREWALL_BACKEND_FIREWALLD; \
|
||||
data.expectBackend = VIR_FIREWALL_BACKEND_FIREWALLD; \
|
||||
data.fwDisabled = false; \
|
||||
if (virtTestRun(name " manual firewalld", method, &data) < 0) \
|
||||
if (virTestRun(name " manual firewalld", method, &data) < 0) \
|
||||
ret = -1; \
|
||||
} while (0)
|
||||
|
||||
|
@ -605,7 +605,7 @@ mymain(void)
|
||||
#define DO_TEST_FULL(name, cmd, data, count) \
|
||||
do { \
|
||||
struct testInfo info = { data, count }; \
|
||||
if (virtTestRun(name, testHash ## cmd, &info) < 0) \
|
||||
if (virTestRun(name, testHash ## cmd, &info) < 0) \
|
||||
ret = -1; \
|
||||
} while (0)
|
||||
|
||||
|
@ -610,7 +610,7 @@ mymain(void)
|
||||
# define DO_TEST(fnc) \
|
||||
do { \
|
||||
VIR_DEBUG("Testing: %s", #fnc); \
|
||||
if (virtTestRun(#fnc, fnc, NULL) < 0) \
|
||||
if (virTestRun(#fnc, fnc, NULL) < 0) \
|
||||
ret = -1; \
|
||||
} while (0)
|
||||
|
||||
|
@ -226,17 +226,17 @@ mymain(void)
|
||||
const char *context = "unconfined_u:unconfined_r:unconfined_t:s0";
|
||||
int ret = 0;
|
||||
|
||||
if (virtTestRun("Identity attributes ", testIdentityAttrs, NULL) < 0)
|
||||
if (virTestRun("Identity attributes ", testIdentityAttrs, NULL) < 0)
|
||||
ret = -1;
|
||||
if (virtTestRun("Identity equality ", testIdentityEqual, NULL) < 0)
|
||||
if (virTestRun("Identity equality ", testIdentityEqual, NULL) < 0)
|
||||
ret = -1;
|
||||
if (virtTestRun("Setting fake SELinux context ", testSetFakeSELinuxContext, context) < 0)
|
||||
if (virTestRun("Setting fake SELinux context ", testSetFakeSELinuxContext, context) < 0)
|
||||
ret = -1;
|
||||
if (virtTestRun("System identity (fake SELinux enabled) ", testIdentityGetSystem, context) < 0)
|
||||
if (virTestRun("System identity (fake SELinux enabled) ", testIdentityGetSystem, context) < 0)
|
||||
ret = -1;
|
||||
if (virtTestRun("Disabling fake SELinux ", testDisableFakeSELinux, NULL) < 0)
|
||||
if (virTestRun("Disabling fake SELinux ", testDisableFakeSELinux, NULL) < 0)
|
||||
ret = -1;
|
||||
if (virtTestRun("System identity (fake SELinux disabled) ", testIdentityGetSystem, NULL) < 0)
|
||||
if (virTestRun("System identity (fake SELinux disabled) ", testIdentityGetSystem, NULL) < 0)
|
||||
ret = -1;
|
||||
|
||||
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
|
||||
|
@ -182,12 +182,12 @@ mymain(void)
|
||||
# define DO_SESSION_TEST(name, session) \
|
||||
do { \
|
||||
struct testSessionInfo info = {name, 0, session}; \
|
||||
if (virtTestRun("ISCSI get session test" name, \
|
||||
testISCSIGetSession, &info) < 0) \
|
||||
if (virTestRun("ISCSI get session test" name, \
|
||||
testISCSIGetSession, &info) < 0) \
|
||||
rv = -1; \
|
||||
info.output_version = 1; \
|
||||
if (virtTestRun("ISCSI get (non-flash) session test" name, \
|
||||
testISCSIGetSession, &info) < 0) \
|
||||
if (virTestRun("ISCSI get (non-flash) session test" name, \
|
||||
testISCSIGetSession, &info) < 0) \
|
||||
rv = -1; \
|
||||
} while (0)
|
||||
|
||||
@ -209,7 +209,7 @@ mymain(void)
|
||||
.expected_targets = targets,
|
||||
.nexpected = ARRAY_CARDINALITY(targets),
|
||||
};
|
||||
if (virtTestRun("ISCSI scan targets", testISCSIScanTargets, &infoTargets) < 0)
|
||||
if (virTestRun("ISCSI scan targets", testISCSIScanTargets, &infoTargets) < 0)
|
||||
rv = -1;
|
||||
|
||||
if (rv < 0)
|
||||
|
@ -97,9 +97,9 @@ mymain(void)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
if (virtTestRun("Keycode mapping ", testKeycodeMapping, NULL) < 0)
|
||||
if (virTestRun("Keycode mapping ", testKeycodeMapping, NULL) < 0)
|
||||
ret = -1;
|
||||
if (virtTestRun("Keycode strings ", testKeycodeStrings, NULL) < 0)
|
||||
if (virTestRun("Keycode strings ", testKeycodeStrings, NULL) < 0)
|
||||
ret = -1;
|
||||
|
||||
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
|
||||
|
@ -114,7 +114,7 @@ mymain(void)
|
||||
|
||||
signal(SIGPIPE, SIG_IGN);
|
||||
|
||||
if (virtTestRun("Test parse", testParse, NULL) < 0)
|
||||
if (virTestRun("Test parse", testParse, NULL) < 0)
|
||||
ret = -1;
|
||||
|
||||
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
|
||||
|
@ -150,7 +150,7 @@ mymain(void)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
if (virtTestRun("config", testKModConfig, NULL) < 0)
|
||||
if (virTestRun("config", testKModConfig, NULL) < 0)
|
||||
ret = -1;
|
||||
|
||||
/* Although we cannot run the command on the host, we can compare
|
||||
@ -162,7 +162,7 @@ mymain(void)
|
||||
struct testInfo data = {.module = "vfio-pci", \
|
||||
.exp_cmd = _exp_cmd, \
|
||||
.useBlacklist = _blkflag}; \
|
||||
if (virtTestRun(_name, _cb, &data) < 0) \
|
||||
if (virTestRun(_name, _cb, &data) < 0) \
|
||||
ret = -1; \
|
||||
} while (0)
|
||||
|
||||
|
@ -347,25 +347,25 @@ mymain(void)
|
||||
|
||||
signal(SIGPIPE, SIG_IGN);
|
||||
|
||||
if (virtTestRun("Lockspace creation", testLockSpaceCreate, NULL) < 0)
|
||||
if (virTestRun("Lockspace creation", testLockSpaceCreate, NULL) < 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("Lockspace res lifecycle", testLockSpaceResourceLifecycle, NULL) < 0)
|
||||
if (virTestRun("Lockspace res lifecycle", testLockSpaceResourceLifecycle, NULL) < 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("Lockspace res lock excl", testLockSpaceResourceLockExcl, NULL) < 0)
|
||||
if (virTestRun("Lockspace res lock excl", testLockSpaceResourceLockExcl, NULL) < 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("Lockspace res lock shr", testLockSpaceResourceLockShr, NULL) < 0)
|
||||
if (virTestRun("Lockspace res lock shr", testLockSpaceResourceLockShr, NULL) < 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("Lockspace res lock excl auto", testLockSpaceResourceLockExclAuto, NULL) < 0)
|
||||
if (virTestRun("Lockspace res lock excl auto", testLockSpaceResourceLockExclAuto, NULL) < 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("Lockspace res lock shr auto", testLockSpaceResourceLockShrAuto, NULL) < 0)
|
||||
if (virTestRun("Lockspace res lock shr auto", testLockSpaceResourceLockShrAuto, NULL) < 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("Lockspace res full path", testLockSpaceResourceLockPath, NULL) < 0)
|
||||
if (virTestRun("Lockspace res full path", testLockSpaceResourceLockPath, NULL) < 0)
|
||||
ret = -1;
|
||||
|
||||
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
|
||||
|
@ -115,7 +115,7 @@ mymain(void)
|
||||
struct testLogData data = { \
|
||||
str, count, pass \
|
||||
}; \
|
||||
if (virtTestRun(name, test, &data) < 0) \
|
||||
if (virTestRun(name, test, &data) < 0) \
|
||||
ret = -1; \
|
||||
} while (0)
|
||||
|
||||
|
@ -321,8 +321,8 @@ mymain(void)
|
||||
struct testExecRestartData data = { \
|
||||
file, server_names, nservers, pass \
|
||||
}; \
|
||||
if (virtTestRun("ExecRestart " file, \
|
||||
testExecRestart, &data) < 0) \
|
||||
if (virTestRun("ExecRestart " file, \
|
||||
testExecRestart, &data) < 0) \
|
||||
ret = -1; \
|
||||
} while (0)
|
||||
|
||||
|
@ -120,9 +120,9 @@ mymain(void)
|
||||
struct testSetStruct data = {.band = Band, \
|
||||
.exp_cmd = Exp_cmd, \
|
||||
__VA_ARGS__}; \
|
||||
if (virtTestRun("virNetDevBandwidthSet", \
|
||||
testVirNetDevBandwidthSet, \
|
||||
&data) < 0) \
|
||||
if (virTestRun("virNetDevBandwidthSet", \
|
||||
testVirNetDevBandwidthSet, \
|
||||
&data) < 0) \
|
||||
ret = -1; \
|
||||
} while (0)
|
||||
|
||||
|
@ -72,8 +72,8 @@ mymain(void)
|
||||
# define DO_TEST_LINK(ifname, state, speed) \
|
||||
do { \
|
||||
struct testVirNetDevGetLinkInfoData data = {ifname, state, speed}; \
|
||||
if (virtTestRun("Link info: " # ifname, \
|
||||
testVirNetDevGetLinkInfo, &data) < 0) \
|
||||
if (virTestRun("Link info: " # ifname, \
|
||||
testVirNetDevGetLinkInfo, &data) < 0) \
|
||||
ret = -1; \
|
||||
} while (0)
|
||||
|
||||
|
@ -529,19 +529,19 @@ mymain(void)
|
||||
|
||||
signal(SIGPIPE, SIG_IGN);
|
||||
|
||||
if (virtTestRun("Message Header Encode", testMessageHeaderEncode, NULL) < 0)
|
||||
if (virTestRun("Message Header Encode", testMessageHeaderEncode, NULL) < 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("Message Header Decode", testMessageHeaderDecode, NULL) < 0)
|
||||
if (virTestRun("Message Header Decode", testMessageHeaderDecode, NULL) < 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("Message Payload Encode", testMessagePayloadEncode, NULL) < 0)
|
||||
if (virTestRun("Message Payload Encode", testMessagePayloadEncode, NULL) < 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("Message Payload Decode", testMessagePayloadDecode, NULL) < 0)
|
||||
if (virTestRun("Message Payload Decode", testMessagePayloadDecode, NULL) < 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("Message Payload Stream Encode", testMessagePayloadStreamEncode, NULL) < 0)
|
||||
if (virTestRun("Message Payload Stream Encode", testMessagePayloadStreamEncode, NULL) < 0)
|
||||
ret = -1;
|
||||
|
||||
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
|
||||
|
@ -143,8 +143,8 @@ mymain(void)
|
||||
int ret = 0;
|
||||
|
||||
|
||||
if (virtTestRun("Identity",
|
||||
testIdentity, NULL) < 0)
|
||||
if (virTestRun("Identity",
|
||||
testIdentity, NULL) < 0)
|
||||
ret = -1;
|
||||
|
||||
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
|
||||
|
@ -447,35 +447,35 @@ mymain(void)
|
||||
|
||||
if (hasIPv4) {
|
||||
struct testTCPData tcpData = { "127.0.0.1", freePort, "127.0.0.1" };
|
||||
if (virtTestRun("Socket TCP/IPv4 Accept", testSocketTCPAccept, &tcpData) < 0)
|
||||
if (virTestRun("Socket TCP/IPv4 Accept", testSocketTCPAccept, &tcpData) < 0)
|
||||
ret = -1;
|
||||
}
|
||||
if (hasIPv6) {
|
||||
struct testTCPData tcpData = { "::1", freePort, "::1" };
|
||||
if (virtTestRun("Socket TCP/IPv6 Accept", testSocketTCPAccept, &tcpData) < 0)
|
||||
if (virTestRun("Socket TCP/IPv6 Accept", testSocketTCPAccept, &tcpData) < 0)
|
||||
ret = -1;
|
||||
}
|
||||
if (hasIPv6 && hasIPv4) {
|
||||
struct testTCPData tcpData = { NULL, freePort, "127.0.0.1" };
|
||||
if (virtTestRun("Socket TCP/IPv4+IPv6 Accept", testSocketTCPAccept, &tcpData) < 0)
|
||||
if (virTestRun("Socket TCP/IPv4+IPv6 Accept", testSocketTCPAccept, &tcpData) < 0)
|
||||
ret = -1;
|
||||
|
||||
tcpData.cnode = "::1";
|
||||
if (virtTestRun("Socket TCP/IPv4+IPv6 Accept", testSocketTCPAccept, &tcpData) < 0)
|
||||
if (virTestRun("Socket TCP/IPv4+IPv6 Accept", testSocketTCPAccept, &tcpData) < 0)
|
||||
ret = -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef WIN32
|
||||
if (virtTestRun("Socket UNIX Accept", testSocketUNIXAccept, NULL) < 0)
|
||||
if (virTestRun("Socket UNIX Accept", testSocketUNIXAccept, NULL) < 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("Socket UNIX Addrs", testSocketUNIXAddrs, NULL) < 0)
|
||||
if (virTestRun("Socket UNIX Addrs", testSocketUNIXAddrs, NULL) < 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("Socket External Command /dev/zero", testSocketCommandNormal, NULL) < 0)
|
||||
if (virTestRun("Socket External Command /dev/zero", testSocketCommandNormal, NULL) < 0)
|
||||
ret = -1;
|
||||
if (virtTestRun("Socket External Command /dev/does-not-exist", testSocketCommandFail, NULL) < 0)
|
||||
if (virTestRun("Socket External Command /dev/does-not-exist", testSocketCommandFail, NULL) < 0)
|
||||
ret = -1;
|
||||
|
||||
struct testSSHData sshData1 = {
|
||||
@ -488,7 +488,7 @@ mymain(void)
|
||||
"fi;"
|
||||
"'nc' $ARG -U /tmp/socket'\n",
|
||||
};
|
||||
if (virtTestRun("SSH test 1", testSocketSSH, &sshData1) < 0)
|
||||
if (virTestRun("SSH test 1", testSocketSSH, &sshData1) < 0)
|
||||
ret = -1;
|
||||
|
||||
struct testSSHData sshData2 = {
|
||||
@ -507,7 +507,7 @@ mymain(void)
|
||||
"fi;"
|
||||
"'netcat' $ARG -U /tmp/socket'\n",
|
||||
};
|
||||
if (virtTestRun("SSH test 2", testSocketSSH, &sshData2) < 0)
|
||||
if (virTestRun("SSH test 2", testSocketSSH, &sshData2) < 0)
|
||||
ret = -1;
|
||||
|
||||
struct testSSHData sshData3 = {
|
||||
@ -526,7 +526,7 @@ mymain(void)
|
||||
"fi;"
|
||||
"'netcat' $ARG -U /tmp/socket'\n",
|
||||
};
|
||||
if (virtTestRun("SSH test 3", testSocketSSH, &sshData3) < 0)
|
||||
if (virTestRun("SSH test 3", testSocketSSH, &sshData3) < 0)
|
||||
ret = -1;
|
||||
|
||||
struct testSSHData sshData4 = {
|
||||
@ -534,7 +534,7 @@ mymain(void)
|
||||
.path = "/tmp/socket",
|
||||
.failConnect = true,
|
||||
};
|
||||
if (virtTestRun("SSH test 4", testSocketSSH, &sshData4) < 0)
|
||||
if (virTestRun("SSH test 4", testSocketSSH, &sshData4) < 0)
|
||||
ret = -1;
|
||||
|
||||
struct testSSHData sshData5 = {
|
||||
@ -549,7 +549,7 @@ mymain(void)
|
||||
"'nc' $ARG -U /tmp/socket'\n",
|
||||
.dieEarly = true,
|
||||
};
|
||||
if (virtTestRun("SSH test 5", testSocketSSH, &sshData5) < 0)
|
||||
if (virTestRun("SSH test 5", testSocketSSH, &sshData5) < 0)
|
||||
ret = -1;
|
||||
|
||||
struct testSSHData sshData6 = {
|
||||
@ -565,7 +565,7 @@ mymain(void)
|
||||
"fi;"
|
||||
"'nc' $ARG -U /tmp/socket'\n",
|
||||
};
|
||||
if (virtTestRun("SSH test 6", testSocketSSH, &sshData6) < 0)
|
||||
if (virTestRun("SSH test 6", testSocketSSH, &sshData6) < 0)
|
||||
ret = -1;
|
||||
|
||||
struct testSSHData sshData7 = {
|
||||
@ -579,7 +579,7 @@ mymain(void)
|
||||
"fi;"
|
||||
"''nc -4'' $ARG -U /tmp/socket'\n",
|
||||
};
|
||||
if (virtTestRun("SSH test 7", testSocketSSH, &sshData7) < 0)
|
||||
if (virTestRun("SSH test 7", testSocketSSH, &sshData7) < 0)
|
||||
ret = -1;
|
||||
|
||||
#endif
|
||||
|
@ -125,8 +125,8 @@ mymain(void)
|
||||
data.cacrt = _caCrt; \
|
||||
data.crt = _crt; \
|
||||
data.expectFail = _expectFail; \
|
||||
if (virtTestRun("TLS Context " #_caCrt " + " #_crt, \
|
||||
testTLSContextInit, &data) < 0) \
|
||||
if (virTestRun("TLS Context " #_caCrt " + " #_crt, \
|
||||
testTLSContextInit, &data) < 0) \
|
||||
ret = -1; \
|
||||
} while (0)
|
||||
|
||||
|
@ -247,38 +247,38 @@ mymain(void)
|
||||
testTLSInit(KEYFILE);
|
||||
|
||||
# define DO_SESS_TEST(_caCrt, _serverCrt, _clientCrt, _expectServerFail, \
|
||||
_expectClientFail, _hostname, _wildcards) \
|
||||
do { \
|
||||
static struct testTLSSessionData data; \
|
||||
data.servercacrt = _caCrt; \
|
||||
data.clientcacrt = _caCrt; \
|
||||
data.servercrt = _serverCrt; \
|
||||
data.clientcrt = _clientCrt; \
|
||||
data.expectServerFail = _expectServerFail; \
|
||||
data.expectClientFail = _expectClientFail; \
|
||||
data.hostname = _hostname; \
|
||||
data.wildcards = _wildcards; \
|
||||
if (virtTestRun("TLS Session " #_serverCrt " + " #_clientCrt, \
|
||||
testTLSSessionInit, &data) < 0) \
|
||||
ret = -1; \
|
||||
_expectClientFail, _hostname, _wildcards) \
|
||||
do { \
|
||||
static struct testTLSSessionData data; \
|
||||
data.servercacrt = _caCrt; \
|
||||
data.clientcacrt = _caCrt; \
|
||||
data.servercrt = _serverCrt; \
|
||||
data.clientcrt = _clientCrt; \
|
||||
data.expectServerFail = _expectServerFail; \
|
||||
data.expectClientFail = _expectClientFail; \
|
||||
data.hostname = _hostname; \
|
||||
data.wildcards = _wildcards; \
|
||||
if (virTestRun("TLS Session " #_serverCrt " + " #_clientCrt, \
|
||||
testTLSSessionInit, &data) < 0) \
|
||||
ret = -1; \
|
||||
} while (0)
|
||||
|
||||
# define DO_SESS_TEST_EXT(_serverCaCrt, _clientCaCrt, _serverCrt, _clientCrt, \
|
||||
_expectServerFail, _expectClientFail, \
|
||||
_hostname, _wildcards) \
|
||||
do { \
|
||||
static struct testTLSSessionData data; \
|
||||
data.servercacrt = _serverCaCrt; \
|
||||
data.clientcacrt = _clientCaCrt; \
|
||||
data.servercrt = _serverCrt; \
|
||||
data.clientcrt = _clientCrt; \
|
||||
data.expectServerFail = _expectServerFail; \
|
||||
data.expectClientFail = _expectClientFail; \
|
||||
data.hostname = _hostname; \
|
||||
data.wildcards = _wildcards; \
|
||||
if (virtTestRun("TLS Session " #_serverCrt " + " #_clientCrt, \
|
||||
testTLSSessionInit, &data) < 0) \
|
||||
ret = -1; \
|
||||
_expectServerFail, _expectClientFail, \
|
||||
_hostname, _wildcards) \
|
||||
do { \
|
||||
static struct testTLSSessionData data; \
|
||||
data.servercacrt = _serverCaCrt; \
|
||||
data.clientcacrt = _clientCaCrt; \
|
||||
data.servercrt = _serverCrt; \
|
||||
data.clientcrt = _clientCrt; \
|
||||
data.expectServerFail = _expectServerFail; \
|
||||
data.expectClientFail = _expectClientFail; \
|
||||
data.hostname = _hostname; \
|
||||
data.wildcards = _wildcards; \
|
||||
if (virTestRun("TLS Session " #_serverCrt " + " #_clientCrt, \
|
||||
testTLSSessionInit, &data) < 0) \
|
||||
ret = -1; \
|
||||
} while (0)
|
||||
|
||||
# define TLS_CERT_REQ(varname, cavarname, \
|
||||
|
@ -376,7 +376,7 @@ mymain(void)
|
||||
|
||||
# define DO_TEST(fnc) \
|
||||
do { \
|
||||
if (virtTestRun(#fnc, fnc, NULL) < 0) \
|
||||
if (virTestRun(#fnc, fnc, NULL) < 0) \
|
||||
ret = -1; \
|
||||
} while (0)
|
||||
|
||||
@ -391,7 +391,7 @@ mymain(void)
|
||||
ret = -1; \
|
||||
break; \
|
||||
} \
|
||||
if (virtTestRun(label, fnc, &data) < 0) \
|
||||
if (virTestRun(label, fnc, &data) < 0) \
|
||||
ret = -1; \
|
||||
VIR_FREE(label); \
|
||||
} while (0)
|
||||
@ -408,8 +408,8 @@ mymain(void)
|
||||
ret = -1; \
|
||||
break; \
|
||||
} \
|
||||
if (virtTestRun(label, testVirPCIDeviceCheckDriverTest, \
|
||||
&data) < 0) \
|
||||
if (virTestRun(label, testVirPCIDeviceCheckDriverTest, \
|
||||
&data) < 0) \
|
||||
ret = -1; \
|
||||
VIR_FREE(label); \
|
||||
} while (0)
|
||||
|
@ -334,17 +334,17 @@ mymain(void)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
if (virtTestRun("Polkit auth success ", testPolkitAuthSuccess, NULL) < 0)
|
||||
if (virTestRun("Polkit auth success ", testPolkitAuthSuccess, NULL) < 0)
|
||||
ret = -1;
|
||||
if (virtTestRun("Polkit auth deny ", testPolkitAuthDenied, NULL) < 0)
|
||||
if (virTestRun("Polkit auth deny ", testPolkitAuthDenied, NULL) < 0)
|
||||
ret = -1;
|
||||
if (virtTestRun("Polkit auth challenge ", testPolkitAuthChallenge, NULL) < 0)
|
||||
if (virTestRun("Polkit auth challenge ", testPolkitAuthChallenge, NULL) < 0)
|
||||
ret = -1;
|
||||
if (virtTestRun("Polkit auth cancel ", testPolkitAuthCancelled, NULL) < 0)
|
||||
if (virTestRun("Polkit auth cancel ", testPolkitAuthCancelled, NULL) < 0)
|
||||
ret = -1;
|
||||
if (virtTestRun("Polkit auth details success ", testPolkitAuthDetailsSuccess, NULL) < 0)
|
||||
if (virTestRun("Polkit auth details success ", testPolkitAuthDetailsSuccess, NULL) < 0)
|
||||
ret = -1;
|
||||
if (virtTestRun("Polkit auth details deny ", testPolkitAuthDetailsDenied, NULL) < 0)
|
||||
if (virTestRun("Polkit auth details deny ", testPolkitAuthDetailsDenied, NULL) < 0)
|
||||
ret = -1;
|
||||
|
||||
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
|
||||
|
@ -157,18 +157,18 @@ mymain(void)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
if (virtTestRun("Test alloc all", testAllocAll, NULL) < 0)
|
||||
if (virTestRun("Test alloc all", testAllocAll, NULL) < 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("Test alloc reuse", testAllocReuse, NULL) < 0)
|
||||
if (virTestRun("Test alloc reuse", testAllocReuse, NULL) < 0)
|
||||
ret = -1;
|
||||
|
||||
setenv("LIBVIRT_TEST_IPV4ONLY", "really", 1);
|
||||
|
||||
if (virtTestRun("Test IPv4-only alloc all", testAllocAll, NULL) < 0)
|
||||
if (virTestRun("Test IPv4-only alloc all", testAllocAll, NULL) < 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("Test IPv4-only alloc reuse", testAllocReuse, NULL) < 0)
|
||||
if (virTestRun("Test IPv4-only alloc reuse", testAllocReuse, NULL) < 0)
|
||||
ret = -1;
|
||||
|
||||
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
|
||||
|
@ -67,7 +67,7 @@ mymain(void)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
if (virtTestRun("RandomBytes", testRandomBytes, NULL) < 0)
|
||||
if (virTestRun("RandomBytes", testRandomBytes, NULL) < 0)
|
||||
ret = -1;
|
||||
|
||||
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
|
||||
|
@ -699,43 +699,43 @@ mymain(void)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
if (virtTestRun("Rotating file write new", testRotatingFileWriterNew, NULL) < 0)
|
||||
if (virTestRun("Rotating file write new", testRotatingFileWriterNew, NULL) < 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("Rotating file write append", testRotatingFileWriterAppend, NULL) < 0)
|
||||
if (virTestRun("Rotating file write append", testRotatingFileWriterAppend, NULL) < 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("Rotating file write truncate", testRotatingFileWriterTruncate, NULL) < 0)
|
||||
if (virTestRun("Rotating file write truncate", testRotatingFileWriterTruncate, NULL) < 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("Rotating file write rollover no backup", testRotatingFileWriterRolloverNone, NULL) < 0)
|
||||
if (virTestRun("Rotating file write rollover no backup", testRotatingFileWriterRolloverNone, NULL) < 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("Rotating file write rollover one", testRotatingFileWriterRolloverOne, NULL) < 0)
|
||||
if (virTestRun("Rotating file write rollover one", testRotatingFileWriterRolloverOne, NULL) < 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("Rotating file write rollover append", testRotatingFileWriterRolloverAppend, NULL) < 0)
|
||||
if (virTestRun("Rotating file write rollover append", testRotatingFileWriterRolloverAppend, NULL) < 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("Rotating file write rollover many", testRotatingFileWriterRolloverMany, NULL) < 0)
|
||||
if (virTestRun("Rotating file write rollover many", testRotatingFileWriterRolloverMany, NULL) < 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("Rotating file write rollover line break", testRotatingFileWriterRolloverLineBreak, NULL) < 0)
|
||||
if (virTestRun("Rotating file write rollover line break", testRotatingFileWriterRolloverLineBreak, NULL) < 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("Rotating file write to file larger then maxlen", testRotatingFileWriterLargeFile, NULL) < 0)
|
||||
if (virTestRun("Rotating file write to file larger then maxlen", testRotatingFileWriterLargeFile, NULL) < 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("Rotating file read one", testRotatingFileReaderOne, NULL) < 0)
|
||||
if (virTestRun("Rotating file read one", testRotatingFileReaderOne, NULL) < 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("Rotating file read all", testRotatingFileReaderAll, NULL) < 0)
|
||||
if (virTestRun("Rotating file read all", testRotatingFileReaderAll, NULL) < 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("Rotating file read partial", testRotatingFileReaderPartial, NULL) < 0)
|
||||
if (virTestRun("Rotating file read partial", testRotatingFileReaderPartial, NULL) < 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("Rotating file read seek", testRotatingFileReaderSeek, NULL) < 0)
|
||||
if (virTestRun("Rotating file read seek", testRotatingFileReaderSeek, NULL) < 0)
|
||||
ret = -1;
|
||||
|
||||
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
|
||||
|
@ -99,7 +99,7 @@ testSchemaDir(const char *schema,
|
||||
goto cleanup;
|
||||
|
||||
data.xml_path = xml_path;
|
||||
if (virtTestRun(test_name, testSchemaFile, &data) < 0)
|
||||
if (virTestRun(test_name, testSchemaFile, &data) < 0)
|
||||
ret = -1;
|
||||
|
||||
VIR_FREE(test_name);
|
||||
|
@ -235,9 +235,9 @@ mymain(void)
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (virtTestRun("test1", test1, NULL) < 0)
|
||||
if (virTestRun("test1", test1, NULL) < 0)
|
||||
ret = -1;
|
||||
if (virtTestRun("test2", test2, NULL) < 0)
|
||||
if (virTestRun("test2", test2, NULL) < 0)
|
||||
ret = -1;
|
||||
|
||||
cleanup:
|
||||
|
@ -258,68 +258,68 @@ mymain(void)
|
||||
abs_srcdir) < 0)
|
||||
return EXIT_FAILURE;
|
||||
|
||||
if (virtTestRun("virsh list (default)",
|
||||
testCompareListDefault, NULL) != 0)
|
||||
if (virTestRun("virsh list (default)",
|
||||
testCompareListDefault, NULL) != 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("virsh list (custom)",
|
||||
testCompareListCustom, NULL) != 0)
|
||||
if (virTestRun("virsh list (custom)",
|
||||
testCompareListCustom, NULL) != 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("virsh nodeinfo (default)",
|
||||
testCompareNodeinfoDefault, NULL) != 0)
|
||||
if (virTestRun("virsh nodeinfo (default)",
|
||||
testCompareNodeinfoDefault, NULL) != 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("virsh nodeinfo (custom)",
|
||||
testCompareNodeinfoCustom, NULL) != 0)
|
||||
if (virTestRun("virsh nodeinfo (custom)",
|
||||
testCompareNodeinfoCustom, NULL) != 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("virsh dominfo (by id)",
|
||||
testCompareDominfoByID, NULL) != 0)
|
||||
if (virTestRun("virsh dominfo (by id)",
|
||||
testCompareDominfoByID, NULL) != 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("virsh dominfo (by uuid)",
|
||||
testCompareDominfoByUUID, NULL) != 0)
|
||||
if (virTestRun("virsh dominfo (by uuid)",
|
||||
testCompareDominfoByUUID, NULL) != 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("virsh dominfo (by name)",
|
||||
testCompareDominfoByName, NULL) != 0)
|
||||
if (virTestRun("virsh dominfo (by name)",
|
||||
testCompareDominfoByName, NULL) != 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("virsh domid (by name)",
|
||||
testCompareDomidByName, NULL) != 0)
|
||||
if (virTestRun("virsh domid (by name)",
|
||||
testCompareDomidByName, NULL) != 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("virsh domid (by uuid)",
|
||||
testCompareDomidByUUID, NULL) != 0)
|
||||
if (virTestRun("virsh domid (by uuid)",
|
||||
testCompareDomidByUUID, NULL) != 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("virsh domuuid (by id)",
|
||||
testCompareDomuuidByID, NULL) != 0)
|
||||
if (virTestRun("virsh domuuid (by id)",
|
||||
testCompareDomuuidByID, NULL) != 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("virsh domuuid (by name)",
|
||||
testCompareDomuuidByName, NULL) != 0)
|
||||
if (virTestRun("virsh domuuid (by name)",
|
||||
testCompareDomuuidByName, NULL) != 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("virsh domname (by id)",
|
||||
testCompareDomnameByID, NULL) != 0)
|
||||
if (virTestRun("virsh domname (by id)",
|
||||
testCompareDomnameByID, NULL) != 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("virsh domname (by uuid)",
|
||||
testCompareDomnameByUUID, NULL) != 0)
|
||||
if (virTestRun("virsh domname (by uuid)",
|
||||
testCompareDomnameByUUID, NULL) != 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("virsh domstate (by id)",
|
||||
testCompareDomstateByID, NULL) != 0)
|
||||
if (virTestRun("virsh domstate (by id)",
|
||||
testCompareDomstateByID, NULL) != 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("virsh domstate (by uuid)",
|
||||
testCompareDomstateByUUID, NULL) != 0)
|
||||
if (virTestRun("virsh domstate (by uuid)",
|
||||
testCompareDomstateByUUID, NULL) != 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("virsh domstate (by name)",
|
||||
testCompareDomstateByName, NULL) != 0)
|
||||
if (virTestRun("virsh domstate (by name)",
|
||||
testCompareDomstateByName, NULL) != 0)
|
||||
ret = -1;
|
||||
|
||||
/* It's a bit awkward listing result before argument, but that's a
|
||||
@ -328,8 +328,8 @@ mymain(void)
|
||||
do { \
|
||||
const char *myargv[] = { VIRSH_DEFAULT, __VA_ARGS__, NULL }; \
|
||||
const struct testInfo info = { myargv, result }; \
|
||||
if (virtTestRun("virsh echo " #i, \
|
||||
testCompareEcho, &info) < 0) \
|
||||
if (virTestRun("virsh echo " #i, \
|
||||
testCompareEcho, &info) < 0) \
|
||||
ret = -1; \
|
||||
} while (0)
|
||||
|
||||
|
@ -693,8 +693,8 @@ mymain(void)
|
||||
for (i = 0; i < ARRAY_CARDINALITY(data.files); i++) \
|
||||
if (data.files[i]) \
|
||||
data.nfiles++; \
|
||||
if (virtTestRun(virtTestCounterNext(), \
|
||||
testStorageChain, &data) < 0) \
|
||||
if (virTestRun(virtTestCounterNext(), \
|
||||
testStorageChain, &data) < 0) \
|
||||
ret = -1; \
|
||||
} while (0)
|
||||
|
||||
@ -1051,8 +1051,8 @@ mymain(void)
|
||||
data2 = (struct testLookupData){ \
|
||||
chain, target, from, name, index, \
|
||||
result, meta, parent, }; \
|
||||
if (virtTestRun("Chain lookup " #id, \
|
||||
testStorageLookup, &data2) < 0) \
|
||||
if (virTestRun("Chain lookup " #id, \
|
||||
testStorageLookup, &data2) < 0) \
|
||||
ret = -1; \
|
||||
} while (0)
|
||||
#define TEST_LOOKUP(id, from, name, result, meta, parent) \
|
||||
@ -1190,8 +1190,8 @@ mymain(void)
|
||||
do { \
|
||||
data3.path = PATH; \
|
||||
data3.expect = EXPECT; \
|
||||
if (virtTestRun("Path canonicalize " #id, \
|
||||
testPathCanonicalize, &data3) < 0) \
|
||||
if (virTestRun("Path canonicalize " #id, \
|
||||
testPathCanonicalize, &data3) < 0) \
|
||||
ret = -1; \
|
||||
} while (0)
|
||||
|
||||
@ -1234,8 +1234,8 @@ mymain(void)
|
||||
data4.top = &TOP; \
|
||||
data4.base = &BASE; \
|
||||
data4.expect = EXPECT; \
|
||||
if (virtTestRun("Path relative resolve " #id, \
|
||||
testPathRelative, &data4) < 0) \
|
||||
if (virTestRun("Path relative resolve " #id, \
|
||||
testPathRelative, &data4) < 0) \
|
||||
ret = -1; \
|
||||
} while (0)
|
||||
|
||||
|
@ -590,9 +590,9 @@ mymain(void)
|
||||
.delim = del, \
|
||||
.tokens = toks, \
|
||||
}; \
|
||||
if (virtTestRun("Split " #str, testSplit, &splitData) < 0) \
|
||||
if (virTestRun("Split " #str, testSplit, &splitData) < 0) \
|
||||
ret = -1; \
|
||||
if (virtTestRun("Join " #str, testJoin, &joinData) < 0) \
|
||||
if (virTestRun("Join " #str, testJoin, &joinData) < 0) \
|
||||
ret = -1; \
|
||||
} while (0)
|
||||
|
||||
@ -620,27 +620,27 @@ mymain(void)
|
||||
const char *tokens8[] = { "gluster", "rdma", NULL };
|
||||
TEST_SPLIT("gluster+rdma", "+", 2, tokens8);
|
||||
|
||||
if (virtTestRun("strdup", testStrdup, NULL) < 0)
|
||||
if (virTestRun("strdup", testStrdup, NULL) < 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("strdup", testStrndupNegative, NULL) < 0)
|
||||
if (virTestRun("strdup", testStrndupNegative, NULL) < 0)
|
||||
ret = -1;
|
||||
|
||||
if (virtTestRun("virStringSortCompare", testStringSortCompare, NULL) < 0)
|
||||
if (virTestRun("virStringSortCompare", testStringSortCompare, NULL) < 0)
|
||||
ret = -1;
|
||||
|
||||
#define TEST_SEARCH(s, r, x, n, m, e) \
|
||||
do { \
|
||||
struct stringSearchData data = { \
|
||||
.str = s, \
|
||||
.maxMatches = x, \
|
||||
.regexp = r, \
|
||||
.expectNMatches = n, \
|
||||
.expectMatches = m, \
|
||||
.expectError = e, \
|
||||
}; \
|
||||
if (virtTestRun("virStringSearch " s, testStringSearch, &data) < 0) \
|
||||
ret = -1; \
|
||||
#define TEST_SEARCH(s, r, x, n, m, e) \
|
||||
do { \
|
||||
struct stringSearchData data = { \
|
||||
.str = s, \
|
||||
.maxMatches = x, \
|
||||
.regexp = r, \
|
||||
.expectNMatches = n, \
|
||||
.expectMatches = m, \
|
||||
.expectError = e, \
|
||||
}; \
|
||||
if (virTestRun("virStringSearch " s, testStringSearch, &data) < 0) \
|
||||
ret = -1; \
|
||||
} while (0)
|
||||
|
||||
/* error due to missing () in regexp */
|
||||
@ -664,16 +664,16 @@ mymain(void)
|
||||
const char *matches3[] = { "foo", "bar" };
|
||||
TEST_SEARCH("1foo2bar3eek", "([a-z]+)", 2, 2, matches3, false);
|
||||
|
||||
#define TEST_REPLACE(h, o, n, r) \
|
||||
do { \
|
||||
struct stringReplaceData data = { \
|
||||
.haystack = h, \
|
||||
.oldneedle = o, \
|
||||
.newneedle = n, \
|
||||
.result = r \
|
||||
}; \
|
||||
if (virtTestRun("virStringReplace " h, testStringReplace, &data) < 0) \
|
||||
ret = -1; \
|
||||
#define TEST_REPLACE(h, o, n, r) \
|
||||
do { \
|
||||
struct stringReplaceData data = { \
|
||||
.haystack = h, \
|
||||
.oldneedle = o, \
|
||||
.newneedle = n, \
|
||||
.result = r \
|
||||
}; \
|
||||
if (virTestRun("virStringReplace " h, testStringReplace, &data) < 0) \
|
||||
ret = -1; \
|
||||
} while (0)
|
||||
|
||||
/* no matches */
|
||||
@ -701,8 +701,8 @@ mymain(void)
|
||||
struct stringToLongData data = { \
|
||||
str, suff, i, i_ret, u, u_ret, ll, ll_ret, ull, ull_ret, \
|
||||
}; \
|
||||
if (virtTestRun("virStringToLong '" str "'", testStringToLong, \
|
||||
&data) < 0) \
|
||||
if (virTestRun("virStringToLong '" str "'", testStringToLong, \
|
||||
&data) < 0) \
|
||||
ret = -1; \
|
||||
} while (0)
|
||||
|
||||
@ -780,8 +780,8 @@ mymain(void)
|
||||
0LL, -1, 0ULL, -1);
|
||||
|
||||
/* test virStringFreeListCount */
|
||||
if (virtTestRun("virStringFreeListCount", testVirStringFreeListCount,
|
||||
NULL) < 0)
|
||||
if (virTestRun("virStringFreeListCount", testVirStringFreeListCount,
|
||||
NULL) < 0)
|
||||
ret = -1;
|
||||
|
||||
#define TEST_STRIP_IPV6_BRACKETS(str, res) \
|
||||
@ -790,8 +790,8 @@ mymain(void)
|
||||
.string = str, \
|
||||
.result = res, \
|
||||
}; \
|
||||
if (virtTestRun("Strip brackets from IPv6 " #str, \
|
||||
testStripIPv6Brackets, &stripData) < 0) \
|
||||
if (virTestRun("Strip brackets from IPv6 " #str, \
|
||||
testStripIPv6Brackets, &stripData) < 0) \
|
||||
ret = -1; \
|
||||
} while (0)
|
||||
|
||||
@ -809,8 +809,8 @@ mymain(void)
|
||||
.string = str, \
|
||||
.result = res, \
|
||||
}; \
|
||||
if (virtTestRun("Strip control chars from " #str, \
|
||||
testStripControlChars, &stripData) < 0) \
|
||||
if (virTestRun("Strip control chars from " #str, \
|
||||
testStripControlChars, &stripData) < 0) \
|
||||
ret = -1; \
|
||||
} while (0)
|
||||
|
||||
|
@ -518,24 +518,24 @@ mymain(void)
|
||||
if (virUUIDParse("c7a5fdbd-edaf-9455-926a-d65c16db1809", uuid) < 0)
|
||||
return EXIT_FAILURE;
|
||||
|
||||
if (virtTestRun("Test create container ", testCreateContainer, NULL) < 0)
|
||||
if (virTestRun("Test create container ", testCreateContainer, NULL) < 0)
|
||||
ret = -1;
|
||||
if (virtTestRun("Test terminate container ", testTerminateContainer, NULL) < 0)
|
||||
if (virTestRun("Test terminate container ", testTerminateContainer, NULL) < 0)
|
||||
ret = -1;
|
||||
if (virtTestRun("Test create machine ", testCreateMachine, NULL) < 0)
|
||||
if (virTestRun("Test create machine ", testCreateMachine, NULL) < 0)
|
||||
ret = -1;
|
||||
if (virtTestRun("Test terminate machine ", testTerminateMachine, NULL) < 0)
|
||||
if (virTestRun("Test terminate machine ", testTerminateMachine, NULL) < 0)
|
||||
ret = -1;
|
||||
if (virtTestRun("Test create no systemd ", testCreateNoSystemd, NULL) < 0)
|
||||
if (virTestRun("Test create no systemd ", testCreateNoSystemd, NULL) < 0)
|
||||
ret = -1;
|
||||
if (virtTestRun("Test create systemd not running ",
|
||||
testCreateSystemdNotRunning, NULL) < 0)
|
||||
if (virTestRun("Test create systemd not running ",
|
||||
testCreateSystemdNotRunning, NULL) < 0)
|
||||
ret = -1;
|
||||
if (virtTestRun("Test create bad systemd ", testCreateBadSystemd, NULL) < 0)
|
||||
if (virTestRun("Test create bad systemd ", testCreateBadSystemd, NULL) < 0)
|
||||
ret = -1;
|
||||
if (virtTestRun("Test create with network ", testCreateNetwork, NULL) < 0)
|
||||
if (virTestRun("Test create with network ", testCreateNetwork, NULL) < 0)
|
||||
ret = -1;
|
||||
if (virtTestRun("Test getting machine name ", testGetMachineName, NULL) < 0)
|
||||
if (virTestRun("Test getting machine name ", testGetMachineName, NULL) < 0)
|
||||
ret = -1;
|
||||
|
||||
# define TEST_SCOPE(_name, unitname, _legacy) \
|
||||
@ -543,7 +543,7 @@ mymain(void)
|
||||
struct testNameData data = { \
|
||||
.name = _name, .expected = unitname, .legacy = _legacy, \
|
||||
}; \
|
||||
if (virtTestRun("Test scopename", testScopeName, &data) < 0) \
|
||||
if (virTestRun("Test scopename", testScopeName, &data) < 0) \
|
||||
ret = -1; \
|
||||
} while (0)
|
||||
|
||||
@ -560,12 +560,12 @@ mymain(void)
|
||||
|
||||
TEST_SCOPE_NEW("qemu-3-demo", "machine-qemu\\x2d3\\x2ddemo.scope");
|
||||
|
||||
# define TEST_MACHINE(_name, _id, machinename) \
|
||||
# define TEST_MACHINE(_name, _id, machinename) \
|
||||
do { \
|
||||
struct testNameData data = { \
|
||||
.name = _name, .expected = machinename, .id = _id, \
|
||||
.name = _name, .expected = machinename, .id = _id, \
|
||||
}; \
|
||||
if (virtTestRun("Test scopename", testMachineName, &data) < 0) \
|
||||
if (virTestRun("Test scopename", testMachineName, &data) < 0) \
|
||||
ret = -1; \
|
||||
} while (0)
|
||||
|
||||
@ -580,19 +580,19 @@ mymain(void)
|
||||
TEST_MACHINE("123456789012345678901234567890123456789012345678901234567890", 8,
|
||||
"qemu-8-123456789012345678901234567890123456789012345678901234567");
|
||||
|
||||
# define TESTS_PM_SUPPORT_HELPER(name, function) \
|
||||
do { \
|
||||
struct testPMSupportData data = { \
|
||||
function \
|
||||
}; \
|
||||
if (virtTestRun("Test " name " ", testPMSupportHelper, &data) < 0) \
|
||||
ret = -1; \
|
||||
if (virtTestRun("Test " name " no systemd ", \
|
||||
testPMSupportHelperNoSystemd, &data) < 0) \
|
||||
ret = -1; \
|
||||
if (virtTestRun("Test systemd " name " not running ", \
|
||||
testPMSupportSystemdNotRunning, &data) < 0) \
|
||||
ret = -1; \
|
||||
# define TESTS_PM_SUPPORT_HELPER(name, function) \
|
||||
do { \
|
||||
struct testPMSupportData data = { \
|
||||
function \
|
||||
}; \
|
||||
if (virTestRun("Test " name " ", testPMSupportHelper, &data) < 0) \
|
||||
ret = -1; \
|
||||
if (virTestRun("Test " name " no systemd ", \
|
||||
testPMSupportHelperNoSystemd, &data) < 0) \
|
||||
ret = -1; \
|
||||
if (virTestRun("Test systemd " name " not running ", \
|
||||
testPMSupportSystemdNotRunning, &data) < 0) \
|
||||
ret = -1; \
|
||||
} while (0)
|
||||
|
||||
TESTS_PM_SUPPORT_HELPER("canSuspend", &virSystemdCanSuspend);
|
||||
|
@ -128,24 +128,24 @@ mymain(void)
|
||||
|
||||
signal(SIGPIPE, SIG_IGN);
|
||||
|
||||
#define TEST_FIELDS(ts, year, mon, day, hour, min, sec) \
|
||||
do { \
|
||||
struct testTimeFieldsData data = { \
|
||||
.when = ts, \
|
||||
.fields = { \
|
||||
.tm_year = year, \
|
||||
.tm_mon = mon, \
|
||||
.tm_mday = day, \
|
||||
.tm_hour = hour, \
|
||||
.tm_min = min, \
|
||||
.tm_sec = sec, \
|
||||
.tm_wday = 0, \
|
||||
.tm_yday = 0, \
|
||||
.tm_isdst = 0, \
|
||||
}, \
|
||||
}; \
|
||||
if (virtTestRun("Test fields " #ts " " #year " ", testTimeFields, &data) < 0) \
|
||||
ret = -1; \
|
||||
#define TEST_FIELDS(ts, year, mon, day, hour, min, sec) \
|
||||
do { \
|
||||
struct testTimeFieldsData data = { \
|
||||
.when = ts, \
|
||||
.fields = { \
|
||||
.tm_year = year, \
|
||||
.tm_mon = mon, \
|
||||
.tm_mday = day, \
|
||||
.tm_hour = hour, \
|
||||
.tm_min = min, \
|
||||
.tm_sec = sec, \
|
||||
.tm_wday = 0, \
|
||||
.tm_yday = 0, \
|
||||
.tm_isdst = 0, \
|
||||
}, \
|
||||
}; \
|
||||
if (virTestRun("Test fields " #ts " " #year " ", testTimeFields, &data) < 0) \
|
||||
ret = -1; \
|
||||
} while (0)
|
||||
|
||||
TEST_FIELDS(0ull, 1970, 1, 1, 0, 0, 0);
|
||||
@ -168,15 +168,15 @@ mymain(void)
|
||||
|
||||
TEST_FIELDS(2147483648000ull, 2038, 1, 19, 3, 14, 8);
|
||||
|
||||
#define TEST_LOCALOFFSET(tz, off) \
|
||||
do { \
|
||||
testTimeLocalOffsetData data = { \
|
||||
.zone = tz, \
|
||||
.offset = off, \
|
||||
}; \
|
||||
if (virtTestRun("Test localtime offset for " #tz, \
|
||||
testTimeLocalOffset, &data) < 0) \
|
||||
ret = -1; \
|
||||
#define TEST_LOCALOFFSET(tz, off) \
|
||||
do { \
|
||||
testTimeLocalOffsetData data = { \
|
||||
.zone = tz, \
|
||||
.offset = off, \
|
||||
}; \
|
||||
if (virTestRun("Test localtime offset for " #tz, \
|
||||
testTimeLocalOffset, &data) < 0) \
|
||||
ret = -1; \
|
||||
} while (0)
|
||||
|
||||
TEST_LOCALOFFSET("VIR00:30", -30 * 60);
|
||||
|
@ -278,7 +278,7 @@ testTypedParamsValidator(void)
|
||||
};
|
||||
|
||||
for (i = 0; test[i].name; ++i) {
|
||||
if (virtTestRun(test[i].name, testTypedParamsValidate, &test[i]) < 0)
|
||||
if (virTestRun(test[i].name, testTypedParamsValidate, &test[i]) < 0)
|
||||
rv = -1;
|
||||
}
|
||||
|
||||
@ -293,13 +293,13 @@ mymain(void)
|
||||
if (testTypedParamsValidator() < 0)
|
||||
rv = -1;
|
||||
|
||||
if (virtTestRun("Filtering", testTypedParamsFilter, NULL) < 0)
|
||||
if (virTestRun("Filtering", testTypedParamsFilter, NULL) < 0)
|
||||
rv = -1;
|
||||
|
||||
if (virtTestRun("Get All Strings", testTypedParamsGetStringList, NULL) < 0)
|
||||
if (virTestRun("Get All Strings", testTypedParamsGetStringList, NULL) < 0)
|
||||
rv = -1;
|
||||
|
||||
if (virtTestRun("Add string list", testTypedParamsAddStringList, NULL) < 0)
|
||||
if (virTestRun("Add string list", testTypedParamsAddStringList, NULL) < 0)
|
||||
rv = -1;
|
||||
|
||||
if (rv < 0)
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user