tests: More bhyve UEFI testing

Signed-off-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
Cole Robinson 2021-02-15 13:36:40 -05:00
parent 1bcd442bfd
commit d304a9b205
3 changed files with 65 additions and 8 deletions

View File

@ -0,0 +1,59 @@
<domain type="bhyve">
<name>foobhyve</name>
<uuid>00000000-1111-2222-3333-444444444444</uuid>
<memory>262144</memory>
<currentMemory>262144</currentMemory>
<vcpu>1</vcpu>
<os>
<type arch="x86_64">hvm</type>
<loader readonly="yes" type="pflash">/usr/local/share/uefi-firmware/BHYVE_UEFI.fd</loader>
<boot dev="network"/>
</os>
<clock offset="utc"/>
<on_reboot>destroy</on_reboot>
<devices>
<emulator>bhyve</emulator>
<interface type="bridge">
<source bridge="testsuitebr0"/>
<mac address="00:11:22:33:44:55"/>
<model type="e1000"/>
</interface>
<console type="nmdm">
<source master="/dev/nmdm00000000-1111-2222-3333-444444444444A" slave="/dev/nmdm00000000-1111-2222-3333-444444444444B"/>
</console>
<input type="tablet" bus="usb"/>
<graphics type="vnc" port="-1"/>
<video>
<model type="vga"/>
</video>
</devices>
</domain>
<domain type="bhyve">
<name>foobhyve</name>
<uuid>00000000-1111-2222-3333-444444444444</uuid>
<memory>262144</memory>
<currentMemory>262144</currentMemory>
<vcpu>1</vcpu>
<os>
<type arch="x86_64">hvm</type>
<loader readonly="yes" type="pflash">/usr/local/share/uefi-firmware/BHYVE_UEFI.fd</loader>
<boot dev="network"/>
</os>
<clock offset="utc"/>
<devices>
<emulator>bhyve</emulator>
<interface type="bridge">
<source bridge="testsuitebr0"/>
<mac address="00:11:22:33:44:55"/>
<model type="e1000"/>
</interface>
<console type="nmdm">
<source master="/dev/nmdm00000000-1111-2222-3333-444444444444A" slave="/dev/nmdm00000000-1111-2222-3333-444444444444B"/>
</console>
<input type="tablet" bus="usb"/>
<graphics type="vnc" port="-1"/>
<video>
<model type="vga"/>
</video>
</devices>
</domain>

View File

@ -1120,7 +1120,8 @@ c.add_compare("""
########################
c = vinst.add_category("bhyve", "--name foobhyve --noautoconsole --connect " + utils.URIs.bhyve)
c.add_compare("--os-variant fedora27 --boot uefi", "bhyve-default-f27")
c.add_compare("--boot uefi --disk none --ram 256 --pxe", "bhyve-uefi")
c.add_compare("--os-variant fedora27", "bhyve-default-f27")

View File

@ -211,20 +211,17 @@ class DomainCapabilities(XMLBuilder):
if not self.arch_can_uefi():
return # pragma: no cover
firmware_files = [f.value for f in self.os.loader.values]
if self.conn.is_bhyve():
firmware_files = [f.value for f in self.os.loader.values]
if not firmware_files:
return
for firmware_file in firmware_files:
if 'BHYVE_UEFI.fd' in firmware_file:
return firmware_file
return firmware_files[0]
return (firmware_files and
firmware_files[0] or None) # pragma: no cover
patterns = self._uefi_arch_patterns.get(self.arch)
for pattern in patterns:
for path in [v.value for v in self.os.loader.values]:
for path in firmware_files:
if re.match(pattern, path):
return path