From 5ce01b15e11f695ee7410e61bdba305a26263fa6 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Wed, 28 Mar 2018 09:40:03 +0200 Subject: [PATCH] tests: qemublock: Add basic 'raw' file test Test the JSON props generator with a very simple 'raw' image with no other options. The node-names for the image are 31 bytes long so that we validate our node name detector. The top level disk image would generate the following '-drive' cmdline: -drive file=/var/lib/libvirt/images/i.img,format=raw,if=none,id=drive-dummy -device virtio-blk-pci,scsi=off,drive=drive-dummy,id=dummy Signed-off-by: Peter Krempa Reviewed-by: John Ferlan --- tests/qemublocktest.c | 2 ++ .../qemublocktestdata/xml2json/file-raw-noopts.json | 12 ++++++++++++ tests/qemublocktestdata/xml2json/file-raw-noopts.xml | 12 ++++++++++++ 3 files changed, 26 insertions(+) create mode 100644 tests/qemublocktestdata/xml2json/file-raw-noopts.json create mode 100644 tests/qemublocktestdata/xml2json/file-raw-noopts.xml diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c index efad256df7..874ee00855 100644 --- a/tests/qemublocktest.c +++ b/tests/qemublocktest.c @@ -405,6 +405,8 @@ mymain(void) TEST_DISK_TO_JSON_FULL("nodename-long-format", true); TEST_DISK_TO_JSON_FULL("nodename-long-protocol", true); + TEST_DISK_TO_JSON("file-raw-noopts"); + cleanup: virHashFree(diskxmljsondata.schema); qemuTestDriverFree(&driver); diff --git a/tests/qemublocktestdata/xml2json/file-raw-noopts.json b/tests/qemublocktestdata/xml2json/file-raw-noopts.json new file mode 100644 index 0000000000..25de571428 --- /dev/null +++ b/tests/qemublocktestdata/xml2json/file-raw-noopts.json @@ -0,0 +1,12 @@ +{ + "node-name": "0123456789ABCDEF0123456789ABCDE", + "read-only": false, + "driver": "raw", + "file": { + "driver": "file", + "filename": "/var/lib/libvirt/images/i.img", + "node-name": "0123456789ABCDEF0123456789ABCDE", + "read-only": false, + "discard": "unmap" + } +} diff --git a/tests/qemublocktestdata/xml2json/file-raw-noopts.xml b/tests/qemublocktestdata/xml2json/file-raw-noopts.xml new file mode 100644 index 0000000000..8255e64eb7 --- /dev/null +++ b/tests/qemublocktestdata/xml2json/file-raw-noopts.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + -- 2.47.2