]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virstoragetest: Remove pointless goto from mymain
authorPeter Krempa <pkrempa@redhat.com>
Thu, 9 Sep 2021 07:53:30 +0000 (09:53 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Thu, 9 Sep 2021 13:29:00 +0000 (15:29 +0200)
Improve the error message and abort the test. Continuing here is not
desired as without chdiring into the appropriate directory the test
would fail anyways and worse could attempt stat-ing random files on the
host.

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

index bbeb5ecd88a88fbe5b34a49d36d508aaab229e70..513ffdeb41ce5d05c3e98cc7fac9b758a3833247 100644 (file)
@@ -502,8 +502,9 @@ mymain(void)
 
     /* setup data for backing chain lookup testing */
     if (chdir(abs_srcdir "/virstoragetestdata/lookup") < 0) {
-        fprintf(stderr, "unable to test relative backing chains\n");
-        goto cleanup;
+        VIR_TEST_VERBOSE("failed to chdir into '%s'\n",
+                         abs_srcdir "/virstoragetestdata/lookup");
+        return EXIT_FAILURE;
     }
 
     memset(fakeChain, 0, sizeof(fakeChain));
@@ -1171,7 +1172,6 @@ mymain(void)
 
 #endif /* WITH_YAJL */
 
- cleanup:
     return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
 }