]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virstoragetest: Use pre-formatted file for non-path extraction test
authorPeter Krempa <pkrempa@redhat.com>
Wed, 8 Sep 2021 07:11:54 +0000 (09:11 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Thu, 9 Sep 2021 13:29:00 +0000 (15:29 +0200)
This one doesn't require using qemu-img either.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
tests/virstoragetest.c
tests/virstoragetestdata/images/qcow2_nbd-raw.qcow2 [new file with mode: 0644]
tests/virstoragetestdata/out/qcow2-qcow2_nbd-raw

index 96aeaef9ceccdae3a96777846961034bb9e50e9d..8d3dde265fafe18942f141692487cb0cef78939f 100644 (file)
@@ -536,17 +536,10 @@ mymain(void)
     /* Qcow2 file with missing backing file but specified type */
     TEST_CHAIN("qcow2-qcow2_missing", absqcow2, VIR_STORAGE_FILE_QCOW2, EXP_FAIL);
 
-
-    /* Rewrite qcow2 to use an nbd: protocol as backend */
-    virCommandFree(cmd);
-    cmd = virCommandNewArgList(qemuimg, "rebase", "-u", "-f", "qcow2",
-                               "-F", "raw", "-b", "nbd+tcp://example.org:6000/blah",
-                               "qcow2", NULL);
-    if (virCommandRun(cmd, NULL) < 0)
-        ret = -1;
-
     /* Qcow2 file with backing protocol instead of file */
-    TEST_CHAIN("qcow2-qcow2_nbd-raw", absqcow2, VIR_STORAGE_FILE_QCOW2, EXP_PASS);
+    TEST_CHAIN("qcow2-qcow2_nbd-raw",
+               abs_srcdir "/virstoragetestdata/images/qcow2_nbd-raw.qcow2",
+               VIR_STORAGE_FILE_QCOW2, EXP_PASS);
 
     /* qed file */
     TEST_CHAIN("qed-qed_raw",
diff --git a/tests/virstoragetestdata/images/qcow2_nbd-raw.qcow2 b/tests/virstoragetestdata/images/qcow2_nbd-raw.qcow2
new file mode 100644 (file)
index 0000000..848da7a
Binary files /dev/null and b/tests/virstoragetestdata/images/qcow2_nbd-raw.qcow2 differ
index 64acdb880a87b8965d4669033fc02d0ed37c7248..08a93b9f320231b336776e05cee6985f514de451 100644 (file)
@@ -1,4 +1,4 @@
-path:ABS_BUILDDIR/virstoragedata/qcow2
+path:ABS_SRCDIR/virstoragetestdata/images/qcow2_nbd-raw.qcow2
 backingStoreRaw: nbd+tcp://example.org:6000/blah
 capacity: 1024
 encryption: 0