[virt-manager PATCH v2 1/4] tests: cli: start testing bhyve

Roman Bogorodskiy bogorodskiy at gmail.com
Thu Feb 11 15:41:10 UTC 2021


Signed-off-by: Roman Bogorodskiy <bogorodskiy at gmail.com>
---
 tests/data/capabilities/bhyve-domcaps.xml     | 55 +++++++++++++++++++
 tests/data/capabilities/bhyve.xml             | 48 ++++++++++++++++
 .../virt-install-bhyve-default-f27.xml        | 35 ++++++++++++
 tests/test_cli.py                             |  9 +++
 tests/utils.py                                |  1 +
 5 files changed, 148 insertions(+)
 create mode 100644 tests/data/capabilities/bhyve-domcaps.xml
 create mode 100644 tests/data/capabilities/bhyve.xml
 create mode 100644 tests/data/cli/compare/virt-install-bhyve-default-f27.xml

diff --git a/tests/data/capabilities/bhyve-domcaps.xml b/tests/data/capabilities/bhyve-domcaps.xml
new file mode 100644
index 00000000..862122ac
--- /dev/null
+++ b/tests/data/capabilities/bhyve-domcaps.xml
@@ -0,0 +1,55 @@
+<domainCapabilities>
+  <path>/usr/sbin/bhyve</path>
+  <domain>bhyve</domain>
+  <arch>x86_64</arch>
+  <iothreads supported='no'/>
+  <os supported='yes'>
+    <loader supported='yes'>
+      <value>/usr/local/share/uefi-firmware/BHYVE_UEFI.fd</value>
+      <value>/usr/local/share/uefi-firmware/refind_x64.efi</value>
+      <enum name='type'>
+        <value>pflash</value>
+      </enum>
+      <enum name='readonly'>
+        <value>yes</value>
+      </enum>
+    </loader>
+  </os>
+  <cpu>
+    <mode name='host-passthrough' supported='no'/>
+    <mode name='host-model' supported='no'/>
+    <mode name='custom' supported='no'/>
+  </cpu>
+  <devices>
+    <disk supported='yes'>
+      <enum name='diskDevice'>
+        <value>disk</value>
+        <value>cdrom</value>
+      </enum>
+      <enum name='bus'>
+        <value>virtio</value>
+        <value>sata</value>
+      </enum>
+      <enum name='model'/>
+    </disk>
+    <graphics supported='yes'>
+      <enum name='type'>
+        <value>vnc</value>
+      </enum>
+    </graphics>
+    <video supported='yes'>
+      <enum name='modelType'>
+        <value>gop</value>
+      </enum>
+    </video>
+    <hostdev supported='no'/>
+  </devices>
+  <features>
+    <gic supported='no'/>
+    <vmcoreinfo supported='no'/>
+    <genid supported='no'/>
+    <sev supported='no'/>
+  </features>
+</domainCapabilities>
+
+
diff --git a/tests/data/capabilities/bhyve.xml b/tests/data/capabilities/bhyve.xml
new file mode 100644
index 00000000..dd06424e
--- /dev/null
+++ b/tests/data/capabilities/bhyve.xml
@@ -0,0 +1,48 @@
+<capabilities>
+
+  <host>
+    <cpu>
+      <arch>x86_64</arch>
+      <model>Skylake-Client-IBRS</model>
+      <vendor>Intel</vendor>
+      <topology sockets='1' dies='1' cores='6' threads='1'/>
+      <feature name='ds'/>
+      <feature name='acpi'/>
+      <feature name='ss'/>
+      <feature name='ht'/>
+      <feature name='tm'/>
+      <feature name='pbe'/>
+      <feature name='dtes64'/>
+      <feature name='monitor'/>
+      <feature name='ds_cpl'/>
+      <feature name='vmx'/>
+      <feature name='smx'/>
+      <feature name='est'/>
+      <feature name='tm2'/>
+      <feature name='xtpr'/>
+      <feature name='pdcm'/>
+      <feature name='osxsave'/>
+      <feature name='tsc_adjust'/>
+      <feature name='clflushopt'/>
+      <feature name='intel-pt'/>
+      <feature name='stibp'/>
+      <feature name='xsaves'/>
+      <feature name='pdpe1gb'/>
+      <feature name='invtsc'/>
+    </cpu>
+    <power_management/>
+    <iommu support='no'/>
+  </host>
+
+  <guest>
+    <os_type>hvm</os_type>
+    <arch name='x86_64'>
+      <wordsize>64</wordsize>
+      <emulator>bhyve</emulator>
+      <domain type='bhyve'/>
+    </arch>
+  </guest>
+
+</capabilities>
+
+
diff --git a/tests/data/cli/compare/virt-install-bhyve-default-f27.xml b/tests/data/cli/compare/virt-install-bhyve-default-f27.xml
new file mode 100644
index 00000000..a0106888
--- /dev/null
+++ b/tests/data/cli/compare/virt-install-bhyve-default-f27.xml
@@ -0,0 +1,35 @@
+<domain type="bhyve">
+  <name>foobhyve</name>
+  <uuid>00000000-1111-2222-3333-444444444444</uuid>
+  <metadata>
+    <libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0">
+      <libosinfo:os id="http://fedoraproject.org/fedora/27"/>
+    </libosinfo:libosinfo>
+  </metadata>
+  <memory>65536</memory>
+  <currentMemory>65536</currentMemory>
+  <vcpu>2</vcpu>
+  <os>
+    <type arch="x86_64">hvm</type>
+    <boot dev="hd"/>
+  </os>
+  <clock offset="utc"/>
+  <devices>
+    <emulator>bhyve</emulator>
+    <disk type="file" device="disk">
+      <source file="/var/lib/libvirt/images/foobhyve.img"/>
+      <target dev="hda" bus="ide"/>
+    </disk>
+    <interface type="bridge">
+      <source bridge="testsuitebr0"/>
+      <mac address="00:11:22:33:44:55"/>
+      <model type="e1000"/>
+    </interface>
+    <console type="pty"/>
+    <input type="tablet" bus="usb"/>
+    <graphics type="vnc" port="-1"/>
+    <video>
+      <model type="vga"/>
+    </video>
+  </devices>
+</domain>
diff --git a/tests/test_cli.py b/tests/test_cli.py
index 7056a05f..455f90f2 100644
--- a/tests/test_cli.py
+++ b/tests/test_cli.py
@@ -1115,6 +1115,15 @@ c.add_compare("""
 
 
 
+########################
+# bhyve specific tests #
+########################
+
+c = vinst.add_category("bhyve", "--name foobhyve --noautoconsole --connect " + utils.URIs.bhyve)
+c.add_compare("--os-variant fedora27", "bhyve-default-f27")
+
+
+
 
 #####################################
 # Device option back compat testing #
diff --git a/tests/utils.py b/tests/utils.py
index 16ba26b4..802d6590 100644
--- a/tests/utils.py
+++ b/tests/utils.py
@@ -84,6 +84,7 @@ class _URIs(object):
         self.xen = _m("xen:///") + _caps("xen-rhel5.4.xml")
         self.lxc = _m("lxc:///") + _caps("lxc.xml")
         self.vz = _m("vz:///") + _caps("vz.xml")
+        self.bhyve = _m("bhyve:///") + _caps("bhyve.xml") + _domcaps("bhyve-domcaps.xml")
 
         _uri_qemu = _m("qemu:///system")
         _kvm_x86_caps = _caps("kvm-x86_64.xml") + _domcaps("kvm-x86_64-domcaps.xml")
-- 
2.30.0




More information about the virt-tools-list mailing list