]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
bhyve: test cases for UEFI bhyvexml2argvtest
authorFabian Freyer <fabian.freyer@physik.tu-berlin.de>
Thu, 30 Jun 2016 03:00:04 +0000 (03:00 +0000)
committerRoman Bogorodskiy <bogorodskiy@gmail.com>
Sat, 11 Mar 2017 19:02:12 +0000 (23:02 +0400)
Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
tests/bhyvexml2argvdata/bhyvexml2argv-uefi.args [new file with mode: 0644]
tests/bhyvexml2argvdata/bhyvexml2argv-uefi.ldargs [new file with mode: 0644]
tests/bhyvexml2argvdata/bhyvexml2argv-uefi.xml [new file with mode: 0644]
tests/bhyvexml2argvtest.c

diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-uefi.args b/tests/bhyvexml2argvdata/bhyvexml2argv-uefi.args
new file mode 100644 (file)
index 0000000..8ff8673
--- /dev/null
@@ -0,0 +1,11 @@
+/usr/sbin/bhyve \
+-c 1 \
+-m 214 \
+-u \
+-H \
+-P \
+-s 0:0,hostbridge \
+-l bootrom,/path/to/test.fd \
+-s 2:0,ahci,hd:/tmp/freebsd.img \
+-s 3:0,virtio-net,faketapdev,mac=52:54:00:00:00:00 \
+-s 1,lpc bhyve
diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-uefi.ldargs b/tests/bhyvexml2argvdata/bhyvexml2argv-uefi.ldargs
new file mode 100644 (file)
index 0000000..421376d
--- /dev/null
@@ -0,0 +1 @@
+dummy
diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-uefi.xml b/tests/bhyvexml2argvdata/bhyvexml2argv-uefi.xml
new file mode 100644 (file)
index 0000000..0b7d6bd
--- /dev/null
@@ -0,0 +1,23 @@
+<domain type='bhyve'>
+  <name>bhyve</name>
+  <uuid>df3be7e7-a104-11e3-aeb0-50e5492bd3dc</uuid>
+  <memory>219136</memory>
+  <vcpu>1</vcpu>
+  <os>
+    <type>hvm</type>
+    <loader readonly="yes" type="pflash">/path/to/test.fd</loader>
+  </os>
+  <devices>
+    <disk type='file'>
+      <driver name='file' type='raw'/>
+      <source file='/tmp/freebsd.img'/>
+      <target dev='hda' bus='sata'/>
+      <address type='drive' controller='0' bus='0' target='2' unit='0'/>
+    </disk>
+    <interface type='bridge'>
+      <model type='virtio'/>
+      <source bridge="virbr0"/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+    </interface>
+  </devices>
+</domain>
index fb404f9fbce48ef860d705329dcd23e2a1a8d82e..61072963d2e7119402856b155f4728527a985420 100644 (file)
@@ -52,8 +52,11 @@ static int testCompareXMLToArgvFiles(const char *xml,
     conn->privateData = &driver;
 
     cmd = virBhyveProcessBuildBhyveCmd(conn, vmdef, false);
-    ldcmd = virBhyveProcessBuildLoadCmd(conn, vmdef, "<device.map>",
-                                        &actualdm);
+    if (vmdef->os.loader)
+        ldcmd = virCommandNew("dummy");
+    else
+        ldcmd = virBhyveProcessBuildLoadCmd(conn, vmdef, "<device.map>",
+                                            &actualdm);
 
     if ((cmd == NULL) || (ldcmd == NULL)) {
         if (flags & FLAG_EXPECT_FAILURE) {
@@ -162,7 +165,8 @@ mymain(void)
     DO_TEST_FULL(name, FLAG_EXPECT_PARSE_ERROR)
 
     driver.grubcaps = BHYVE_GRUB_CAP_CONSDEV;
-    driver.bhyvecaps = BHYVE_CAP_RTC_UTC | BHYVE_CAP_AHCI32SLOT | BHYVE_CAP_NET_E1000;
+    driver.bhyvecaps = BHYVE_CAP_RTC_UTC | BHYVE_CAP_AHCI32SLOT | \
+                       BHYVE_CAP_NET_E1000 | BHYVE_CAP_LPC_BOOTROM;
 
     DO_TEST("base");
     DO_TEST("acpiapic");
@@ -186,6 +190,7 @@ mymain(void)
     DO_TEST("serial-grub");
     DO_TEST("localtime");
     DO_TEST("net-e1000");
+    DO_TEST("uefi");
 
     /* Address allocation tests */
     DO_TEST("addr-single-sata-disk");
@@ -208,6 +213,9 @@ mymain(void)
 
     DO_TEST_FAILURE("net-e1000");
 
+    driver.bhyvecaps &= ~BHYVE_CAP_LPC_BOOTROM;
+    DO_TEST_FAILURE("uefi");
+
     virObjectUnref(driver.caps);
     virObjectUnref(driver.xmlopt);