@@ -40,3 +40,24 @@ class TestSELinuxExt4(TestSELinux):
self.wait_boot()
self.run_tests()
+
+class TestSELinuxSquashfs(TestSELinux):
+ config = TestSELinux.config + \
+ """
+ BR2_TARGET_ROOTFS_SQUASHFS=y
+ BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="{}"
+ """.format(
+ infra.filepath("tests/boot/test_selinux/linux-squashfs.fragment"),
+ )
+
+ def test_run(self):
+ kernel = os.path.join(self.builddir, "images", "bzImage")
+ rootfs = os.path.join(self.builddir, "images", "rootfs.squashfs")
+
+ self.emulator.boot(arch="x86_64", kernel=kernel,
+ kernel_cmdline=["root=/dev/vda", "rootfstype=squashfs",
+ "console=ttyS0", "security=selinux"],
+ options=["-drive", "file={},if=virtio,format=raw".format(rootfs)])
+
+ self.wait_boot()
+ self.run_tests()
new file mode 100644
@@ -0,0 +1 @@
+CONFIG_SQUASHFS=y
Add a test called 'SELinuxSquashfs' which will perform the same tests as the Ext4 version, but using a Squashfs filesystem. Thanks to this, we'll have a test on a real only filesystem. Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com> --- support/testing/tests/boot/test_selinux.py | 21 +++++++++++++++++++ .../boot/test_selinux/linux-squashfs.fragment | 1 + 2 files changed, 22 insertions(+) create mode 100644 support/testing/tests/boot/test_selinux/linux-squashfs.fragment