[virt-tools-list] [virt-manager PATCH RFC 2/4] virt-install: add tests for OVMF

Giuseppe Scrivano gscrivan at redhat.com
Thu Sep 11 16:56:27 UTC 2014


Signed-off-by: Giuseppe Scrivano <gscrivan at redhat.com>
---
 tests/xmlparse-xml/change-boot-uefi-in.xml  | 24 ++++++++++++++++++++++++
 tests/xmlparse-xml/change-boot-uefi-out.xml | 26 ++++++++++++++++++++++++++
 tests/xmlparse.py                           | 18 ++++++++++++++++++
 3 files changed, 68 insertions(+)
 create mode 100644 tests/xmlparse-xml/change-boot-uefi-in.xml
 create mode 100644 tests/xmlparse-xml/change-boot-uefi-out.xml

diff --git a/tests/xmlparse-xml/change-boot-uefi-in.xml b/tests/xmlparse-xml/change-boot-uefi-in.xml
new file mode 100644
index 0000000..ffbc280
--- /dev/null
+++ b/tests/xmlparse-xml/change-boot-uefi-in.xml
@@ -0,0 +1,24 @@
+<domain type="xen">
+  <name>TestGuest</name>
+  <currentMemory>204800</currentMemory>
+  <memory>409600</memory>
+  <uuid>12345678-1234-1234-1234-123456789012</uuid>
+  <os>
+    <type arch="i686">linux</type>
+    <kernel>/boot/vmlinuz</kernel>
+    <initrd>/boot/initrd</initrd>
+    <cmdline>location</cmdline>
+  </os>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>destroy</on_reboot>
+  <on_crash>destroy</on_crash>
+  <vcpu>5</vcpu>
+  <devices>
+    <disk type="block" device="disk">
+      <source dev="/dev/null"/>
+      <target dev="xvda" bus="xen"/>
+    </disk>
+    <input type="mouse" bus="xen"/>
+    <graphics type="vnc" port="-1" keymap="ja"/>
+  </devices>
+</domain>
diff --git a/tests/xmlparse-xml/change-boot-uefi-out.xml b/tests/xmlparse-xml/change-boot-uefi-out.xml
new file mode 100644
index 0000000..77ff454
--- /dev/null
+++ b/tests/xmlparse-xml/change-boot-uefi-out.xml
@@ -0,0 +1,26 @@
+<domain type="xen">
+  <name>TestGuest</name>
+  <currentMemory>204800</currentMemory>
+  <memory>409600</memory>
+  <uuid>12345678-1234-1234-1234-123456789012</uuid>
+  <os>
+    <type arch="i686">linux</type>
+    <loader readonly="yes" type="pflash">OVMF_CODE.fd</loader>
+    <nvram template="/tmp/template">/tmp/nvram_store</nvram>
+    <boot dev="network"/>
+    <boot dev="hd"/>
+    <boot dev="fd"/>
+  </os>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>destroy</on_reboot>
+  <on_crash>destroy</on_crash>
+  <vcpu>5</vcpu>
+  <devices>
+    <disk type="block" device="disk">
+      <source dev="/dev/null"/>
+      <target dev="xvda" bus="xen"/>
+    </disk>
+    <input type="mouse" bus="xen"/>
+    <graphics type="vnc" port="-1" keymap="ja"/>
+  </devices>
+</domain>
diff --git a/tests/xmlparse.py b/tests/xmlparse.py
index d257f38..a9a4063 100644
--- a/tests/xmlparse.py
+++ b/tests/xmlparse.py
@@ -286,6 +286,24 @@ class XMLParseTest(unittest.TestCase):
 
         self._alter_compare(guest.get_xml_config(), outfile)
 
+    def testAlterBootUEFI(self):
+        guest, outfile = self._get_test_content("change-boot-uefi")
+
+        check = self._make_checker(guest.os)
+        check("bootorder", [], ["network", "hd", "fd"])
+        check("loader_ro", None, True)
+        check("loader_type", None, "pflash")
+        check("nvram", None, "/tmp/nvram_store")
+        check("nvram_template", None, "/tmp/template")
+        check("loader", None, "OVMF_CODE.fd")
+
+        check("kernel", "/boot/vmlinuz", None)
+
+        check("initrd", "/boot/initrd", None)
+        check("kernel_args", "location", None)
+
+        self._alter_compare(guest.get_xml_config(), outfile)
+
     def testAlterCpuMode(self):
         guest, outfile = self._get_test_content("change-cpumode")
 
-- 
1.9.3




More information about the virt-tools-list mailing list