mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
tests: Integrate startup checks to qemuxml2argvtest
Some of the tests that are not a part of qemuBuildCommandLine were not executed in the test suite. We can now reuse qemuProcessStartValidate to integrate these tests.
This commit is contained in:
parent
c07bc2cc7d
commit
6d04f0592e
@ -18,6 +18,7 @@
|
|||||||
# include "qemu/qemu_command.h"
|
# include "qemu/qemu_command.h"
|
||||||
# include "qemu/qemu_domain.h"
|
# include "qemu/qemu_domain.h"
|
||||||
# include "qemu/qemu_migration.h"
|
# include "qemu/qemu_migration.h"
|
||||||
|
# include "qemu/qemu_process.h"
|
||||||
# include "datatypes.h"
|
# include "datatypes.h"
|
||||||
# include "conf/storage_conf.h"
|
# include "conf/storage_conf.h"
|
||||||
# include "cpu/cpu_map.h"
|
# include "cpu/cpu_map.h"
|
||||||
@ -262,6 +263,7 @@ static int testCompareXMLToArgvFiles(const char *xml,
|
|||||||
virCommandPtr cmd = NULL;
|
virCommandPtr cmd = NULL;
|
||||||
size_t i;
|
size_t i;
|
||||||
virBitmapPtr nodeset = NULL;
|
virBitmapPtr nodeset = NULL;
|
||||||
|
bool testFailed = false;
|
||||||
|
|
||||||
if (!(conn = virGetConnect()))
|
if (!(conn = virGetConnect()))
|
||||||
goto out;
|
goto out;
|
||||||
@ -339,13 +341,20 @@ static int testCompareXMLToArgvFiles(const char *xml,
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(cmd = qemuBuildCommandLine(conn, &driver, vmdef, &monitor_chr,
|
if (qemuProcessStartValidate(vmdef, extraFlags, !!migrateURI, false) < 0)
|
||||||
|
testFailed = true;
|
||||||
|
|
||||||
|
if (!testFailed &&
|
||||||
|
!(cmd = qemuBuildCommandLine(conn, &driver, vmdef, &monitor_chr,
|
||||||
(flags & FLAG_JSON), extraFlags,
|
(flags & FLAG_JSON), extraFlags,
|
||||||
migrateURI, NULL,
|
migrateURI, NULL,
|
||||||
VIR_NETDEV_VPORT_PROFILE_OP_NO_OP,
|
VIR_NETDEV_VPORT_PROFILE_OP_NO_OP,
|
||||||
&testCallbacks, false,
|
&testCallbacks, false,
|
||||||
(flags & FLAG_FIPS),
|
(flags & FLAG_FIPS),
|
||||||
nodeset, NULL, NULL))) {
|
nodeset, NULL, NULL)))
|
||||||
|
testFailed = true;
|
||||||
|
|
||||||
|
if (testFailed) {
|
||||||
if (!virtTestOOMActive() &&
|
if (!virtTestOOMActive() &&
|
||||||
(flags & FLAG_EXPECT_FAILURE)) {
|
(flags & FLAG_EXPECT_FAILURE)) {
|
||||||
ret = 0;
|
ret = 0;
|
||||||
@ -355,7 +364,8 @@ static int testCompareXMLToArgvFiles(const char *xml,
|
|||||||
}
|
}
|
||||||
goto out;
|
goto out;
|
||||||
} else if (flags & FLAG_EXPECT_FAILURE) {
|
} else if (flags & FLAG_EXPECT_FAILURE) {
|
||||||
VIR_TEST_DEBUG("qemuBuildCommandLine should have failed\n");
|
VIR_TEST_DEBUG("qemuBuildCommandLine or qemuProcessStartValidate "
|
||||||
|
"should have failed\n");
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user