Reuse the XML files in storagevolxml2xmlin.
(This requires changing a few backing files to /dev/null,
since virStorageBackendCreateQemuImgCmd checks for its
presence)
---
tests/storagevolxml2argvdata/vol-file.xml | 20 --------------
tests/storagevolxml2argvdata/vol-qcow2-1.1.xml | 32 ----------------------
tests/storagevolxml2argvtest.c | 4 +--
.../vol-qcow2-0.10-lazy.xml | 0
tests/storagevolxml2xmlin/vol-qcow2-1.1.xml | 2 +-
tests/storagevolxml2xmlin/vol-qcow2-lazy.xml | 2 +-
.../vol-qcow2-nobacking.xml | 0
tests/storagevolxml2xmlin/vol-qcow2.xml | 2 +-
.../vol-qcow2-0.10-lazy.xml} | 8 +++---
tests/storagevolxml2xmlout/vol-qcow2-1.1.xml | 2 +-
tests/storagevolxml2xmlout/vol-qcow2-lazy.xml | 2 +-
.../vol-qcow2-nobacking.xml} | 16 ++---------
tests/storagevolxml2xmlout/vol-qcow2.xml | 2 +-
tests/storagevolxml2xmltest.c | 2 ++
14 files changed, 17 insertions(+), 77 deletions(-)
delete mode 100644 tests/storagevolxml2argvdata/vol-file.xml
delete mode 100644 tests/storagevolxml2argvdata/vol-qcow2-1.1.xml
rename tests/{storagevolxml2argvdata => storagevolxml2xmlin}/vol-qcow2-0.10-lazy.xml
(100%)
rename tests/{storagevolxml2argvdata => storagevolxml2xmlin}/vol-qcow2-nobacking.xml
(100%)
rename tests/{storagevolxml2argvdata/vol-qcow2-lazy.xml =>
storagevolxml2xmlout/vol-qcow2-0.10-lazy.xml} (84%)
rename tests/{storagevolxml2argvdata/vol-qcow2.xml =>
storagevolxml2xmlout/vol-qcow2-nobacking.xml} (55%)
diff --git a/tests/storagevolxml2argvdata/vol-file.xml
b/tests/storagevolxml2argvdata/vol-file.xml
deleted file mode 100644
index d3f65f6..0000000
--- a/tests/storagevolxml2argvdata/vol-file.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<volume>
- <name>sparse.img</name>
- <source/>
- <capacity unit="TiB">1</capacity>
- <allocation unit="bytes">0</allocation>
- <target>
- <path>/var/lib/libvirt/images/sparse.img</path>
- <permissions>
- <mode>0</mode>
- <owner>0744</owner>
- <group>0</group>
- <label>virt_image_t</label>
- </permissions>
- <timestamps>
- <atime>1341933637.273190990</atime>
- <mtime>1341930622.047245868</mtime>
- <ctime>1341930622.047245868</ctime>
- </timestamps>
- </target>
-</volume>
diff --git a/tests/storagevolxml2argvdata/vol-qcow2-1.1.xml
b/tests/storagevolxml2argvdata/vol-qcow2-1.1.xml
deleted file mode 100644
index 696e1e0..0000000
--- a/tests/storagevolxml2argvdata/vol-qcow2-1.1.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<volume>
- <name>OtherDemo.img</name>
- <key>/var/lib/libvirt/images/OtherDemo.img</key>
- <source>
- </source>
- <capacity unit="G">5</capacity>
- <allocation>294912</allocation>
- <target>
- <path>/var/lib/libvirt/images/OtherDemo.img</path>
- <format type='qcow2'/>
- <permissions>
- <mode>0644</mode>
- <owner>0</owner>
- <group>0</group>
- <label>unconfined_u:object_r:virt_image_t:s0</label>
- </permissions>
- <encryption format='qcow'>
- <secret type='passphrase'
uuid='e78d4b51-a2af-485f-b0f5-afca709a80f4'/>
- </encryption>
- <features/>
- </target>
- <backingStore>
- <path>/dev/null</path>
- <format type='raw'/>
- <permissions>
- <mode>0644</mode>
- <owner>0</owner>
- <group>0</group>
- <label>unconfined_u:object_r:virt_image_t:s0</label>
- </permissions>
- </backingStore>
-</volume>
diff --git a/tests/storagevolxml2argvtest.c b/tests/storagevolxml2argvtest.c
index 1e3ff9a..b220994 100644
--- a/tests/storagevolxml2argvtest.c
+++ b/tests/storagevolxml2argvtest.c
@@ -121,12 +121,12 @@ testCompareXMLToArgvHelper(const void *data)
char *cmdline = NULL;
if (info->inputvol &&
- virAsprintf(&inputvolxml, "%s/storagevolxml2argvdata/%s.xml",
+ virAsprintf(&inputvolxml, "%s/storagevolxml2xmlin/%s.xml",
abs_srcdir, info->inputvol) < 0)
goto cleanup;
if (virAsprintf(&poolxml, "%s/storagepoolxml2xmlin/%s.xml",
abs_srcdir, info->pool) < 0 ||
- virAsprintf(&volxml, "%s/storagevolxml2argvdata/%s.xml",
+ virAsprintf(&volxml, "%s/storagevolxml2xmlin/%s.xml",
abs_srcdir, info->vol) < 0) {
goto cleanup;
}
diff --git a/tests/storagevolxml2argvdata/vol-qcow2-0.10-lazy.xml
b/tests/storagevolxml2xmlin/vol-qcow2-0.10-lazy.xml
similarity index 100%
rename from tests/storagevolxml2argvdata/vol-qcow2-0.10-lazy.xml
rename to tests/storagevolxml2xmlin/vol-qcow2-0.10-lazy.xml
diff --git a/tests/storagevolxml2xmlin/vol-qcow2-1.1.xml
b/tests/storagevolxml2xmlin/vol-qcow2-1.1.xml
index e8df8b3..696e1e0 100644
--- a/tests/storagevolxml2xmlin/vol-qcow2-1.1.xml
+++ b/tests/storagevolxml2xmlin/vol-qcow2-1.1.xml
@@ -20,7 +20,7 @@
<features/>
</target>
<backingStore>
- <path>/var/lib/libvirt/images/BaseDemo.img</path>
+ <path>/dev/null</path>
<format type='raw'/>
<permissions>
<mode>0644</mode>
diff --git a/tests/storagevolxml2xmlin/vol-qcow2-lazy.xml
b/tests/storagevolxml2xmlin/vol-qcow2-lazy.xml
index 336342a..c1d7875 100644
--- a/tests/storagevolxml2xmlin/vol-qcow2-lazy.xml
+++ b/tests/storagevolxml2xmlin/vol-qcow2-lazy.xml
@@ -23,7 +23,7 @@
</features>
</target>
<backingStore>
- <path>/var/lib/libvirt/images/BaseDemo.img</path>
+ <path>/dev/null</path>
<format type='raw'/>
<permissions>
<mode>0644</mode>
diff --git a/tests/storagevolxml2argvdata/vol-qcow2-nobacking.xml
b/tests/storagevolxml2xmlin/vol-qcow2-nobacking.xml
similarity index 100%
rename from tests/storagevolxml2argvdata/vol-qcow2-nobacking.xml
rename to tests/storagevolxml2xmlin/vol-qcow2-nobacking.xml
diff --git a/tests/storagevolxml2xmlin/vol-qcow2.xml
b/tests/storagevolxml2xmlin/vol-qcow2.xml
index b4924de..49a7de3 100644
--- a/tests/storagevolxml2xmlin/vol-qcow2.xml
+++ b/tests/storagevolxml2xmlin/vol-qcow2.xml
@@ -19,7 +19,7 @@
</encryption>
</target>
<backingStore>
- <path>/var/lib/libvirt/images/BaseDemo.img</path>
+ <path>/dev/null</path>
<format type='raw'/>
<permissions>
<mode>0644</mode>
diff --git a/tests/storagevolxml2argvdata/vol-qcow2-lazy.xml
b/tests/storagevolxml2xmlout/vol-qcow2-0.10-lazy.xml
similarity index 84%
rename from tests/storagevolxml2argvdata/vol-qcow2-lazy.xml
rename to tests/storagevolxml2xmlout/vol-qcow2-0.10-lazy.xml
index c1d7875..a7b5fed 100644
--- a/tests/storagevolxml2argvdata/vol-qcow2-lazy.xml
+++ b/tests/storagevolxml2xmlout/vol-qcow2-0.10-lazy.xml
@@ -1,10 +1,10 @@
<volume>
<name>OtherDemo.img</name>
- <key>/var/lib/libvirt/images/OtherDemo.img</key>
+ <key>(null)</key>
<source>
</source>
- <capacity unit="G">5</capacity>
- <allocation>294912</allocation>
+ <capacity unit='bytes'>5368709120</capacity>
+ <allocation unit='bytes'>294912</allocation>
<target>
<path>/var/lib/libvirt/images/OtherDemo.img</path>
<format type='qcow2'/>
@@ -17,7 +17,7 @@
<encryption format='qcow'>
<secret type='passphrase'
uuid='e78d4b51-a2af-485f-b0f5-afca709a80f4'/>
</encryption>
- <compat>1.1</compat>
+ <compat>0.10</compat>
<features>
<lazy_refcounts/>
</features>
diff --git a/tests/storagevolxml2xmlout/vol-qcow2-1.1.xml
b/tests/storagevolxml2xmlout/vol-qcow2-1.1.xml
index 454ac11..b7df8a6 100644
--- a/tests/storagevolxml2xmlout/vol-qcow2-1.1.xml
+++ b/tests/storagevolxml2xmlout/vol-qcow2-1.1.xml
@@ -21,7 +21,7 @@
<features/>
</target>
<backingStore>
- <path>/var/lib/libvirt/images/BaseDemo.img</path>
+ <path>/dev/null</path>
<format type='raw'/>
<permissions>
<mode>0644</mode>
diff --git a/tests/storagevolxml2xmlout/vol-qcow2-lazy.xml
b/tests/storagevolxml2xmlout/vol-qcow2-lazy.xml
index 4e30ede..92b7875 100644
--- a/tests/storagevolxml2xmlout/vol-qcow2-lazy.xml
+++ b/tests/storagevolxml2xmlout/vol-qcow2-lazy.xml
@@ -23,7 +23,7 @@
</features>
</target>
<backingStore>
- <path>/var/lib/libvirt/images/BaseDemo.img</path>
+ <path>/dev/null</path>
<format type='raw'/>
<permissions>
<mode>0644</mode>
diff --git a/tests/storagevolxml2argvdata/vol-qcow2.xml
b/tests/storagevolxml2xmlout/vol-qcow2-nobacking.xml
similarity index 55%
rename from tests/storagevolxml2argvdata/vol-qcow2.xml
rename to tests/storagevolxml2xmlout/vol-qcow2-nobacking.xml
index 49a7de3..e2da702 100644
--- a/tests/storagevolxml2argvdata/vol-qcow2.xml
+++ b/tests/storagevolxml2xmlout/vol-qcow2-nobacking.xml
@@ -1,10 +1,10 @@
<volume>
<name>OtherDemo.img</name>
- <key>/var/lib/libvirt/images/OtherDemo.img</key>
+ <key>(null)</key>
<source>
</source>
- <capacity unit="G">5</capacity>
- <allocation>294912</allocation>
+ <capacity unit='bytes'>5368709120</capacity>
+ <allocation unit='bytes'>294912</allocation>
<target>
<path>/var/lib/libvirt/images/OtherDemo.img</path>
<format type='qcow2'/>
@@ -18,14 +18,4 @@
<secret type='passphrase'
uuid='e78d4b51-a2af-485f-b0f5-afca709a80f4'/>
</encryption>
</target>
- <backingStore>
- <path>/dev/null</path>
- <format type='raw'/>
- <permissions>
- <mode>0644</mode>
- <owner>0</owner>
- <group>0</group>
- <label>unconfined_u:object_r:virt_image_t:s0</label>
- </permissions>
- </backingStore>
</volume>
diff --git a/tests/storagevolxml2xmlout/vol-qcow2.xml
b/tests/storagevolxml2xmlout/vol-qcow2.xml
index 4490931..f931a62 100644
--- a/tests/storagevolxml2xmlout/vol-qcow2.xml
+++ b/tests/storagevolxml2xmlout/vol-qcow2.xml
@@ -19,7 +19,7 @@
</encryption>
</target>
<backingStore>
- <path>/var/lib/libvirt/images/BaseDemo.img</path>
+ <path>/dev/null</path>
<format type='raw'/>
<permissions>
<mode>0644</mode>
diff --git a/tests/storagevolxml2xmltest.c b/tests/storagevolxml2xmltest.c
index 05d2306..5b0a60b 100644
--- a/tests/storagevolxml2xmltest.c
+++ b/tests/storagevolxml2xmltest.c
@@ -114,6 +114,8 @@ mymain(void)
DO_TEST("pool-dir", "vol-qcow2");
DO_TEST("pool-dir", "vol-qcow2-1.1");
DO_TEST("pool-dir", "vol-qcow2-lazy");
+ DO_TEST("pool-dir", "vol-qcow2-0.10-lazy");
+ DO_TEST("pool-dir", "vol-qcow2-nobacking");
DO_TEST("pool-disk", "vol-partition");
DO_TEST("pool-logical", "vol-logical");
DO_TEST("pool-logical", "vol-logical-backing");
--
1.8.1.5