mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-21 20:15:17 +00:00
tests: qemuxml2argv: Add infrastructure to pass output file suffix
To allow having more than one output file in the qemuxml2argvtest add a suffix member to the testInfo struct which will allow testing the same XML file with multiple capabilities files. Signed-off-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
parent
e831821cbc
commit
f4f7d0da8b
@ -270,6 +270,7 @@ typedef enum {
|
||||
|
||||
struct testInfo {
|
||||
const char *name;
|
||||
const char *suffix;
|
||||
virQEMUCapsPtr qemuCaps;
|
||||
const char *migrateFrom;
|
||||
int migrateFd;
|
||||
@ -442,6 +443,7 @@ testCompareXMLToArgv(const void *data)
|
||||
char *args = NULL;
|
||||
char *migrateURI = NULL;
|
||||
char *actualargv = NULL;
|
||||
const char *suffix = info->suffix;
|
||||
unsigned int flags = info->flags;
|
||||
unsigned int parseFlags = info->parseFlags;
|
||||
int ret = -1;
|
||||
@ -458,6 +460,9 @@ testCompareXMLToArgv(const void *data)
|
||||
if (!(conn = virGetConnect()))
|
||||
goto cleanup;
|
||||
|
||||
if (!suffix)
|
||||
suffix = "";
|
||||
|
||||
conn->secretDriver = &fakeSecretDriver;
|
||||
conn->storageDriver = &fakeStorageDriver;
|
||||
|
||||
@ -472,8 +477,8 @@ testCompareXMLToArgv(const void *data)
|
||||
|
||||
if (virAsprintf(&xml, "%s/qemuxml2argvdata/%s.xml",
|
||||
abs_srcdir, info->name) < 0 ||
|
||||
virAsprintf(&args, "%s/qemuxml2argvdata/%s.args",
|
||||
abs_srcdir, info->name) < 0)
|
||||
virAsprintf(&args, "%s/qemuxml2argvdata/%s%s.args",
|
||||
abs_srcdir, info->name, suffix) < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (info->migrateFrom &&
|
||||
@ -657,7 +662,7 @@ mymain(void)
|
||||
parseFlags, gic, ...) \
|
||||
do { \
|
||||
static struct testInfo info = { \
|
||||
name, NULL, migrateFrom, migrateFd, (flags), parseFlags, \
|
||||
name, NULL, NULL, migrateFrom, migrateFd, (flags), parseFlags, \
|
||||
false, NULL \
|
||||
}; \
|
||||
info.skipLegacyCPUs = skipLegacyCPUs; \
|
||||
|
Loading…
x
Reference in New Issue
Block a user