[PATCH 09/24] virstoragetest: Use a pre-formatted QED file for testing backing store extraction

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

 



The QED format isn't really being developed any more. Use a
pre-formatted image to test the existing code. In this instance we
switch to using a relative backing path for simplicity.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 tests/virstoragetest.c                        |  21 +++++-------------
 .../images/qed_raw-raw-relative               | Bin 0 -> 327680 bytes
 tests/virstoragetestdata/images/raw           | Bin 0 -> 1024 bytes
 tests/virstoragetestdata/out/qed-auto_raw     |   2 +-
 tests/virstoragetestdata/out/qed-qed_raw      |   8 +++----
 5 files changed, 11 insertions(+), 20 deletions(-)
 create mode 100644 tests/virstoragetestdata/images/qed_raw-raw-relative
 create mode 100644 tests/virstoragetestdata/images/raw

diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c
index 3736280611..96aeaef9ce 100644
--- a/tests/virstoragetest.c
+++ b/tests/virstoragetest.c
@@ -42,7 +42,6 @@ VIR_LOG_INIT("tests.storagetest");
  * raw: 1024-byte raw file
  * qcow2: qcow2 file with 'raw' as backing
  * wrap: qcow2 file with 'qcow2' as backing
- * qed: qed file with 'raw' as backing
  * sub/link1: symlink to qcow2
  * sub/link2: symlink to wrap
  *
@@ -55,7 +54,6 @@ static char *qemuimg;
 static char *absraw;
 static char *absqcow2;
 static char *abswrap;
-static char *absqed;
 static char *abslink2;

 static void
@@ -65,7 +63,6 @@ testCleanupImages(void)
     VIR_FREE(absraw);
     VIR_FREE(absqcow2);
     VIR_FREE(abswrap);
-    VIR_FREE(absqed);
     VIR_FREE(abslink2);

     if (chdir(abs_builddir) < 0) {
@@ -136,7 +133,6 @@ testPrepImages(void)
     absraw = g_strdup_printf("%s/raw", datadir);
     absqcow2 = g_strdup_printf("%s/qcow2", datadir);
     abswrap = g_strdup_printf("%s/wrap", datadir);
-    absqed = g_strdup_printf("%s/qed", datadir);
     abslink2 = g_strdup_printf("%s/sub/link2", datadir);

     if (g_mkdir_with_parents(datadir "/sub", 0777) < 0) {
@@ -181,15 +177,6 @@ testPrepImages(void)
     if (virCommandRun(cmd, NULL) < 0)
         goto skip;

-    /* Create a qed file. */
-    virCommandFree(cmd);
-    cmd = virCommandNewArgList(qemuimg, "create", "-f", "qed", NULL);
-    virCommandAddArgFormat(cmd, "-obacking_file=%s,backing_fmt=raw",
-                           absraw);
-    virCommandAddArg(cmd, "qed");
-    if (virCommandRun(cmd, NULL) < 0)
-        goto skip;
-
 #ifdef WITH_SYMLINK
     /* Create some symlinks in a sub-directory. */
     if (symlink("../qcow2", datadir "/sub/link1") < 0 ||
@@ -562,8 +549,12 @@ mymain(void)
     TEST_CHAIN("qcow2-qcow2_nbd-raw", absqcow2, VIR_STORAGE_FILE_QCOW2, EXP_PASS);

     /* qed file */
-    TEST_CHAIN("qed-qed_raw", absqed, VIR_STORAGE_FILE_QED, EXP_PASS);
-    TEST_CHAIN("qed-auto_raw", absqed, VIR_STORAGE_FILE_AUTO, EXP_PASS);
+    TEST_CHAIN("qed-qed_raw",
+               abs_srcdir "/virstoragetestdata/images/qed_raw-raw-relative",
+               VIR_STORAGE_FILE_QED, EXP_PASS);
+    TEST_CHAIN("qed-auto_raw",
+               abs_srcdir "/virstoragetestdata/images/qed_raw-raw-relative",
+               VIR_STORAGE_FILE_AUTO, EXP_PASS);

     /* directory */
     TEST_CHAIN("directory-raw", abs_srcdir "/virstoragetestdata/images/", VIR_STORAGE_FILE_RAW, EXP_PASS);
diff --git a/tests/virstoragetestdata/images/qed_raw-raw-relative b/tests/virstoragetestdata/images/qed_raw-raw-relative
new file mode 100644
index 0000000000000000000000000000000000000000..5c91c3fcfe3dc4f25455bafada27b9c95c28c6e7
GIT binary patch
literal 327680
zcmeIuu?>JQ3<SWBAbU~30F1y2X;>cvEfb)7>21k!b^Ep^X_=py^xEHP@A-bLEY+zx
zj<co^AV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+
z009C72oNAZfB*p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XF5FkK+009C72oNAZfB*pk1PBlyK!5-N
z0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+
z009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBly
zK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF
z5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk
z1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs
z0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZ
zfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&U
zAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C7
z2oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N
g0t5&UAV7cs0RjXF5FkK+009C72oNAZfWY4bE>vg&cmMzZ

literal 0
HcmV?d00001

diff --git a/tests/virstoragetestdata/images/raw b/tests/virstoragetestdata/images/raw
new file mode 100644
index 0000000000000000000000000000000000000000..06d7405020018ddf3cacee90fd4af10487da3d20
GIT binary patch
literal 1024
ScmZQz7zLvtFd70QH3R?z00031

literal 0
HcmV?d00001

diff --git a/tests/virstoragetestdata/out/qed-auto_raw b/tests/virstoragetestdata/out/qed-auto_raw
index e8ab498038..292a8fa7fb 100644
--- a/tests/virstoragetestdata/out/qed-auto_raw
+++ b/tests/virstoragetestdata/out/qed-auto_raw
@@ -1,4 +1,4 @@
-path:ABS_BUILDDIR/virstoragedata/qed
+path:ABS_SRCDIR/virstoragetestdata/images/qed_raw-raw-relative
 backingStoreRaw: <null>
 capacity: 0
 encryption: 0
diff --git a/tests/virstoragetestdata/out/qed-qed_raw b/tests/virstoragetestdata/out/qed-qed_raw
index 70a75c4e37..043ec4240b 100644
--- a/tests/virstoragetestdata/out/qed-qed_raw
+++ b/tests/virstoragetestdata/out/qed-qed_raw
@@ -1,5 +1,5 @@
-path:ABS_BUILDDIR/virstoragedata/qed
-backingStoreRaw: ABS_BUILDDIR/virstoragedata/raw
+path:ABS_SRCDIR/virstoragetestdata/images/qed_raw-raw-relative
+backingStoreRaw: raw
 capacity: 1024
 encryption: 0
 relPath:<null>
@@ -8,11 +8,11 @@ format:15
 protocol:none
 hostname:<null>

-path:ABS_BUILDDIR/virstoragedata/raw
+path:ABS_SRCDIR/virstoragetestdata/images/raw
 backingStoreRaw: <null>
 capacity: 0
 encryption: 0
-relPath:<null>
+relPath:raw
 type:1
 format:1
 protocol:none
-- 
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