virstoragetest: Add case for qcow2 image with empty string as 'data_file'

Add an example image formatted by:

 qemu-img create -f qcow2 -o data_file=nbd+unix:///datafile?socket=/tmp/nbd,data_file_raw=true /tmp/nbddatastore.qcow2 10M -u

serving as an example when qemu records an empty string as the
'data_file' field.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Peter Krempa 2025-01-09 15:18:58 +01:00
parent 87a4fe2906
commit e6a4245d2a
2 changed files with 5 additions and 0 deletions

View File

@ -494,6 +494,11 @@ mymain(void)
abs_srcdir "/virstoragetestdata/images/qcow2datafile-datafile.qcow2",
VIR_STORAGE_FILE_QCOW2, EXP_PASS);
/* broken qcow2 with a 'data_file' which is an empty string */
TEST_CHAIN("qcow2-datafile-broken",
abs_srcdir "/virstoragetestdata/images/datafile-emptystr.qcow2",
VIR_STORAGE_FILE_QCOW2, EXP_FAIL);
/* 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",