[PATCH 23/24] virstoragetest: Remove pointless goto from mymain

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 tests/virstoragetest.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c
index bbeb5ecd88..513ffdeb41 100644
--- a/tests/virstoragetest.c
+++ b/tests/virstoragetest.c
@@ -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;
 }

-- 
2.31.1




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux