[libvirt PATCH] tests: virstoragetest: remove tests without backing type

Ján Tomko posted 1 patch 2 years, 7 months ago
Test syntax-check failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/9b8840a8fb7f7c0d8328ce95a8bc1f998f4b3920.1630404183.git.jtomko@redhat.com
tests/virstoragetest.c | 33 ---------------------------------
1 file changed, 33 deletions(-)
[libvirt PATCH] tests: virstoragetest: remove tests without backing type
Posted by Ján Tomko 2 years, 7 months ago
As of qemu commit:

  commit 497a30dbb065937d67f6c43af6dd78492e1d6f6d
    qemu-img: Require -F with -b backing image

creating images with backing images requires specifying the format.

Remove tests which do not pass the backing format on the command
line.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
---
 tests/virstoragetest.c | 33 ---------------------------------
 1 file changed, 33 deletions(-)

diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c
index 1b211b60e6..b80818bc7b 100644
--- a/tests/virstoragetest.c
+++ b/tests/virstoragetest.c
@@ -638,30 +638,6 @@ mymain(void)
     };
     TEST_CHAIN(abswrap, VIR_STORAGE_FILE_QCOW2, (&wrap, &qcow2, &raw), EXP_PASS);
 
-    /* Rewrite qcow2 and wrap file to omit backing file type */
-    virCommandFree(cmd);
-    cmd = virCommandNewArgList(qemuimg, "rebase", "-u", "-f", "qcow2",
-                               "-b", absraw, "qcow2", NULL);
-    if (virCommandRun(cmd, NULL) < 0)
-        ret = -1;
-
-    virCommandFree(cmd);
-    cmd = virCommandNewArgList(qemuimg, "rebase", "-u", "-f", "qcow2",
-                               "-b", absqcow2, "wrap", NULL);
-    if (virCommandRun(cmd, NULL) < 0)
-        ret = -1;
-
-    /* Qcow2 file with raw as absolute backing, backing format omitted */
-    testFileData wrap_as_raw = {
-        .expBackingStoreRaw = absqcow2,
-        .expCapacity = 1024,
-        .path = abswrap,
-        .type = VIR_STORAGE_TYPE_FILE,
-        .format = VIR_STORAGE_FILE_QCOW2,
-    };
-    TEST_CHAIN(abswrap, VIR_STORAGE_FILE_QCOW2,
-               (&wrap_as_raw, &qcow2_as_raw), EXP_FAIL);
-
     /* Rewrite qcow2 to a missing backing file, with backing type */
     virCommandFree(cmd);
     cmd = virCommandNewArgList(qemuimg, "rebase", "-u", "-f", "qcow2",
@@ -674,15 +650,6 @@ mymain(void)
     /* Qcow2 file with missing backing file but specified type */
     TEST_CHAIN(absqcow2, VIR_STORAGE_FILE_QCOW2, (&qcow2), EXP_FAIL);
 
-    /* Rewrite qcow2 to a missing backing file, without backing type */
-    virCommandFree(cmd);
-    cmd = virCommandNewArgList(qemuimg, "rebase", "-u", "-f", "qcow2",
-                               "-b", datadir "/bogus", "qcow2", NULL);
-    if (virCommandRun(cmd, NULL) < 0)
-        ret = -1;
-
-    /* Qcow2 file with missing backing file and no specified type */
-    TEST_CHAIN(absqcow2, VIR_STORAGE_FILE_QCOW2, (&qcow2), EXP_FAIL);
 
     /* Rewrite qcow2 to use an nbd: protocol as backend */
     virCommandFree(cmd);
-- 
2.31.1

Re: [libvirt PATCH] tests: virstoragetest: remove tests without backing type
Posted by Daniel P. Berrangé 2 years, 7 months ago
On Tue, Aug 31, 2021 at 12:03:06PM +0200, Ján Tomko wrote:
> As of qemu commit:
> 
>   commit 497a30dbb065937d67f6c43af6dd78492e1d6f6d
>     qemu-img: Require -F with -b backing image
> 
> creating images with backing images requires specifying the format.
> 
> Remove tests which do not pass the backing format on the command
> line.
> 
> Signed-off-by: Ján Tomko <jtomko@redhat.com>
> ---
>  tests/virstoragetest.c | 33 ---------------------------------
>  1 file changed, 33 deletions(-)

This fixes the broken 'make check' on Fedora rawhide with QEMU 6.1.0

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|