]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
networkxml2firewalltest: Use internal wrapping of command line arguments
authorPeter Krempa <pkrempa@redhat.com>
Wed, 31 Mar 2021 08:46:36 +0000 (10:46 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 12 Apr 2021 13:55:10 +0000 (15:55 +0200)
virCommandSetDryRun allows to invoke virCommandToString so that the
command string is already wrapped.

We now also need to load the base arguments file without unwrapping the
arguments.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
tests/networkxml2firewalltest.c

index 16249c49fdaa1651bf8f483d060b6f2e51f53210..60cd79eeb2cba9cac9df53ca2965d60ce1a34db7 100644 (file)
@@ -98,7 +98,7 @@ static int testCompareXMLToArgvFiles(const char *xml,
     char *actual;
     g_autoptr(virCommandDryRunToken) dryRunToken = virCommandDryRunTokenNew();
 
-    virCommandSetDryRun(dryRunToken, &buf, false, true, testCommandDryRun, NULL);
+    virCommandSetDryRun(dryRunToken, &buf, true, true, testCommandDryRun, NULL);
 
     if (!(def = virNetworkDefParseFile(xml, NULL)))
         goto cleanup;
@@ -115,7 +115,7 @@ static int testCompareXMLToArgvFiles(const char *xml,
     if (STRPREFIX(actual, baseargs))
         actual += strlen(baseargs);
 
-    if (virTestCompareToFile(actual, cmdline) < 0)
+    if (virTestCompareToFileFull(actual, cmdline, false) < 0)
         goto cleanup;
 
     ret = 0;
@@ -189,7 +189,7 @@ mymain(void)
 
     basefile = g_strdup_printf("%s/networkxml2firewalldata/base.args", abs_srcdir);
 
-    if (virTestLoadFile(basefile, &baseargs) < 0)
+    if (virFileReadAll(basefile, INT_MAX, &baseargs) < 0)
         return EXIT_FAILURE;
 
     DO_TEST("nat-default");