tests: vir: remove pointless labels

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
This commit is contained in:
Ján Tomko
2021-09-04 22:41:36 +02:00
parent cfef887893
commit 2ef57217f8
15 changed files with 108 additions and 216 deletions

View File

@@ -34,30 +34,25 @@
static int
checkOutput(virBuffer *buf, const char *exp_cmd)
{
int ret = -1;
g_autofree char *actual_cmd = NULL;
if (!(actual_cmd = virBufferContentAndReset(buf))) {
fprintf(stderr, "cannot compare buffer to exp: %s", exp_cmd);
goto cleanup;
return -1;
}
if (STRNEQ(exp_cmd, actual_cmd)) {
virTestDifference(stderr, exp_cmd, actual_cmd);
goto cleanup;
return -1;
}
ret = 0;
cleanup:
return ret;
return 0;
}
static int
testKModLoad(const void *args G_GNUC_UNUSED)
{
int ret = -1;
g_autofree char *errbuf = NULL;
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
g_autoptr(virCommandDryRunToken) dryRunToken = virCommandDryRunTokenNew();
@@ -67,23 +62,19 @@ testKModLoad(const void *args G_GNUC_UNUSED)
errbuf = virKModLoad(MODNAME);
if (errbuf) {
fprintf(stderr, "Failed to load, error: %s\n", errbuf);
goto cleanup;
return -1;
}
if (checkOutput(&buf, MODPROBE " -b " MODNAME "\n") < 0)
goto cleanup;
return -1;
ret = 0;
cleanup:
return ret;
return 0;
}
static int
testKModUnload(const void *args G_GNUC_UNUSED)
{
int ret = -1;
g_autofree char *errbuf = NULL;
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
g_autoptr(virCommandDryRunToken) dryRunToken = virCommandDryRunTokenNew();
@@ -93,16 +84,13 @@ testKModUnload(const void *args G_GNUC_UNUSED)
errbuf = virKModUnload(MODNAME);
if (errbuf) {
fprintf(stderr, "Failed to unload, error: %s\n", errbuf);
goto cleanup;
return -1;
}
if (checkOutput(&buf, RMMOD " " MODNAME "\n") < 0)
goto cleanup;
return -1;
ret = 0;
cleanup:
return ret;
return 0;
}