[PATCH 08/24] virstoragetest: Use existing directory in the source tree for 'directory' probing tests

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

 



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@xxxxxxxxxx>
---
 tests/virstoragetest.c                      | 13 +++----------
 tests/virstoragetestdata/out/directory-dir  |  2 +-
 tests/virstoragetestdata/out/directory-none |  2 +-
 tests/virstoragetestdata/out/directory-raw  |  2 +-
 4 files changed, 6 insertions(+), 13 deletions(-)

diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c
index 785699d4e8..3736280611 100644
--- a/tests/virstoragetest.c
+++ b/tests/virstoragetest.c
@@ -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
diff --git a/tests/virstoragetestdata/out/directory-dir b/tests/virstoragetestdata/out/directory-dir
index cff67595b4..65b7b91912 100644
--- a/tests/virstoragetestdata/out/directory-dir
+++ b/tests/virstoragetestdata/out/directory-dir
@@ -1,4 +1,4 @@
-path:ABS_BUILDDIR/virstoragedata/dir
+path:ABS_SRCDIR/virstoragetestdata/images/
 backingStoreRaw: <null>
 capacity: 0
 encryption: 0
diff --git a/tests/virstoragetestdata/out/directory-none b/tests/virstoragetestdata/out/directory-none
index cff67595b4..65b7b91912 100644
--- a/tests/virstoragetestdata/out/directory-none
+++ b/tests/virstoragetestdata/out/directory-none
@@ -1,4 +1,4 @@
-path:ABS_BUILDDIR/virstoragedata/dir
+path:ABS_SRCDIR/virstoragetestdata/images/
 backingStoreRaw: <null>
 capacity: 0
 encryption: 0
diff --git a/tests/virstoragetestdata/out/directory-raw b/tests/virstoragetestdata/out/directory-raw
index ebe23cbbd6..5def2c4b8b 100644
--- a/tests/virstoragetestdata/out/directory-raw
+++ b/tests/virstoragetestdata/out/directory-raw
@@ -1,4 +1,4 @@
-path:ABS_BUILDDIR/virstoragedata/dir
+path:ABS_SRCDIR/virstoragetestdata/images/
 backingStoreRaw: <null>
 capacity: 0
 encryption: 0
-- 
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