1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-03-20 07:59:00 +00:00

tests: bhyve: remove unnecessary labels

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
Reviewed-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
This commit is contained in:
Ján Tomko 2020-07-28 02:58:58 +02:00
parent aeb5951aa4
commit 7f9b214711
2 changed files with 12 additions and 21 deletions

View File

@ -31,11 +31,10 @@ testCompareXMLToArgvFiles(const char *xmlfile,
g_autofree char *actualxml = NULL; g_autofree char *actualxml = NULL;
g_autofree char *cmd = NULL; g_autofree char *cmd = NULL;
g_autofree char *log = NULL; g_autofree char *log = NULL;
int ret = -1;
g_autoptr(virDomainDef) vmdef = NULL; g_autoptr(virDomainDef) vmdef = NULL;
if (virTestLoadFile(cmdfile, &cmd) < 0) if (virTestLoadFile(cmdfile, &cmd) < 0)
goto fail; return -1;
if (!(vmdef = bhyveParseCommandLineString(cmd, driver.bhyvecaps, if (!(vmdef = bhyveParseCommandLineString(cmd, driver.bhyvecaps,
driver.xmlopt))) { driver.xmlopt))) {
@ -43,16 +42,16 @@ testCompareXMLToArgvFiles(const char *xmlfile,
VIR_TEST_DEBUG("Got expected failure from " VIR_TEST_DEBUG("Got expected failure from "
"bhyveParseCommandLineString."); "bhyveParseCommandLineString.");
} else { } else {
goto fail; return -1;
} }
} else if ((flags & FLAG_EXPECT_FAILURE)) { } else if ((flags & FLAG_EXPECT_FAILURE)) {
VIR_TEST_DEBUG("Did not get expected failure from " VIR_TEST_DEBUG("Did not get expected failure from "
"bhyveParseCommandLineString."); "bhyveParseCommandLineString.");
goto fail; return -1;
} }
if ((log = virTestLogContentAndReset()) == NULL) if ((log = virTestLogContentAndReset()) == NULL)
goto fail; return -1;
if (flags & FLAG_EXPECT_WARNING) { if (flags & FLAG_EXPECT_WARNING) {
if (*log) { if (*log) {
VIR_TEST_DEBUG("Got expected warning from " VIR_TEST_DEBUG("Got expected warning from "
@ -61,32 +60,29 @@ testCompareXMLToArgvFiles(const char *xmlfile,
} else { } else {
VIR_TEST_DEBUG("bhyveParseCommandLineString " VIR_TEST_DEBUG("bhyveParseCommandLineString "
"should have logged a warning"); "should have logged a warning");
goto fail; return -1;
} }
} else { /* didn't expect a warning */ } else { /* didn't expect a warning */
if (*log) { if (*log) {
VIR_TEST_DEBUG("Got unexpected warning from " VIR_TEST_DEBUG("Got unexpected warning from "
"bhyveParseCommandLineString:\n%s", "bhyveParseCommandLineString:\n%s",
log); log);
goto fail; return -1;
} }
} }
if (vmdef && !virDomainDefCheckABIStability(vmdef, vmdef, driver.xmlopt)) { if (vmdef && !virDomainDefCheckABIStability(vmdef, vmdef, driver.xmlopt)) {
VIR_TEST_DEBUG("ABI stability check failed on %s", xmlfile); VIR_TEST_DEBUG("ABI stability check failed on %s", xmlfile);
goto fail; return -1;
} }
if (vmdef && !(actualxml = virDomainDefFormat(vmdef, driver.xmlopt, 0))) if (vmdef && !(actualxml = virDomainDefFormat(vmdef, driver.xmlopt, 0)))
goto fail; return -1;
if (vmdef && virTestCompareToFile(actualxml, xmlfile) < 0) if (vmdef && virTestCompareToFile(actualxml, xmlfile) < 0)
goto fail; return -1;
ret = 0; return 0;
fail:
return ret;
} }
struct testInfo { struct testInfo {
@ -97,7 +93,6 @@ struct testInfo {
static int static int
testCompareXMLToArgvHelper(const void *data) testCompareXMLToArgvHelper(const void *data)
{ {
int result = -1;
const struct testInfo *info = data; const struct testInfo *info = data;
g_autofree char *xml = NULL; g_autofree char *xml = NULL;
g_autofree char *args = NULL; g_autofree char *args = NULL;
@ -107,8 +102,7 @@ testCompareXMLToArgvHelper(const void *data)
args = g_strdup_printf("%s/bhyveargv2xmldata/bhyveargv2xml-%s.args", args = g_strdup_printf("%s/bhyveargv2xmldata/bhyveargv2xml-%s.args",
abs_srcdir, info->name); abs_srcdir, info->name);
result = testCompareXMLToArgvFiles(xml, args, info->flags); return testCompareXMLToArgvFiles(xml, args, info->flags);
return result;
} }
static int static int

View File

@ -110,7 +110,6 @@ struct testInfo {
static int static int
testCompareXMLToArgvHelper(const void *data) testCompareXMLToArgvHelper(const void *data)
{ {
int ret = -1;
const struct testInfo *info = data; const struct testInfo *info = data;
g_autofree char *xml = NULL; g_autofree char *xml = NULL;
g_autofree char *args = NULL; g_autofree char *args = NULL;
@ -126,9 +125,7 @@ testCompareXMLToArgvHelper(const void *data)
dmargs = g_strdup_printf("%s/bhyvexml2argvdata/bhyvexml2argv-%s.devmap", dmargs = g_strdup_printf("%s/bhyvexml2argvdata/bhyvexml2argv-%s.devmap",
abs_srcdir, info->name); abs_srcdir, info->name);
ret = testCompareXMLToArgvFiles(xml, args, ldargs, dmargs, info->flags); return testCompareXMLToArgvFiles(xml, args, ldargs, dmargs, info->flags);
return ret;
} }
static int static int