From df020845d5f7bc5875068762a35d6be7f36d5315 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Wed, 8 Sep 2021 09:18:03 +0200 Subject: [PATCH] virstoragetest: Use preformatted file for testing missing backing store MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Ján Tomko --- tests/virstoragetest.c | 12 +++--------- .../images/qcow2_qcow2-missing.qcow2 | Bin 0 -> 196616 bytes 2 files changed, 3 insertions(+), 9 deletions(-) create mode 100644 tests/virstoragetestdata/images/qcow2_qcow2-missing.qcow2 diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c index 8d3dde265f..34aff3e6dd 100644 --- a/tests/virstoragetest.c +++ b/tests/virstoragetest.c @@ -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 index 0000000000000000000000000000000000000000..cb9afb25dcd0b489fe848160255d9e5b427ddf0f GIT binary patch literal 196616 zc-rmIF;2rU6aY}Cft@2{X6zx5kXV?Q)5e8JZ4#1HrA(ZUV{i&27Sd9NE^TIb&$8t& z`G5QS{^s^8gph{4$}B#g5w()F2{x z>Mew#Z2N6CEBkR(lX=~?>!u%@F^MmIY^!{k6?va$i*gxHo=@lXs%c}_m35W%+a{jt za#z19Vv*fVvsm?Q8M{-@56k>@o3(K