]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virstoragetest: Use a pre-formatted QED file for testing backing store extraction
authorPeter Krempa <pkrempa@redhat.com>
Wed, 8 Sep 2021 07:06:08 +0000 (09:06 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Thu, 9 Sep 2021 13:29:00 +0000 (15:29 +0200)
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@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
tests/virstoragetest.c
tests/virstoragetestdata/images/qed_raw-raw-relative [new file with mode: 0644]
tests/virstoragetestdata/images/raw [new file with mode: 0644]
tests/virstoragetestdata/out/qed-auto_raw
tests/virstoragetestdata/out/qed-qed_raw

index 37362806118e8608a84ca3dfec671a2d3a6a7077..96aeaef9ceccdae3a96777846961034bb9e50e9d 100644 (file)
@@ -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 (file)
index 0000000..5c91c3f
Binary files /dev/null and b/tests/virstoragetestdata/images/qed_raw-raw-relative differ
diff --git a/tests/virstoragetestdata/images/raw b/tests/virstoragetestdata/images/raw
new file mode 100644 (file)
index 0000000..06d7405
Binary files /dev/null and b/tests/virstoragetestdata/images/raw differ
index e8ab498038ad6ac165c4b74821834b3e13c68906..292a8fa7fb52c05fe879765dc2f4a80076dd89af 100644 (file)
@@ -1,4 +1,4 @@
-path:ABS_BUILDDIR/virstoragedata/qed
+path:ABS_SRCDIR/virstoragetestdata/images/qed_raw-raw-relative
 backingStoreRaw: <null>
 capacity: 0
 encryption: 0
index 70a75c4e37b4c75c37eb7b81837ee810aca477b7..043ec4240bae16607618abc94396859b02f3edac 100644 (file)
@@ -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