Skip to content

Commit

Permalink
test: add FreeBSD/PVH boottest
Browse files Browse the repository at this point in the history
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 <roypat@amazon.co.uk>
  • Loading branch information
roypat committed Aug 24, 2023
1 parent ab1f718 commit de3083a
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions tests/integration_tests/functional/test_pvh.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import pytest

from framework import defs
from framework.properties import global_props

pytestmark = pytest.mark.skipif(
global_props.cpu_architecture != "x86_64", reason="x86_64 specific tests"
)


@pytest.fixture
def uvm_freebsd(microvm_factory):
"""Create a FreeBSD microVM"""

# Cant use the rootfs_fxt and guest_kernel_fxt, because they only allow us to get supported kernels (and I am
# reluctant to add a freebsd regex to the list of supported kernels)
return microvm_factory.build(
defs.ARTIFACT_DIR / "freebsd/freebsd-kern.bin",
defs.ARTIFACT_DIR / "freebsd/freebsd-rootfs.bin",
)


def test_freebsd_pvh_boot(uvm_freebsd):
"""Tries to boot a FreeBSD microVM"""

uvm_freebsd.spawn()
uvm_freebsd.basic_config(boot_args="vfs.root.mountfrom=ufs:/dev/vtbd0")
uvm_freebsd.start()

0 comments on commit de3083a

Please sign in to comment.