From 0b0c641b668bd46f9678861eb4c776d03e541b97 Mon Sep 17 00:00:00 2001 From: Chunyan Liu Date: Tue, 15 Jul 2014 16:49:47 +0800 Subject: [PATCH] add nocow test case Add file in storagevolxml2xmlin and storagevolxml2xmlout, let storagevolxml2xmltest and storagevolschematest cover 'nocow'. Add test case to storagevolxml2argvtest to cover 'nocow'. Signed-off-by: Chunyan Liu --- .../qcow2-nocow-compat.argv | 3 ++ tests/storagevolxml2argvdata/qcow2-nocow.argv | 3 ++ tests/storagevolxml2argvtest.c | 6 ++++ tests/storagevolxml2xmlin/vol-qcow2-nocow.xml | 32 +++++++++++++++++++ .../storagevolxml2xmlout/vol-qcow2-nocow.xml | 31 ++++++++++++++++++ 5 files changed, 75 insertions(+) create mode 100644 tests/storagevolxml2argvdata/qcow2-nocow-compat.argv create mode 100644 tests/storagevolxml2argvdata/qcow2-nocow.argv create mode 100644 tests/storagevolxml2xmlin/vol-qcow2-nocow.xml create mode 100644 tests/storagevolxml2xmlout/vol-qcow2-nocow.xml diff --git a/tests/storagevolxml2argvdata/qcow2-nocow-compat.argv b/tests/storagevolxml2argvdata/qcow2-nocow-compat.argv new file mode 100644 index 0000000000..d5a7547011 --- /dev/null +++ b/tests/storagevolxml2argvdata/qcow2-nocow-compat.argv @@ -0,0 +1,3 @@ +qemu-img create -f qcow2 -b /dev/null \ +-o backing_fmt=raw,encryption=on,nocow=on,compat=0.10 \ +/var/lib/libvirt/images/OtherDemo.img 5242880K diff --git a/tests/storagevolxml2argvdata/qcow2-nocow.argv b/tests/storagevolxml2argvdata/qcow2-nocow.argv new file mode 100644 index 0000000000..e54801c78a --- /dev/null +++ b/tests/storagevolxml2argvdata/qcow2-nocow.argv @@ -0,0 +1,3 @@ +qemu-img create -f qcow2 -b /dev/null \ +-o backing_fmt=raw,encryption=on,nocow=on \ +/var/lib/libvirt/images/OtherDemo.img 5242880K diff --git a/tests/storagevolxml2argvtest.c b/tests/storagevolxml2argvtest.c index 11d70e12aa..2a45f6f3ca 100644 --- a/tests/storagevolxml2argvtest.c +++ b/tests/storagevolxml2argvtest.c @@ -296,6 +296,12 @@ mymain(void) DO_TEST("pool-logical", "vol-logical", "pool-dir", "vol-qcow2-nobacking", "logical-from-qcow2", 0, FMT_COMPAT); + DO_TEST("pool-dir", "vol-qcow2-nocow", + NULL, NULL, + "qcow2-nocow", 0, FMT_OPTIONS); + DO_TEST("pool-dir", "vol-qcow2-nocow", + NULL, NULL, + "qcow2-nocow-compat", 0, FMT_COMPAT); return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE; } diff --git a/tests/storagevolxml2xmlin/vol-qcow2-nocow.xml b/tests/storagevolxml2xmlin/vol-qcow2-nocow.xml new file mode 100644 index 0000000000..661475be73 --- /dev/null +++ b/tests/storagevolxml2xmlin/vol-qcow2-nocow.xml @@ -0,0 +1,32 @@ + + OtherDemo.img + /var/lib/libvirt/images/OtherDemo.img + + + 5 + 294912 + + /var/lib/libvirt/images/OtherDemo.img + + + 0644 + 0 + 0 + + + + + + + + + /dev/null + + + 0644 + 0 + 0 + + + + diff --git a/tests/storagevolxml2xmlout/vol-qcow2-nocow.xml b/tests/storagevolxml2xmlout/vol-qcow2-nocow.xml new file mode 100644 index 0000000000..31dc57873c --- /dev/null +++ b/tests/storagevolxml2xmlout/vol-qcow2-nocow.xml @@ -0,0 +1,31 @@ + + OtherDemo.img + /var/lib/libvirt/images/OtherDemo.img + + + 5368709120 + 294912 + + /var/lib/libvirt/images/OtherDemo.img + + + 0644 + 0 + 0 + + + + + + + + /dev/null + + + 0644 + 0 + 0 + + + + -- GitLab