diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c index 513ffdeb41..ec185d8660 100644 --- a/tests/virstoragetest.c +++ b/tests/virstoragetest.c @@ -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", diff --git a/tests/virstoragetestdata/images/qcow2 b/tests/virstoragetestdata/images/qcow2 new file mode 100644 index 0000000000..31a144e4b9 Binary files /dev/null and b/tests/virstoragetestdata/images/qcow2 differ diff --git a/tests/virstoragetestdata/images/qcow2_qcow2-auto.qcow2 b/tests/virstoragetestdata/images/qcow2_qcow2-auto.qcow2 new file mode 100644 index 0000000000..490482150d Binary files /dev/null and b/tests/virstoragetestdata/images/qcow2_qcow2-auto.qcow2 differ diff --git a/tests/virstoragetestdata/images/qcow2_qcow2-auto_qcow2-auto.qcow2 b/tests/virstoragetestdata/images/qcow2_qcow2-auto_qcow2-auto.qcow2 new file mode 100644 index 0000000000..3b27b256c2 Binary files /dev/null and b/tests/virstoragetestdata/images/qcow2_qcow2-auto_qcow2-auto.qcow2 differ diff --git a/tests/virstoragetestdata/images/qcow2_qcow2-qcow2_qcow2-auto.qcow2 b/tests/virstoragetestdata/images/qcow2_qcow2-qcow2_qcow2-auto.qcow2 new file mode 100644 index 0000000000..8b9c3cedea Binary files /dev/null and b/tests/virstoragetestdata/images/qcow2_qcow2-qcow2_qcow2-auto.qcow2 differ diff --git a/tests/virstoragetestdata/images/qcow2_qcow2-qcow2_raw-auto.qcow2 b/tests/virstoragetestdata/images/qcow2_qcow2-qcow2_raw-auto.qcow2 new file mode 100644 index 0000000000..90b0a9a059 Binary files /dev/null and b/tests/virstoragetestdata/images/qcow2_qcow2-qcow2_raw-auto.qcow2 differ diff --git a/tests/virstoragetestdata/images/qcow2_raw-auto.qcow2 b/tests/virstoragetestdata/images/qcow2_raw-auto.qcow2 new file mode 100644 index 0000000000..c942c3816a Binary files /dev/null and b/tests/virstoragetestdata/images/qcow2_raw-auto.qcow2 differ diff --git a/tests/virstoragetestdata/out/qcow2-qcow2_qcow2-auto b/tests/virstoragetestdata/out/qcow2-qcow2_qcow2-auto new file mode 100644 index 0000000000..e23c43f328 --- /dev/null +++ b/tests/virstoragetestdata/out/qcow2-qcow2_qcow2-auto @@ -0,0 +1,19 @@ +path:ABS_SRCDIR/virstoragetestdata/images/qcow2_qcow2-auto.qcow2 +backingStoreRaw: qcow2 +capacity: 1024 +encryption: 0 +relPath: +type:1 +format:14 +protocol:none +hostname: + +path:ABS_SRCDIR/virstoragetestdata/images/qcow2 +backingStoreRaw: +capacity: 1024 +encryption: 0 +relPath:qcow2 +type:1 +format:14 +protocol:none +hostname: diff --git a/tests/virstoragetestdata/out/qcow2-qcow2_qcow2-qcow2_qcow2-auto b/tests/virstoragetestdata/out/qcow2-qcow2_qcow2-qcow2_qcow2-auto new file mode 100644 index 0000000000..17f53f3ed0 --- /dev/null +++ b/tests/virstoragetestdata/out/qcow2-qcow2_qcow2-qcow2_qcow2-auto @@ -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: +type:1 +format:14 +protocol:none +hostname: + +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: + +path:ABS_SRCDIR/virstoragetestdata/images/qcow2 +backingStoreRaw: +capacity: 1024 +encryption: 0 +relPath:qcow2 +type:1 +format:14 +protocol:none +hostname: diff --git a/tests/virstoragetestdata/out/qcow2-qcow2_qcow2-qcow2_raw-auto b/tests/virstoragetestdata/out/qcow2-qcow2_qcow2-qcow2_raw-auto new file mode 100644 index 0000000000..1be5a82cc9 --- /dev/null +++ b/tests/virstoragetestdata/out/qcow2-qcow2_qcow2-qcow2_raw-auto @@ -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: +type:1 +format:14 +protocol:none +hostname: + +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: + +path:ABS_SRCDIR/virstoragetestdata/images/raw +backingStoreRaw: +capacity: 0 +encryption: 0 +relPath:raw +type:1 +format:1 +protocol:none +hostname: