Skip to content

Commit de3083a

Browse files
committed
test: add FreeBSD/PVH boottest
Adds a test that attempts to boot a FreeBSD microvm inside of firecracker. FreeBSD boots using PVH, so this is implicitly also a test of the PVH support. Signed-off-by: Patrick Roy <[email protected]>
1 parent ab1f718 commit de3083a

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import pytest
2+
3+
from framework import defs
4+
from framework.properties import global_props
5+
6+
pytestmark = pytest.mark.skipif(
7+
global_props.cpu_architecture != "x86_64", reason="x86_64 specific tests"
8+
)
9+
10+
11+
@pytest.fixture
12+
def uvm_freebsd(microvm_factory):
13+
"""Create a FreeBSD microVM"""
14+
15+
# Cant use the rootfs_fxt and guest_kernel_fxt, because they only allow us to get supported kernels (and I am
16+
# reluctant to add a freebsd regex to the list of supported kernels)
17+
return microvm_factory.build(
18+
defs.ARTIFACT_DIR / "freebsd/freebsd-kern.bin",
19+
defs.ARTIFACT_DIR / "freebsd/freebsd-rootfs.bin",
20+
)
21+
22+
23+
def test_freebsd_pvh_boot(uvm_freebsd):
24+
"""Tries to boot a FreeBSD microVM"""
25+
26+
uvm_freebsd.spawn()
27+
uvm_freebsd.basic_config(boot_args="vfs.root.mountfrom=ufs:/dev/vtbd0")
28+
uvm_freebsd.start()

0 commit comments

Comments
 (0)