Skip to content

Commit 46dd797

Browse files
committed
test(jailer): add integration test for --landlock-restrict-fs flag
Verify that Firecracker boots and runs correctly when the jailer is started with --landlock-restrict-fs. On kernels without Landlock support the flag has no effect so the test passes regardless. Signed-off-by: Pavitra Bhalla <pavitra@superserve.ai>
1 parent a76cebb commit 46dd797

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

tests/integration_tests/security/test_jail.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -748,3 +748,21 @@ def test_cgroupsv2_written_only_once(uvm_plain, cgroups_info):
748748
assert len(write_lines) == 1
749749
assert len(mkdir_lines) != len(cgroups), "mkdir equal to number of cgroups"
750750
assert len(mkdir_lines) == 1
751+
752+
753+
def test_landlock_restrict_fs(uvm_plain):
754+
"""
755+
Test that Firecracker runs normally when the jailer is started with the
756+
--landlock-restrict-fs flag.
757+
758+
This exercises the happy path: the jailer applies Landlock filesystem
759+
restrictions (or silently skips them on kernels < 5.13) and Firecracker
760+
boots and runs correctly within the jail.
761+
"""
762+
microvm = uvm_plain
763+
microvm.jailer.landlock = True
764+
microvm.spawn()
765+
microvm.basic_config()
766+
microvm.add_net_iface()
767+
microvm.start()
768+
microvm.kill()

0 commit comments

Comments
 (0)