aboutsummaryrefslogtreecommitdiff
path: root/support/testing/tests/core
diff options
context:
space:
mode:
Diffstat (limited to 'support/testing/tests/core')
-rw-r--r--support/testing/tests/core/cpeid-br2-external/Config.in0
-rw-r--r--support/testing/tests/core/cpeid-br2-external/external.desc1
-rw-r--r--support/testing/tests/core/cpeid-br2-external/external.mk1
-rw-r--r--support/testing/tests/core/cpeid-br2-external/package/cpe-id-pkg1/cpe-id-pkg1.mk4
-rw-r--r--support/testing/tests/core/cpeid-br2-external/package/cpe-id-pkg2/cpe-id-pkg2.mk3
-rw-r--r--support/testing/tests/core/cpeid-br2-external/package/cpe-id-pkg3/cpe-id-pkg3.mk5
-rw-r--r--support/testing/tests/core/cpeid-br2-external/package/cpe-id-pkg4/cpe-id-pkg4.mk9
-rw-r--r--support/testing/tests/core/cpeid-br2-external/package/cpe-id-pkg5/cpe-id-pkg5.mk16
-rw-r--r--support/testing/tests/core/test_cpeid.py110
-rw-r--r--support/testing/tests/core/test_file_capabilities.py2
-rw-r--r--support/testing/tests/core/test_hardening.py1
-rw-r--r--support/testing/tests/core/test_selinux.py86
-rw-r--r--support/testing/tests/core/test_selinux/br2_external/Config.in1
-rw-r--r--support/testing/tests/core/test_selinux/br2_external/external.desc1
-rw-r--r--support/testing/tests/core/test_selinux/br2_external/external.mk1
-rw-r--r--support/testing/tests/core/test_selinux/br2_external/package/selinux-test/Config.in4
-rw-r--r--support/testing/tests/core/test_selinux/br2_external/package/selinux-test/selinux-test.mk9
-rw-r--r--support/testing/tests/core/test_selinux/br2_external/package/selinux-test/selinux/buildroot.fc0
-rw-r--r--support/testing/tests/core/test_selinux/br2_external/package/selinux-test/selinux/buildroot.if1
-rw-r--r--support/testing/tests/core/test_selinux/br2_external/package/selinux-test/selinux/buildroot.te3
-rw-r--r--support/testing/tests/core/test_selinux/extra_modules/buildroot.fc0
-rw-r--r--support/testing/tests/core/test_selinux/extra_modules/buildroot.if1
-rw-r--r--support/testing/tests/core/test_selinux/extra_modules/buildroot.te3
23 files changed, 261 insertions, 1 deletions
diff --git a/support/testing/tests/core/cpeid-br2-external/Config.in b/support/testing/tests/core/cpeid-br2-external/Config.in
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/support/testing/tests/core/cpeid-br2-external/Config.in
diff --git a/support/testing/tests/core/cpeid-br2-external/external.desc b/support/testing/tests/core/cpeid-br2-external/external.desc
new file mode 100644
index 0000000000..d19ae79e7a
--- /dev/null
+++ b/support/testing/tests/core/cpeid-br2-external/external.desc
@@ -0,0 +1 @@
+name: CPE_ID
diff --git a/support/testing/tests/core/cpeid-br2-external/external.mk b/support/testing/tests/core/cpeid-br2-external/external.mk
new file mode 100644
index 0000000000..47492d7f82
--- /dev/null
+++ b/support/testing/tests/core/cpeid-br2-external/external.mk
@@ -0,0 +1 @@
+include $(sort $(wildcard $(BR2_EXTERNAL_CPE_ID_PATH)/package/*/*.mk))
diff --git a/support/testing/tests/core/cpeid-br2-external/package/cpe-id-pkg1/cpe-id-pkg1.mk b/support/testing/tests/core/cpeid-br2-external/package/cpe-id-pkg1/cpe-id-pkg1.mk
new file mode 100644
index 0000000000..5e7460286b
--- /dev/null
+++ b/support/testing/tests/core/cpeid-br2-external/package/cpe-id-pkg1/cpe-id-pkg1.mk
@@ -0,0 +1,4 @@
+CPE_ID_PKG1_VERSION = 42
+
+$(eval $(generic-package))
+$(eval $(host-generic-package))
diff --git a/support/testing/tests/core/cpeid-br2-external/package/cpe-id-pkg2/cpe-id-pkg2.mk b/support/testing/tests/core/cpeid-br2-external/package/cpe-id-pkg2/cpe-id-pkg2.mk
new file mode 100644
index 0000000000..12b3f3223f
--- /dev/null
+++ b/support/testing/tests/core/cpeid-br2-external/package/cpe-id-pkg2/cpe-id-pkg2.mk
@@ -0,0 +1,3 @@
+CPE_ID_PKG2_VERSION = 67
+
+$(eval $(host-generic-package))
diff --git a/support/testing/tests/core/cpeid-br2-external/package/cpe-id-pkg3/cpe-id-pkg3.mk b/support/testing/tests/core/cpeid-br2-external/package/cpe-id-pkg3/cpe-id-pkg3.mk
new file mode 100644
index 0000000000..5added78df
--- /dev/null
+++ b/support/testing/tests/core/cpeid-br2-external/package/cpe-id-pkg3/cpe-id-pkg3.mk
@@ -0,0 +1,5 @@
+CPE_ID_PKG3_VERSION = 67
+CPE_ID_PKG3_CPE_ID_VALID = YES
+
+$(eval $(generic-package))
+$(eval $(host-generic-package))
diff --git a/support/testing/tests/core/cpeid-br2-external/package/cpe-id-pkg4/cpe-id-pkg4.mk b/support/testing/tests/core/cpeid-br2-external/package/cpe-id-pkg4/cpe-id-pkg4.mk
new file mode 100644
index 0000000000..557acff8a2
--- /dev/null
+++ b/support/testing/tests/core/cpeid-br2-external/package/cpe-id-pkg4/cpe-id-pkg4.mk
@@ -0,0 +1,9 @@
+CPE_ID_PKG4_VERSION = 67
+CPE_ID_PKG4_CPE_ID_VENDOR = foo
+CPE_ID_PKG4_CPE_ID_PRODUCT = bar
+CPE_ID_PKG4_CPE_ID_VERSION = 42
+CPE_ID_PKG4_CPE_ID_UPDATE = b2
+CPE_ID_PKG4_CPE_ID_PREFIX = cpe:2.4:a
+
+$(eval $(generic-package))
+$(eval $(host-generic-package))
diff --git a/support/testing/tests/core/cpeid-br2-external/package/cpe-id-pkg5/cpe-id-pkg5.mk b/support/testing/tests/core/cpeid-br2-external/package/cpe-id-pkg5/cpe-id-pkg5.mk
new file mode 100644
index 0000000000..d0db5f03fe
--- /dev/null
+++ b/support/testing/tests/core/cpeid-br2-external/package/cpe-id-pkg5/cpe-id-pkg5.mk
@@ -0,0 +1,16 @@
+CPE_ID_PKG5_VERSION = 57
+
+CPE_ID_PKG5_CPE_ID_VENDOR = foo
+CPE_ID_PKG5_CPE_ID_PRODUCT = bar
+CPE_ID_PKG5_CPE_ID_VERSION = 42
+CPE_ID_PKG5_CPE_ID_UPDATE = b2
+CPE_ID_PKG5_CPE_ID_PREFIX = cpe:2.4:a
+
+HOST_CPE_ID_PKG5_CPE_ID_VENDOR = baz
+HOST_CPE_ID_PKG5_CPE_ID_PRODUCT = fuz
+HOST_CPE_ID_PKG5_CPE_ID_VERSION = 43
+HOST_CPE_ID_PKG5_CPE_ID_UPDATE = b3
+HOST_CPE_ID_PKG5_CPE_ID_PREFIX = cpe:2.5:a
+
+$(eval $(generic-package))
+$(eval $(host-generic-package))
diff --git a/support/testing/tests/core/test_cpeid.py b/support/testing/tests/core/test_cpeid.py
new file mode 100644
index 0000000000..190f0306e5
--- /dev/null
+++ b/support/testing/tests/core/test_cpeid.py
@@ -0,0 +1,110 @@
+import infra
+import subprocess
+import json
+
+
+class CpeIdTest(infra.basetest.BRConfigTest):
+ config = ""
+ br2_external = [infra.filepath("tests/core/cpeid-br2-external")]
+
+ def get_vars(self, var):
+ cmd = ["make", "--no-print-directory", "-C", self.b.builddir,
+ "VARS=%s%%" % var, "printvars"]
+ lines = subprocess.check_output(cmd).splitlines()
+ return dict([str(x, "utf-8").split("=") for x in lines])
+
+ def get_json(self, pkg):
+ cmd = ["make", "--no-print-directory", "-C", self.b.builddir,
+ "%s-show-info" % pkg]
+ return json.loads(subprocess.check_output(cmd))
+
+ def test_pkg1(self):
+ # this package has no CPE ID information, it should not have
+ # any CPE_ID variable defined.
+ pkg_vars = self.get_vars("CPE_ID_PKG1_CPE_ID")
+ cpe_vars = ["CPE_ID_VALID", "CPE_ID_PRODUCT", "CPE_ID_VERSION", "CPE_ID_UPDATE",
+ "CPE_ID_PREFIX", "CPE_ID"]
+ for v in cpe_vars:
+ self.assertNotIn("CPE_ID_PKG1_%s" % v, pkg_vars)
+ pkg_json = self.get_json("cpe-id-pkg1")
+ self.assertNotIn("cpe-id", pkg_json['cpe-id-pkg1'])
+
+ pkg_vars = self.get_vars("HOST_CPE_ID_PKG1_CPE_ID")
+ for v in cpe_vars:
+ self.assertNotIn("HOST_CPE_ID_PKG1_%s" % v, pkg_vars)
+ pkg_json = self.get_json("host-cpe-id-pkg1")
+ self.assertNotIn("cpe-id", pkg_json['host-cpe-id-pkg1'])
+
+ def test_pkg2(self):
+ # this package has no CPE ID information, it should not have
+ # any CPE_ID variable defined.
+ pkg_vars = self.get_vars("HOST_CPE_ID_PKG2_CPE_ID")
+ cpe_vars = ["CPE_ID_VALID", "CPE_ID_PRODUCT", "CPE_ID_VERSION", "CPE_ID_UPDATE",
+ "CPE_ID_PREFIX", "CPE_ID"]
+ for v in cpe_vars:
+ self.assertNotIn("HOST_CPE_ID_PKG2_%s" % v, pkg_vars)
+ pkg_json = self.get_json("host-cpe-id-pkg2")
+ self.assertNotIn("cpe-id", pkg_json['host-cpe-id-pkg2'])
+
+ def test_pkg3(self):
+ # this package has just <pkg>_CPE_ID_VALID defined, so verify
+ # it has the default CPE_ID value, and that inheritance of the
+ # values for the host package is working
+ pkg_vars = self.get_vars("CPE_ID_PKG3_CPE_ID")
+ self.assertEqual(pkg_vars["CPE_ID_PKG3_CPE_ID"],
+ "cpe:2.3:a:cpe-id-pkg3_project:cpe-id-pkg3:67:*:*:*:*:*:*:*")
+ self.assertEqual(pkg_vars["CPE_ID_PKG3_CPE_ID_VALID"], "YES")
+ pkg_json = self.get_json("cpe-id-pkg3")
+ self.assertEqual(pkg_json['cpe-id-pkg3']['cpe-id'],
+ "cpe:2.3:a:cpe-id-pkg3_project:cpe-id-pkg3:67:*:*:*:*:*:*:*")
+
+ pkg_vars = self.get_vars("HOST_CPE_ID_PKG3_CPE_ID")
+ self.assertEqual(pkg_vars["HOST_CPE_ID_PKG3_CPE_ID"],
+ "cpe:2.3:a:cpe-id-pkg3_project:cpe-id-pkg3:67:*:*:*:*:*:*:*")
+ self.assertEqual(pkg_vars["HOST_CPE_ID_PKG3_CPE_ID_VALID"], "YES")
+ pkg_json = self.get_json("host-cpe-id-pkg3")
+ self.assertEqual(pkg_json['host-cpe-id-pkg3']['cpe-id'],
+ "cpe:2.3:a:cpe-id-pkg3_project:cpe-id-pkg3:67:*:*:*:*:*:*:*")
+
+ def test_pkg4(self):
+ # this package defines
+ # <pkg>_CPE_ID_{VENDOR,PRODUCT,VERSION,UPDATE,PREFIX},
+ # make sure we get the computed <pkg>_CPE_ID, and that it is
+ # inherited by the host variant
+ pkg_vars = self.get_vars("CPE_ID_PKG4_CPE_ID")
+ self.assertEqual(pkg_vars["CPE_ID_PKG4_CPE_ID"],
+ "cpe:2.4:a:foo:bar:42:b2:*:*:*:*:*:*")
+ self.assertEqual(pkg_vars["CPE_ID_PKG4_CPE_ID_VALID"], "YES")
+ pkg_json = self.get_json("cpe-id-pkg4")
+ self.assertEqual(pkg_json['cpe-id-pkg4']['cpe-id'],
+ "cpe:2.4:a:foo:bar:42:b2:*:*:*:*:*:*")
+
+ pkg_vars = self.get_vars("HOST_CPE_ID_PKG4_CPE_ID")
+ self.assertEqual(pkg_vars["HOST_CPE_ID_PKG4_CPE_ID"],
+ "cpe:2.4:a:foo:bar:42:b2:*:*:*:*:*:*")
+ self.assertEqual(pkg_vars["HOST_CPE_ID_PKG4_CPE_ID_VALID"], "YES")
+ pkg_json = self.get_json("host-cpe-id-pkg4")
+ self.assertEqual(pkg_json['host-cpe-id-pkg4']['cpe-id'],
+ "cpe:2.4:a:foo:bar:42:b2:*:*:*:*:*:*")
+
+ def test_pkg5(self):
+ # this package defines
+ # <pkg>_CPE_ID_{VENDOR,PRODUCT,VERSION,UPDATE,PREFIX} and
+ # HOST_<pkg>_CPE_ID_{VENDOR,PRODUCT,VERSION,UPDATE,PREFIX}
+ # separately, with different values. Make sure we get the
+ # right <pkg>_CPE_ID and HOST_<pkg>_CPE_ID values.
+ pkg_vars = self.get_vars("CPE_ID_PKG5_CPE_ID")
+ self.assertEqual(pkg_vars["CPE_ID_PKG5_CPE_ID"],
+ "cpe:2.4:a:foo:bar:42:b2:*:*:*:*:*:*")
+ self.assertEqual(pkg_vars["CPE_ID_PKG5_CPE_ID_VALID"], "YES")
+ pkg_json = self.get_json("cpe-id-pkg5")
+ self.assertEqual(pkg_json['cpe-id-pkg5']['cpe-id'],
+ "cpe:2.4:a:foo:bar:42:b2:*:*:*:*:*:*")
+
+ pkg_vars = self.get_vars("HOST_CPE_ID_PKG5_CPE_ID")
+ self.assertEqual(pkg_vars["HOST_CPE_ID_PKG5_CPE_ID"],
+ "cpe:2.5:a:baz:fuz:43:b3:*:*:*:*:*:*")
+ self.assertEqual(pkg_vars["HOST_CPE_ID_PKG5_CPE_ID_VALID"], "YES")
+ pkg_json = self.get_json("host-cpe-id-pkg5")
+ self.assertEqual(pkg_json['host-cpe-id-pkg5']['cpe-id'],
+ "cpe:2.5:a:baz:fuz:43:b3:*:*:*:*:*:*")
diff --git a/support/testing/tests/core/test_file_capabilities.py b/support/testing/tests/core/test_file_capabilities.py
index 945b48a4c3..b9ece18d7b 100644
--- a/support/testing/tests/core/test_file_capabilities.py
+++ b/support/testing/tests/core/test_file_capabilities.py
@@ -44,4 +44,4 @@ class TestFileCapabilities(infra.basetest.BRTest):
self.assertIn("cap_kill", output[0])
self.assertIn("cap_sys_nice", output[0])
self.assertIn("cap_sys_time", output[0])
- self.assertIn("+eip", output[0])
+ self.assertIn("=eip", output[0])
diff --git a/support/testing/tests/core/test_hardening.py b/support/testing/tests/core/test_hardening.py
index edfb3315db..60e14303a3 100644
--- a/support/testing/tests/core/test_hardening.py
+++ b/support/testing/tests/core/test_hardening.py
@@ -10,6 +10,7 @@ class TestHardeningBase(infra.basetest.BRTest):
BR2_powerpc64=y
BR2_powerpc_e5500=y
BR2_TOOLCHAIN_EXTERNAL=y
+ BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y
BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y
BR2_TOOLCHAIN_EXTERNAL_URL="https://toolchains.bootlin.com/downloads/releases/toolchains/powerpc64-e5500/tarballs/powerpc64-e5500--glibc--stable-2018.02-2.tar.bz2"
BR2_TOOLCHAIN_EXTERNAL_GCC_6=y
diff --git a/support/testing/tests/core/test_selinux.py b/support/testing/tests/core/test_selinux.py
new file mode 100644
index 0000000000..683a424d6f
--- /dev/null
+++ b/support/testing/tests/core/test_selinux.py
@@ -0,0 +1,86 @@
+import os
+
+import infra.basetest
+
+
+class TestSELinuxInfra(infra.basetest.BRTest):
+ config = infra.basetest.BASIC_TOOLCHAIN_CONFIG +\
+ """
+ BR2_PACKAGE_REFPOLICY=y
+ BR2_PACKAGE_PYTHON3=y
+ BR2_PACKAGE_SETOOLS=y
+ BR2_TARGET_ROOTFS_CPIO=y
+ """
+
+ def base_test_run(self):
+ cpio_file = os.path.join(self.builddir, "images", "rootfs.cpio")
+ self.emulator.boot(arch="armv5", kernel="builtin",
+ options=["-initrd", cpio_file])
+ self.emulator.login()
+
+
+class TestSELinuxExtraModules(TestSELinuxInfra):
+ config = TestSELinuxInfra.config + \
+ """
+ BR2_REFPOLICY_EXTRA_MODULES="ntp tor"
+ """
+
+ def test_run(self):
+ TestSELinuxInfra.base_test_run(self)
+
+ out, ret = self.emulator.run("seinfo -t ntpd_t", 15)
+ self.assertEqual(ret, 0)
+ self.assertEqual(out[2].strip(), "ntpd_t")
+
+ out, ret = self.emulator.run("seinfo -t tor_t", 15)
+ self.assertEqual(ret, 0)
+ self.assertEqual(out[2].strip(), "tor_t")
+
+
+class TestSELinuxExtraModulesDirs(TestSELinuxInfra):
+ config = TestSELinuxInfra.config + \
+ """
+ BR2_REFPOLICY_EXTRA_MODULES_DIRS="{}"
+ """.format(infra.filepath("tests/core/test_selinux/extra_modules"))
+
+ def test_run(self):
+ TestSELinuxInfra.base_test_run(self)
+
+ out, ret = self.emulator.run("seinfo -t buildroot_test_t", 15)
+ self.assertEqual(ret, 0)
+ self.assertEqual(out[2].strip(), "buildroot_test_t")
+
+
+class TestSELinuxCustomGit(TestSELinuxInfra):
+ config = TestSELinuxInfra.config + \
+ """
+ BR2_PACKAGE_REFPOLICY_CUSTOM_GIT=y
+ BR2_PACKAGE_REFPOLICY_CUSTOM_REPO_URL="https://github.com/SELinuxProject/refpolicy.git"
+ BR2_PACKAGE_REFPOLICY_CUSTOM_REPO_VERSION="RELEASE_2_20200818"
+ """
+
+ def test_run(self):
+ pass
+
+
+class TestSELinuxPackage(TestSELinuxInfra):
+ br2_external = [infra.filepath("tests/core/test_selinux/br2_external")]
+ config = TestSELinuxInfra.config + \
+ """
+ BR2_PACKAGE_SELINUX_TEST=y
+ """
+
+ def test_run(self):
+ TestSELinuxInfra.base_test_run(self)
+
+ out, ret = self.emulator.run("seinfo -t ntpd_t", 15)
+ self.assertEqual(ret, 0)
+ self.assertEqual(out[2].strip(), "ntpd_t")
+
+ out, ret = self.emulator.run("seinfo -t tor_t", 15)
+ self.assertEqual(ret, 0)
+ self.assertEqual(out[2].strip(), "tor_t")
+
+ out, ret = self.emulator.run("seinfo -t buildroot_test_t", 15)
+ self.assertEqual(ret, 0)
+ self.assertEqual(out[2].strip(), "buildroot_test_t")
diff --git a/support/testing/tests/core/test_selinux/br2_external/Config.in b/support/testing/tests/core/test_selinux/br2_external/Config.in
new file mode 100644
index 0000000000..9d9c84ee3c
--- /dev/null
+++ b/support/testing/tests/core/test_selinux/br2_external/Config.in
@@ -0,0 +1 @@
+source "$BR2_EXTERNAL_SELINUX_PATH/package/selinux-test/Config.in"
diff --git a/support/testing/tests/core/test_selinux/br2_external/external.desc b/support/testing/tests/core/test_selinux/br2_external/external.desc
new file mode 100644
index 0000000000..44b5b95f5b
--- /dev/null
+++ b/support/testing/tests/core/test_selinux/br2_external/external.desc
@@ -0,0 +1 @@
+name: SELINUX
diff --git a/support/testing/tests/core/test_selinux/br2_external/external.mk b/support/testing/tests/core/test_selinux/br2_external/external.mk
new file mode 100644
index 0000000000..54d2402d52
--- /dev/null
+++ b/support/testing/tests/core/test_selinux/br2_external/external.mk
@@ -0,0 +1 @@
+include $(sort $(wildcard $(BR2_EXTERNAL_SELINUX_PATH)/package/*/*.mk))
diff --git a/support/testing/tests/core/test_selinux/br2_external/package/selinux-test/Config.in b/support/testing/tests/core/test_selinux/br2_external/package/selinux-test/Config.in
new file mode 100644
index 0000000000..e30ac83105
--- /dev/null
+++ b/support/testing/tests/core/test_selinux/br2_external/package/selinux-test/Config.in
@@ -0,0 +1,4 @@
+config BR2_PACKAGE_SELINUX_TEST
+ bool "SELinux test package"
+ help
+ Test package for SELinux Buildroot helpers.
diff --git a/support/testing/tests/core/test_selinux/br2_external/package/selinux-test/selinux-test.mk b/support/testing/tests/core/test_selinux/br2_external/package/selinux-test/selinux-test.mk
new file mode 100644
index 0000000000..0100b718be
--- /dev/null
+++ b/support/testing/tests/core/test_selinux/br2_external/package/selinux-test/selinux-test.mk
@@ -0,0 +1,9 @@
+################################################################################
+#
+# SELinux test package
+#
+################################################################################
+
+SELINUX_TEST_SELINUX_MODULES = ntp tor
+
+$(eval $(generic-package))
diff --git a/support/testing/tests/core/test_selinux/br2_external/package/selinux-test/selinux/buildroot.fc b/support/testing/tests/core/test_selinux/br2_external/package/selinux-test/selinux/buildroot.fc
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/support/testing/tests/core/test_selinux/br2_external/package/selinux-test/selinux/buildroot.fc
diff --git a/support/testing/tests/core/test_selinux/br2_external/package/selinux-test/selinux/buildroot.if b/support/testing/tests/core/test_selinux/br2_external/package/selinux-test/selinux/buildroot.if
new file mode 100644
index 0000000000..acf797e604
--- /dev/null
+++ b/support/testing/tests/core/test_selinux/br2_external/package/selinux-test/selinux/buildroot.if
@@ -0,0 +1 @@
+## <summary>Buildroot rules</summary>
diff --git a/support/testing/tests/core/test_selinux/br2_external/package/selinux-test/selinux/buildroot.te b/support/testing/tests/core/test_selinux/br2_external/package/selinux-test/selinux/buildroot.te
new file mode 100644
index 0000000000..266bc03be0
--- /dev/null
+++ b/support/testing/tests/core/test_selinux/br2_external/package/selinux-test/selinux/buildroot.te
@@ -0,0 +1,3 @@
+policy_module(buildroot, 1.0.0)
+
+type buildroot_test_t;
diff --git a/support/testing/tests/core/test_selinux/extra_modules/buildroot.fc b/support/testing/tests/core/test_selinux/extra_modules/buildroot.fc
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/support/testing/tests/core/test_selinux/extra_modules/buildroot.fc
diff --git a/support/testing/tests/core/test_selinux/extra_modules/buildroot.if b/support/testing/tests/core/test_selinux/extra_modules/buildroot.if
new file mode 100644
index 0000000000..acf797e604
--- /dev/null
+++ b/support/testing/tests/core/test_selinux/extra_modules/buildroot.if
@@ -0,0 +1 @@
+## <summary>Buildroot rules</summary>
diff --git a/support/testing/tests/core/test_selinux/extra_modules/buildroot.te b/support/testing/tests/core/test_selinux/extra_modules/buildroot.te
new file mode 100644
index 0000000000..266bc03be0
--- /dev/null
+++ b/support/testing/tests/core/test_selinux/extra_modules/buildroot.te
@@ -0,0 +1,3 @@
+policy_module(buildroot, 1.0.0)
+
+type buildroot_test_t;