virstoragetest: Reinstate testing of images without 'backing_fmt'

There are important security implications when we'd misprobe those
images. This commit reinstates the tests removed by commit 979d1ba3ae
since 'qemu-img' refused to format them.

With the new testing approach with stored images we won't run into that
problem.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Peter Krempa 2021-09-08 17:57:30 +02:00
parent 12906d1985
commit 4f7aaa1b7b
10 changed files with 91 additions and 0 deletions

View File

@ -464,6 +464,20 @@ mymain(void)
testCleanupImages();
/* Test various combinations of qcow2 images with missing 'backing_format' */
TEST_CHAIN("qcow2-qcow2_qcow2-qcow2_qcow2-auto",
abs_srcdir "/virstoragetestdata/images/qcow2_qcow2-qcow2_qcow2-auto.qcow2",
VIR_STORAGE_FILE_QCOW2, EXP_PASS);
TEST_CHAIN("qcow2-qcow2_qcow2-qcow2_raw-auto",
abs_srcdir "/virstoragetestdata/images/qcow2_qcow2-qcow2_raw-auto.qcow2",
VIR_STORAGE_FILE_QCOW2, EXP_PASS);
TEST_CHAIN("qcow2-qcow2_qcow2-auto_qcow2-auto",
abs_srcdir "/virstoragetestdata/images/qcow2_qcow2-auto_qcow2-auto.qcow2",
VIR_STORAGE_FILE_QCOW2, EXP_FAIL);
TEST_CHAIN("qcow2-qcow2_qcow2-auto",
abs_srcdir "/virstoragetestdata/images/qcow2_qcow2-auto.qcow2",
VIR_STORAGE_FILE_QCOW2, EXP_PASS);
/* Qcow2 file with missing backing file but specified type */
TEST_CHAIN("qcow2-qcow2_missing",
abs_srcdir "/virstoragetestdata/images/qcow2_qcow2-missing.qcow2",

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,19 @@
path:ABS_SRCDIR/virstoragetestdata/images/qcow2_qcow2-auto.qcow2
backingStoreRaw: qcow2
capacity: 1024
encryption: 0
relPath:<null>
type:1
format:14
protocol:none
hostname:<null>
path:ABS_SRCDIR/virstoragetestdata/images/qcow2
backingStoreRaw: <null>
capacity: 1024
encryption: 0
relPath:qcow2
type:1
format:14
protocol:none
hostname:<null>

View File

@ -0,0 +1,29 @@
path:ABS_SRCDIR/virstoragetestdata/images/qcow2_qcow2-qcow2_qcow2-auto.qcow2
backingStoreRaw: qcow2_qcow2-auto.qcow2
capacity: 1024
encryption: 0
relPath:<null>
type:1
format:14
protocol:none
hostname:<null>
path:ABS_SRCDIR/virstoragetestdata/images/qcow2_qcow2-auto.qcow2
backingStoreRaw: qcow2
capacity: 1024
encryption: 0
relPath:qcow2_qcow2-auto.qcow2
type:1
format:14
protocol:none
hostname:<null>
path:ABS_SRCDIR/virstoragetestdata/images/qcow2
backingStoreRaw: <null>
capacity: 1024
encryption: 0
relPath:qcow2
type:1
format:14
protocol:none
hostname:<null>

View File

@ -0,0 +1,29 @@
path:ABS_SRCDIR/virstoragetestdata/images/qcow2_qcow2-qcow2_raw-auto.qcow2
backingStoreRaw: qcow2_raw-auto.qcow2
capacity: 1024
encryption: 0
relPath:<null>
type:1
format:14
protocol:none
hostname:<null>
path:ABS_SRCDIR/virstoragetestdata/images/qcow2_raw-auto.qcow2
backingStoreRaw: raw
capacity: 1024
encryption: 0
relPath:qcow2_raw-auto.qcow2
type:1
format:14
protocol:none
hostname:<null>
path:ABS_SRCDIR/virstoragetestdata/images/raw
backingStoreRaw: <null>
capacity: 0
encryption: 0
relPath:raw
type:1
format:1
protocol:none
hostname:<null>