]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virstoragetest: Use preformatted file for testing missing backing store
authorPeter Krempa <pkrempa@redhat.com>
Wed, 8 Sep 2021 07:18:03 +0000 (09:18 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Thu, 9 Sep 2021 13:29:00 +0000 (15:29 +0200)
Similarly to previous ones, this one doesn't need to be created by
qemu-img in order for the test to make sense.

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

index 8d3dde265fafe18942f141692487cb0cef78939f..34aff3e6ddc9a6ab55975824919583de79a00121 100644 (file)
@@ -525,16 +525,10 @@ mymain(void)
     /* qcow2 with a longer backing chain */
     TEST_CHAIN("qcow2-qcow2_qcow2-qcow2_raw-raw", abswrap, VIR_STORAGE_FILE_QCOW2, EXP_PASS);
 
-    /* Rewrite qcow2 to a missing backing file, with backing type */
-    virCommandFree(cmd);
-    cmd = virCommandNewArgList(qemuimg, "rebase", "-u", "-f", "qcow2",
-                               "-F", "qcow2", "-b", datadir "/bogus",
-                               "qcow2", NULL);
-    if (virCommandRun(cmd, NULL) < 0)
-        ret = -1;
-
     /* Qcow2 file with missing backing file but specified type */
-    TEST_CHAIN("qcow2-qcow2_missing", absqcow2, VIR_STORAGE_FILE_QCOW2, EXP_FAIL);
+    TEST_CHAIN("qcow2-qcow2_missing",
+               abs_srcdir "/virstoragetestdata/images/qcow2_qcow2-missing.qcow2",
+               VIR_STORAGE_FILE_QCOW2, EXP_FAIL);
 
     /* Qcow2 file with backing protocol instead of file */
     TEST_CHAIN("qcow2-qcow2_nbd-raw",
diff --git a/tests/virstoragetestdata/images/qcow2_qcow2-missing.qcow2 b/tests/virstoragetestdata/images/qcow2_qcow2-missing.qcow2
new file mode 100644 (file)
index 0000000..cb9afb2
Binary files /dev/null and b/tests/virstoragetestdata/images/qcow2_qcow2-missing.qcow2 differ