File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
tests/integration_tests/security Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -664,3 +664,29 @@ def test_cgroupsv2_written_only_once(uvm_plain, cgroups_info):
664
664
assert len (write_lines ) == 1
665
665
assert len (mkdir_lines ) != len (cgroups ), "mkdir equal to number of cgroups"
666
666
assert len (mkdir_lines ) == 1
667
+
668
+
669
+ def test_mount_proagation_to_root (uvm_plain , tmp_path ):
670
+ """
671
+ Test that the jailer mounts are propagated to the root mount namespace which
672
+ in this case is "SLAVE".
673
+
674
+ https://github.com/firecracker-microvm/firecracker/pull/1093
675
+ """
676
+ test_microvm = uvm_plain
677
+
678
+ # Setup the environment
679
+ pseudo_root_path = tmp_path / "pseudo_root"
680
+ pseudo_root_path .mkdir ()
681
+
682
+ test_microvm .jailer .exec_file = test_microvm .fc_binary_path
683
+ test_microvm .jailer .extra_args = {"chroot-base-dir" : str (pseudo_root_path )}
684
+
685
+ # Execute the test scenario
686
+ test_microvm .spawn ()
687
+
688
+ # Perform checks and assertions
689
+ mount_info = subprocess .check_output (["mount" ]).decode ()
690
+ assert "shared" in mount_info or "slave" in mount_info , (
691
+ "Mount propagation type is not SLAVE"
692
+ )
You can’t perform that action at this time.
0 commit comments