]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
domainsnapshotxml2xmltest: Add existing files as new tests
authorPeter Krempa <pkrempa@redhat.com>
Wed, 4 Dec 2013 17:31:39 +0000 (18:31 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Thu, 5 Dec 2013 08:41:29 +0000 (09:41 +0100)
There were plenty snapshot XMLs in the tests/domainsnapshotxml2xmlin
directory that actually weren't used in XML testing. The upgraded
domainsnapshotxml2xml test now allows us to use them.

tests/domainsnapshotxml2xmlin/external_vm.xml
tests/domainsnapshotxml2xmlin/noparent.xml
tests/domainsnapshotxml2xmlout/disk_snapshot.xml [new file with mode: 0644]
tests/domainsnapshotxml2xmlout/empty.xml [new file with mode: 0644]
tests/domainsnapshotxml2xmlout/external_vm.xml [new file with mode: 0644]
tests/domainsnapshotxml2xmlout/name_and_description.xml [new file with mode: 0644]
tests/domainsnapshotxml2xmlout/noparent.xml
tests/domainsnapshotxml2xmltest.c

index 3bcd150bed92be9c2b99f0674b6b701caad39ec7..6be626cd5ffe0618b0b864c44e44f659d70aa2c4 100644 (file)
@@ -6,5 +6,4 @@
   <parent>
     <name>earlier_snap</name>
   </parent>
-  <creationTime>1272917631</creationTime>
 </domainsnapshot>
index cbac0d85857cb8ddb7c58496a7881c46b410a76a..672a0af84a864729f80782194531c158282641ce 100644 (file)
@@ -2,6 +2,7 @@
   <name>my snap name</name>
   <description>!@#$%^</description>
   <state>running</state>
+  <memory snapshot='internal'/>
   <creationTime>1272917631</creationTime>
   <domain>
     <uuid>9d37b878-a7cc-9f9a-b78f-49b3abad25a8</uuid>
diff --git a/tests/domainsnapshotxml2xmlout/disk_snapshot.xml b/tests/domainsnapshotxml2xmlout/disk_snapshot.xml
new file mode 100644 (file)
index 0000000..1a1fc02
--- /dev/null
@@ -0,0 +1,15 @@
+<domainsnapshot>
+  <name>my snap name</name>
+  <description>!@#$%^</description>
+  <disks>
+    <disk name='/dev/HostVG/QEMUGuest1'/>
+    <disk name='hdb' snapshot='no'/>
+    <disk name='hdc' snapshot='internal'/>
+    <disk name='hdd' snapshot='external'>
+      <driver type='qed'/>
+    </disk>
+    <disk name='hde' snapshot='external'>
+      <source file='/path/to/new'/>
+    </disk>
+  </disks>
+</domainsnapshot>
diff --git a/tests/domainsnapshotxml2xmlout/empty.xml b/tests/domainsnapshotxml2xmlout/empty.xml
new file mode 100644 (file)
index 0000000..41538f7
--- /dev/null
@@ -0,0 +1,8 @@
+<domainsnapshot>
+  <name>1386166249</name>
+  <state>nostate</state>
+  <creationTime>1386166249</creationTime>
+  <domain>
+    <uuid>9d37b878-a7cc-9f9a-b78f-49b3abad25a8</uuid>
+  </domain>
+</domainsnapshot>
diff --git a/tests/domainsnapshotxml2xmlout/external_vm.xml b/tests/domainsnapshotxml2xmlout/external_vm.xml
new file mode 100644 (file)
index 0000000..9da369b
--- /dev/null
@@ -0,0 +1,5 @@
+<domainsnapshot>
+  <name>my snap name</name>
+  <description>!@#$%^</description>
+  <memory snapshot='external' file='/dev/HostVG/GuestMemory'/>
+</domainsnapshot>
diff --git a/tests/domainsnapshotxml2xmlout/name_and_description.xml b/tests/domainsnapshotxml2xmlout/name_and_description.xml
new file mode 100644 (file)
index 0000000..435ab79
--- /dev/null
@@ -0,0 +1,5 @@
+<domainsnapshot>
+  <name>snap1</name>
+  <description>A longer description!</description>
+  <state>nostate</state>
+</domainsnapshot>
index 0cbbb658d8690c9465f04c00ba580a180ab43514..d4360f0dc11988139b63a05ed21eb14af467128f 100644 (file)
@@ -1,7 +1,7 @@
 <domainsnapshot>
   <name>my snap name</name>
   <description>!@#$%^</description>
-  <state>running</state>
+  <state>nostate</state>
   <creationTime>1272917631</creationTime>
   <memory snapshot='internal'/>
   <domain>
index d8055e87a4f9c639ef106ab61c49ae000ab7af71..996095992ef63b72fac16a5d04b1f6a97f74cf53 100644 (file)
@@ -215,6 +215,16 @@ mymain(void)
     DO_TEST_OUT("metadata", "c7a5fdbd-edaf-9455-926a-d65c16db1809", false);
     DO_TEST_OUT("external_vm_redefine", "c7a5fdbd-edaf-9455-926a-d65c16db1809", false);
 
+    DO_TEST_INOUT("empty", "9d37b878-a7cc-9f9a-b78f-49b3abad25a8", false, false);
+    DO_TEST_INOUT("noparent", "9d37b878-a7cc-9f9a-b78f-49b3abad25a8", false, false);
+    DO_TEST_INOUT("external_vm", NULL, false, false);
+    DO_TEST_INOUT("noparent", "9d37b878-a7cc-9f9a-b78f-49b3abad25a8", false, false);
+    DO_TEST_INOUT("disk_snapshot", NULL, false, false);
+
+    DO_TEST_IN("name_and_description", NULL);
+    DO_TEST_IN("description_only", NULL);
+    DO_TEST_IN("name_only", NULL);
+
 cleanup:
     if (testSnapshotXMLVariableLineRegex)
         regfree(testSnapshotXMLVariableLineRegex);