]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virstoragetest: Use existing directory in the source tree for 'directory' probing...
authorPeter Krempa <pkrempa@redhat.com>
Wed, 8 Sep 2021 07:03:06 +0000 (09:03 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Thu, 9 Sep 2021 13:29:00 +0000 (15:29 +0200)
We don't need a special directory for the tests. Reuse the directory
holding the data for the virstoragetest.

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

index 785699d4e84bb1963d0abe89b6ec639288b7ba85..37362806118e8608a84ca3dfec671a2d3a6a7077 100644 (file)
@@ -56,7 +56,6 @@ static char *absraw;
 static char *absqcow2;
 static char *abswrap;
 static char *absqed;
-static char *absdir;
 static char *abslink2;
 
 static void
@@ -67,7 +66,6 @@ testCleanupImages(void)
     VIR_FREE(absqcow2);
     VIR_FREE(abswrap);
     VIR_FREE(absqed);
-    VIR_FREE(absdir);
     VIR_FREE(abslink2);
 
     if (chdir(abs_builddir) < 0) {
@@ -139,17 +137,12 @@ testPrepImages(void)
     absqcow2 = g_strdup_printf("%s/qcow2", datadir);
     abswrap = g_strdup_printf("%s/wrap", datadir);
     absqed = g_strdup_printf("%s/qed", datadir);
-    absdir = g_strdup_printf("%s/dir", datadir);
     abslink2 = g_strdup_printf("%s/sub/link2", datadir);
 
     if (g_mkdir_with_parents(datadir "/sub", 0777) < 0) {
         fprintf(stderr, "unable to create directory %s\n", datadir "/sub");
         goto cleanup;
     }
-    if (g_mkdir_with_parents(datadir "/dir", 0777) < 0) {
-        fprintf(stderr, "unable to create directory %s\n", datadir "/dir");
-        goto cleanup;
-    }
 
     if (chdir(datadir) < 0) {
         fprintf(stderr, "unable to test relative backing chains\n");
@@ -573,9 +566,9 @@ mymain(void)
     TEST_CHAIN("qed-auto_raw", absqed, VIR_STORAGE_FILE_AUTO, EXP_PASS);
 
     /* directory */
-    TEST_CHAIN("directory-raw", absdir, VIR_STORAGE_FILE_RAW, EXP_PASS);
-    TEST_CHAIN("directory-none", absdir, VIR_STORAGE_FILE_NONE, EXP_PASS);
-    TEST_CHAIN("directory-dir", absdir, VIR_STORAGE_FILE_DIR, EXP_PASS);
+    TEST_CHAIN("directory-raw", abs_srcdir "/virstoragetestdata/images/", VIR_STORAGE_FILE_RAW, EXP_PASS);
+    TEST_CHAIN("directory-none", abs_srcdir "/virstoragetestdata/images/", VIR_STORAGE_FILE_NONE, EXP_PASS);
+    TEST_CHAIN("directory-dir", abs_srcdir "/virstoragetestdata/images/", VIR_STORAGE_FILE_DIR, EXP_PASS);
 
 #ifdef WITH_SYMLINK
     /* Rewrite qcow2 and wrap file to use backing names relative to a
index cff67595b4d112273157ece84d51dc8b463089fb..65b7b919126cf8713edf778435be38402a2f9355 100644 (file)
@@ -1,4 +1,4 @@
-path:ABS_BUILDDIR/virstoragedata/dir
+path:ABS_SRCDIR/virstoragetestdata/images/
 backingStoreRaw: <null>
 capacity: 0
 encryption: 0
index cff67595b4d112273157ece84d51dc8b463089fb..65b7b919126cf8713edf778435be38402a2f9355 100644 (file)
@@ -1,4 +1,4 @@
-path:ABS_BUILDDIR/virstoragedata/dir
+path:ABS_SRCDIR/virstoragetestdata/images/
 backingStoreRaw: <null>
 capacity: 0
 encryption: 0
index ebe23cbbd615028e56664fa3e9011d161bc3be27..5def2c4b8b9dc3e5f4674f9f8a475231860ea251 100644 (file)
@@ -1,4 +1,4 @@
-path:ABS_BUILDDIR/virstoragedata/dir
+path:ABS_SRCDIR/virstoragetestdata/images/
 backingStoreRaw: <null>
 capacity: 0
 encryption: 0