diff options
Diffstat (limited to 'support/testing/tests')
48 files changed, 680 insertions, 50 deletions
diff --git a/support/testing/tests/boot/test_atf.py b/support/testing/tests/boot/test_atf.py index 08a0b7af2a..e6c11aa742 100644 --- a/support/testing/tests/boot/test_atf.py +++ b/support/testing/tests/boot/test_atf.py @@ -41,9 +41,11 @@ class TestATFAllwinner(infra.basetest.BRTest): BR2_TARGET_UBOOT=y BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y BR2_TARGET_UBOOT_CUSTOM_VERSION=y - BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2017.11" + BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2020.10" BR2_TARGET_UBOOT_BOARD_DEFCONFIG="bananapi_m64" BR2_TARGET_UBOOT_NEEDS_DTC=y + BR2_TARGET_UBOOT_NEEDS_PYTHON3=y + BR2_TARGET_UBOOT_NEEDS_PYLIBFDT=y BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y BR2_TARGET_UBOOT_FORMAT_CUSTOM=y BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME="u-boot.itb" @@ -53,30 +55,3 @@ class TestATFAllwinner(infra.basetest.BRTest): def test_run(self): pass - - -class TestATFMarvell(infra.basetest.BRTest): - config = \ - """ - BR2_aarch64=y - BR2_TOOLCHAIN_EXTERNAL=y - BR2_TOOLCHAIN_EXTERNAL_LINARO_AARCH64=y - BR2_TARGET_ARM_TRUSTED_FIRMWARE=y - BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_GIT=y - BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_REPO_URL="https://github.com/MarvellEmbeddedProcessors/atf-marvell.git" - BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_REPO_VERSION="711ecd32afe465b38052b5ba374c825b158eea18" - BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM="a80x0_mcbin" - BR2_TARGET_ARM_TRUSTED_FIRMWARE_FIP=y - BR2_TARGET_ARM_TRUSTED_FIRMWARE_UBOOT_AS_BL33=y - BR2_TARGET_ARM_TRUSTED_FIRMWARE_ADDITIONAL_VARIABLES="USE_COHERENT_MEM=0" - BR2_TARGET_BINARIES_MARVELL=y - BR2_TARGET_MV_DDR_MARVELL=y - BR2_TARGET_UBOOT=y - BR2_TARGET_UBOOT_BOARDNAME="mvebu_mcbin-88f8040" - BR2_TARGET_UBOOT_CUSTOM_VERSION=y - BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2018.09" - BR2_TARGET_UBOOT_NEEDS_DTC=y - """ - - def test_run(self): - pass diff --git a/support/testing/tests/boot/test_syslinux.py b/support/testing/tests/boot/test_syslinux.py index f25cddfb6c..467d564e18 100644 --- a/support/testing/tests/boot/test_syslinux.py +++ b/support/testing/tests/boot/test_syslinux.py @@ -6,6 +6,7 @@ class TestSysLinuxBase(infra.basetest.BRTest): """ BR2_x86_i686=y BR2_TOOLCHAIN_EXTERNAL=y + BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y BR2_TOOLCHAIN_EXTERNAL_URL="http://toolchains.bootlin.com/downloads/releases/toolchains/x86-i686/tarballs/x86-i686--glibc--bleeding-edge-2018.11-1.tar.bz2" BR2_TOOLCHAIN_EXTERNAL_GCC_8=y 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; diff --git a/support/testing/tests/download/br2-external/git-hash/package/bad/bad.hash b/support/testing/tests/download/br2-external/git-hash/package/bad/bad.hash index b9e1baec84..b44b1f8255 100644 --- a/support/testing/tests/download/br2-external/git-hash/package/bad/bad.hash +++ b/support/testing/tests/download/br2-external/git-hash/package/bad/bad.hash @@ -1 +1 @@ -sha256 0000000000000000000000000000000000000000000000000000000000000000 bad-a238b1dfcd825d47d834af3c5223417c8411d90d.tar.gz +sha256 0000000000000000000000000000000000000000000000000000000000000000 bad-a238b1dfcd825d47d834af3c5223417c8411d90d-br1.tar.gz diff --git a/support/testing/tests/download/br2-external/git-hash/package/good/good.hash b/support/testing/tests/download/br2-external/git-hash/package/good/good.hash index 9e92ab8ab9..fc3f60dafd 100644 --- a/support/testing/tests/download/br2-external/git-hash/package/good/good.hash +++ b/support/testing/tests/download/br2-external/git-hash/package/good/good.hash @@ -1 +1 @@ -sha256 d00ae598e9e770d607621a86766030b42eaa58156cb8d482b043969da7963c23 good-a238b1dfcd825d47d834af3c5223417c8411d90d.tar.gz +sha256 682ad1f39f258bfb35e26f213f3798f44bb8105bb55fad47bdc003113765b650 good-a238b1dfcd825d47d834af3c5223417c8411d90d-br1.tar.gz diff --git a/support/testing/tests/download/br2-external/git-refs/package/git-partial-sha1-branch-head/git-partial-sha1-branch-head.hash b/support/testing/tests/download/br2-external/git-refs/package/git-partial-sha1-branch-head/git-partial-sha1-branch-head.hash index 648bcceca0..26a6b358e2 100644 --- a/support/testing/tests/download/br2-external/git-refs/package/git-partial-sha1-branch-head/git-partial-sha1-branch-head.hash +++ b/support/testing/tests/download/br2-external/git-refs/package/git-partial-sha1-branch-head/git-partial-sha1-branch-head.hash @@ -1,2 +1,2 @@ -sha256 70b76187369e47db69dac02c5696e63b35199cd20490fa473d289dd377774613 git-partial-sha1-branch-head-68c197d0879d485f4f6c.tar.gz +sha256 c27041b3e874beb0d0218158e7d6507ad1515b684de5eed5fabd0f7205e9718e git-partial-sha1-branch-head-68c197d0879d485f4f6c-br1.tar.gz sha256 2c1126513651b0d346a4e6d1bb75ac1c9999217e18026302d27bea47b06c7fb2 file diff --git a/support/testing/tests/download/br2-external/git-refs/package/git-partial-sha1-reachable-by-branch/git-partial-sha1-reachable-by-branch.hash b/support/testing/tests/download/br2-external/git-refs/package/git-partial-sha1-reachable-by-branch/git-partial-sha1-reachable-by-branch.hash index d064362e2c..ab1edc73a8 100644 --- a/support/testing/tests/download/br2-external/git-refs/package/git-partial-sha1-reachable-by-branch/git-partial-sha1-reachable-by-branch.hash +++ b/support/testing/tests/download/br2-external/git-refs/package/git-partial-sha1-reachable-by-branch/git-partial-sha1-reachable-by-branch.hash @@ -1,2 +1,2 @@ -sha256 9db079b9e215799d59975db7b2b26671eff1932ee6cf1075296f2ace3e2cb746 git-partial-sha1-reachable-by-branch-317406308d9259e2231b.tar.gz +sha256 1bbba9bf2788bd789ed8da4e47cabbf3467b1f706875b3f6b62df38e08fb9aba git-partial-sha1-reachable-by-branch-317406308d9259e2231b-br1.tar.gz sha256 fabbc65c442bacb5e69b7adfea6d14fbbfc1327134322efd12771dc84387d507 file diff --git a/support/testing/tests/download/br2-external/git-refs/package/git-partial-sha1-reachable-by-tag/git-partial-sha1-reachable-by-tag.hash b/support/testing/tests/download/br2-external/git-refs/package/git-partial-sha1-reachable-by-tag/git-partial-sha1-reachable-by-tag.hash index 7696086690..e4a08342a9 100644 --- a/support/testing/tests/download/br2-external/git-refs/package/git-partial-sha1-reachable-by-tag/git-partial-sha1-reachable-by-tag.hash +++ b/support/testing/tests/download/br2-external/git-refs/package/git-partial-sha1-reachable-by-tag/git-partial-sha1-reachable-by-tag.hash @@ -1,2 +1,2 @@ -sha256 f2ef9772f13a9ef9a2c7cde0795e179defb12320d1747fc8d2408748ef5844c2 git-partial-sha1-reachable-by-tag-46bae5b639e5a18e2cc4.tar.gz +sha256 52d223f3b2d625216c259e9ff949ca8818452a531ba61557dd91f3889c7919d7 git-partial-sha1-reachable-by-tag-46bae5b639e5a18e2cc4-br1.tar.gz sha256 2de87d77a2f226813f2d9bda906e970e4195605cdba6680443c0c04d89c532b6 file diff --git a/support/testing/tests/download/br2-external/git-refs/package/git-partial-sha1-tag-itself/git-partial-sha1-tag-itself.hash b/support/testing/tests/download/br2-external/git-refs/package/git-partial-sha1-tag-itself/git-partial-sha1-tag-itself.hash index e627caf91e..6e83e637cf 100644 --- a/support/testing/tests/download/br2-external/git-refs/package/git-partial-sha1-tag-itself/git-partial-sha1-tag-itself.hash +++ b/support/testing/tests/download/br2-external/git-refs/package/git-partial-sha1-tag-itself/git-partial-sha1-tag-itself.hash @@ -1,2 +1,2 @@ -sha256 721143b41b8e56cfd9025833f1602e900a490627db2504e5b4907baa23e0019e git-partial-sha1-tag-itself-2b0e0d98a49c97da6a61.tar.gz +sha256 5cfc004b05f48b3fb419a5db4b7239223d670225fbbb91de2ae151c97910b36c git-partial-sha1-tag-itself-2b0e0d98a49c97da6a61-br1.tar.gz sha256 6de8772a0a58fa62e2b8c58d4dae55c9db7534ad3b3918ecc849a9008d58f081 file diff --git a/support/testing/tests/download/br2-external/git-refs/package/git-partial-sha1-tag-points-to/git-partial-sha1-tag-points-to.hash b/support/testing/tests/download/br2-external/git-refs/package/git-partial-sha1-tag-points-to/git-partial-sha1-tag-points-to.hash index f957a0e23c..7d538e72df 100644 --- a/support/testing/tests/download/br2-external/git-refs/package/git-partial-sha1-tag-points-to/git-partial-sha1-tag-points-to.hash +++ b/support/testing/tests/download/br2-external/git-refs/package/git-partial-sha1-tag-points-to/git-partial-sha1-tag-points-to.hash @@ -1,2 +1,2 @@ -sha256 0fbf7fe935f962ceaafcf8e0ffd25dd2a83752c3f0fd055a942a53f8c9235fa7 git-partial-sha1-tag-points-to-516c9c5f64ec66534d4d.tar.gz +sha256 0f40d7f39bf2e389cc2ce03c73cc0cc9ded1119378aaa68e2a2ef8597f6fd2f3 git-partial-sha1-tag-points-to-516c9c5f64ec66534d4d-br1.tar.gz sha256 6de8772a0a58fa62e2b8c58d4dae55c9db7534ad3b3918ecc849a9008d58f081 file diff --git a/support/testing/tests/download/br2-external/git-refs/package/git-sha1-branch-head/git-sha1-branch-head.hash b/support/testing/tests/download/br2-external/git-refs/package/git-sha1-branch-head/git-sha1-branch-head.hash index 3e8f76d31a..2fc4fbcb95 100644 --- a/support/testing/tests/download/br2-external/git-refs/package/git-sha1-branch-head/git-sha1-branch-head.hash +++ b/support/testing/tests/download/br2-external/git-refs/package/git-sha1-branch-head/git-sha1-branch-head.hash @@ -1,2 +1,2 @@ -sha256 a21a2507b6d94ad484e49e3a9ae698f672a57469aab8e1779da77df7c9d4d337 git-sha1-branch-head-68c197d0879d485f4f6cee85544722b79e68e59f.tar.gz +sha256 3ab67c485ce1825abbbf5db1d90d94dfadc89b30bb740041cfc75fc04021e218 git-sha1-branch-head-68c197d0879d485f4f6cee85544722b79e68e59f-br1.tar.gz sha256 2c1126513651b0d346a4e6d1bb75ac1c9999217e18026302d27bea47b06c7fb2 file diff --git a/support/testing/tests/download/br2-external/git-refs/package/git-sha1-reachable-by-branch/git-sha1-reachable-by-branch.hash b/support/testing/tests/download/br2-external/git-refs/package/git-sha1-reachable-by-branch/git-sha1-reachable-by-branch.hash index f8d7b5dc48..38f0578fd6 100644 --- a/support/testing/tests/download/br2-external/git-refs/package/git-sha1-reachable-by-branch/git-sha1-reachable-by-branch.hash +++ b/support/testing/tests/download/br2-external/git-refs/package/git-sha1-reachable-by-branch/git-sha1-reachable-by-branch.hash @@ -1,2 +1,2 @@ -sha256 8909e76d898e651af0bc23fae4103b87888bfe77448d71aaf1fbec3da97a3ce2 git-sha1-reachable-by-branch-317406308d9259e2231bd0d6ddad3de3832bce08.tar.gz +sha256 a5936d6d6022ea101a6076864a2afa918ab2776764012c4be589027001044041 git-sha1-reachable-by-branch-317406308d9259e2231bd0d6ddad3de3832bce08-br1.tar.gz sha256 fabbc65c442bacb5e69b7adfea6d14fbbfc1327134322efd12771dc84387d507 file diff --git a/support/testing/tests/download/br2-external/git-refs/package/git-sha1-reachable-by-tag/git-sha1-reachable-by-tag.hash b/support/testing/tests/download/br2-external/git-refs/package/git-sha1-reachable-by-tag/git-sha1-reachable-by-tag.hash index 0eb0ca0917..bd4673b15f 100644 --- a/support/testing/tests/download/br2-external/git-refs/package/git-sha1-reachable-by-tag/git-sha1-reachable-by-tag.hash +++ b/support/testing/tests/download/br2-external/git-refs/package/git-sha1-reachable-by-tag/git-sha1-reachable-by-tag.hash @@ -1,2 +1,2 @@ -sha256 9b20256a3058221a8e91031f11700d9945ea84e8f328fa8e42e1cb9f7a30e3b2 git-sha1-reachable-by-tag-46bae5b639e5a18e2cc4dc508f080d566baeff59.tar.gz +sha256 c203f968e358ca478d4c5344b1e4ae9bf13f9fb1120f2ed96a12154dd64195a6 git-sha1-reachable-by-tag-46bae5b639e5a18e2cc4dc508f080d566baeff59-br1.tar.gz sha256 2de87d77a2f226813f2d9bda906e970e4195605cdba6680443c0c04d89c532b6 file diff --git a/support/testing/tests/download/br2-external/git-refs/package/git-sha1-tag-itself/git-sha1-tag-itself.hash b/support/testing/tests/download/br2-external/git-refs/package/git-sha1-tag-itself/git-sha1-tag-itself.hash index 48c1348538..c6862da75e 100644 --- a/support/testing/tests/download/br2-external/git-refs/package/git-sha1-tag-itself/git-sha1-tag-itself.hash +++ b/support/testing/tests/download/br2-external/git-refs/package/git-sha1-tag-itself/git-sha1-tag-itself.hash @@ -1,2 +1,2 @@ -sha256 7d301c1a1054d6aee49193ca9e938f4da561ff73fb01719662865aa38bdc4361 git-sha1-tag-itself-2b0e0d98a49c97da6a618ab36337e2058eb733a2.tar.gz +sha256 57f08e9f3914e79a10e7fb5d346b26fef2773dd22eed0d61fd755e79e62cee93 git-sha1-tag-itself-2b0e0d98a49c97da6a618ab36337e2058eb733a2-br1.tar.gz sha256 6de8772a0a58fa62e2b8c58d4dae55c9db7534ad3b3918ecc849a9008d58f081 file diff --git a/support/testing/tests/download/br2-external/git-refs/package/git-sha1-tag-points-to/git-sha1-tag-points-to.hash b/support/testing/tests/download/br2-external/git-refs/package/git-sha1-tag-points-to/git-sha1-tag-points-to.hash index 3dcafc2094..188cb6897b 100644 --- a/support/testing/tests/download/br2-external/git-refs/package/git-sha1-tag-points-to/git-sha1-tag-points-to.hash +++ b/support/testing/tests/download/br2-external/git-refs/package/git-sha1-tag-points-to/git-sha1-tag-points-to.hash @@ -1,2 +1,2 @@ -sha256 c1f9f5734529a31140a71c031534460811f001b4db37d26833f386358150ab47 git-sha1-tag-points-to-516c9c5f64ec66534d4d069c2e408d9ae4dce023.tar.gz +sha256 1d8b565827137aa21ba37cde382aa291e33a135c697e38dcd31f14e195386327 git-sha1-tag-points-to-516c9c5f64ec66534d4d069c2e408d9ae4dce023-br1.tar.gz sha256 6de8772a0a58fa62e2b8c58d4dae55c9db7534ad3b3918ecc849a9008d58f081 file diff --git a/support/testing/tests/download/br2-external/git-refs/package/git-submodule-disabled/git-submodule-disabled.hash b/support/testing/tests/download/br2-external/git-refs/package/git-submodule-disabled/git-submodule-disabled.hash index 3bd0a44693..c0698e7b28 100644 --- a/support/testing/tests/download/br2-external/git-refs/package/git-submodule-disabled/git-submodule-disabled.hash +++ b/support/testing/tests/download/br2-external/git-refs/package/git-submodule-disabled/git-submodule-disabled.hash @@ -1,2 +1,2 @@ -sha256 f9d46ff8a1a344c6c31fa4211220f3085c446abd31626232540703158276f22c git-submodule-disabled-a9dbc1e23c45e8e1b88c0448763f54d714eb6f8f.tar.gz +sha256 e8e0febc7f1408df22bce2d73d9a30081e03b45e152bc25effd14435ca8b3433 git-submodule-disabled-a9dbc1e23c45e8e1b88c0448763f54d714eb6f8f-br1.tar.gz sha256 ba8b6ddc4726bfb6a05045ebfd8c43263c968ad1bc601bd46a25bc055008eddc file diff --git a/support/testing/tests/download/br2-external/git-refs/package/git-submodule-enabled/git-submodule-enabled.hash b/support/testing/tests/download/br2-external/git-refs/package/git-submodule-enabled/git-submodule-enabled.hash index 7f92c652d3..b95c51fe20 100644 --- a/support/testing/tests/download/br2-external/git-refs/package/git-submodule-enabled/git-submodule-enabled.hash +++ b/support/testing/tests/download/br2-external/git-refs/package/git-submodule-enabled/git-submodule-enabled.hash @@ -1 +1 @@ -sha256 139a34c3c844c844dee74b6746418cfa75fbcc4205794ac8c0b3cd7d55a76792 git-submodule-enabled-a9dbc1e23c45e8e1b88c0448763f54d714eb6f8f.tar.gz +sha256 176c32f10ad11f290b6251d701835450292ba281eb59c7fb57b244407a55ceab git-submodule-enabled-a9dbc1e23c45e8e1b88c0448763f54d714eb6f8f-br1.tar.gz diff --git a/support/testing/tests/download/br2-external/git-refs/package/git-tag/git-tag.hash b/support/testing/tests/download/br2-external/git-refs/package/git-tag/git-tag.hash index 1cd0b15f27..c7ebcf0e04 100644 --- a/support/testing/tests/download/br2-external/git-refs/package/git-tag/git-tag.hash +++ b/support/testing/tests/download/br2-external/git-refs/package/git-tag/git-tag.hash @@ -1,2 +1,2 @@ -sha256 85dcb5bcf9bed496688d0eb01c7a3ce05c5b46b984cc1e9e76a6dbefd976e6b3 git-tag-mytag.tar.gz +sha256 c66b2366d8ccb1670951012334fe8d48de3358aef39b3da2912b339448fefcde git-tag-mytag-br1.tar.gz sha256 6de8772a0a58fa62e2b8c58d4dae55c9db7534ad3b3918ecc849a9008d58f081 file diff --git a/support/testing/tests/download/br2-external/git-refs/package/git-wrong-content/git-wrong-content.hash b/support/testing/tests/download/br2-external/git-refs/package/git-wrong-content/git-wrong-content.hash index 47b2b8b7d7..453ffc0ab2 100644 --- a/support/testing/tests/download/br2-external/git-refs/package/git-wrong-content/git-wrong-content.hash +++ b/support/testing/tests/download/br2-external/git-refs/package/git-wrong-content/git-wrong-content.hash @@ -1,2 +1,2 @@ - sha256 04715901977503d1df650e0959f4d31d8e7b105e2ac99a2182e0652b8f13baa1 git-wrong-content-a238b1dfcd825d47d834af3c5223417c8411d90d.tar.gz + sha256 4a230e667227310289438cd7d899276a0d45ca8778abfd043dfc0a10ed2c9085 git-wrong-content-a238b1dfcd825d47d834af3c5223417c8411d90d-br1.tar.gz sha256 0000000000000000000000000000000000000000000000000000000000000000 file diff --git a/support/testing/tests/init/test_systemd.py b/support/testing/tests/init/test_systemd.py index 371be4ad7d..c0ef5e1202 100644 --- a/support/testing/tests/init/test_systemd.py +++ b/support/testing/tests/init/test_systemd.py @@ -91,7 +91,6 @@ class TestInitSystemSystemdRwIfupdown(InitSystemSystemdBase): """ BR2_SYSTEM_DHCP="eth0" # BR2_PACKAGE_SYSTEMD_NETWORKD is not set - # BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW is not set BR2_TARGET_ROOTFS_EXT2=y """ @@ -106,7 +105,7 @@ class TestInitSystemSystemdRoFull(InitSystemSystemdBase): """ BR2_SYSTEM_DHCP="eth0" # BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW is not set - BR2_PACKAGE_SYSTEMD_JOURNAL_GATEWAY=y + BR2_PACKAGE_SYSTEMD_JOURNAL_REMOTE=y BR2_PACKAGE_SYSTEMD_BACKLIGHT=y BR2_PACKAGE_SYSTEMD_BINFMT=y BR2_PACKAGE_SYSTEMD_COREDUMP=y @@ -136,7 +135,7 @@ class TestInitSystemSystemdRwFull(InitSystemSystemdBase): config = InitSystemSystemdBase.config + \ """ BR2_SYSTEM_DHCP="eth0" - BR2_PACKAGE_SYSTEMD_JOURNAL_GATEWAY=y + BR2_PACKAGE_SYSTEMD_JOURNAL_REMOTE=y BR2_PACKAGE_SYSTEMD_BACKLIGHT=y BR2_PACKAGE_SYSTEMD_BINFMT=y BR2_PACKAGE_SYSTEMD_COREDUMP=y diff --git a/support/testing/tests/init/test_systemd_selinux.py b/support/testing/tests/init/test_systemd_selinux.py new file mode 100644 index 0000000000..73604cfc32 --- /dev/null +++ b/support/testing/tests/init/test_systemd_selinux.py @@ -0,0 +1,76 @@ +import os + +import infra.basetest + + +class TestSELinuxSystemd(infra.basetest.BRTest): + config = \ + """ + BR2_x86_64=y + BR2_x86_corei7=y + BR2_TOOLCHAIN_EXTERNAL=y + BR2_INIT_SYSTEMD=y + BR2_LINUX_KERNEL=y + BR2_LINUX_KERNEL_CUSTOM_VERSION=y + BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.8.12" + BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y + BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/qemu/x86_64/linux.config" + BR2_PACKAGE_LIBSELINUX=y + BR2_PACKAGE_REFPOLICY=y + """ + + def wait_boot(self): + # The complete boot with systemd takes more time than what the default multipler permits + self.emulator.timeout_multiplier *= 10 + self.emulator.login() + + def run_tests(self, fstype): + kernel = os.path.join(self.builddir, "images", "bzImage") + rootfs = os.path.join(self.builddir, "images", "rootfs.{}".format(fstype)) + + self.emulator.boot(arch="x86_64", kernel=kernel, + kernel_cmdline=["root=/dev/vda", "rootfstype={}".format(fstype), + "console=ttyS0", "security=selinux"], + options=["-cpu", "Nehalem", + "-drive", "file={},if=virtio,format=raw".format(rootfs)]) + self.wait_boot() + + # Test the reported SELinux mode. + out, ret = self.emulator.run("getenforce") + self.assertEqual(ret, 0) + self.assertEqual(out[0], "Permissive") + + # Check the extended arguments are correctly set. + out, ret = self.emulator.run("ls -dZ /") + self.assertEqual(ret, 0) + self.assertEqual(out[0].split()[0], "system_u:object_r:root_t") + + # Check init's attributes. + out, ret = self.emulator.run("cat /proc/1/attr/current") + self.assertEqual(ret, 0) + self.assertEqual(out[0], "system_u:system_r:init_t\0") + + +class TestSELinuxSystemdExt4(TestSELinuxSystemd): + config = TestSELinuxSystemd.config + \ + """ + BR2_TARGET_ROOTFS_EXT2=y + BR2_TARGET_ROOTFS_EXT2_4=y + BR2_TARGET_ROOTFS_EXT2_SIZE="100M" + """ + + def test_run(self): + self.run_tests("ext4") + + +class TestSELinuxSystemdSquashfs(TestSELinuxSystemd): + config = TestSELinuxSystemd.config + \ + """ + BR2_TARGET_ROOTFS_SQUASHFS=y + BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="{}" + """.format( + infra.filepath("tests/init/test_systemd_selinux/linux-squashfs.fragment"), + ) + + def test_run(self): + self.run_tests("squashfs") diff --git a/support/testing/tests/init/test_systemd_selinux/linux-squashfs.fragment b/support/testing/tests/init/test_systemd_selinux/linux-squashfs.fragment new file mode 100644 index 0000000000..7a89d006fa --- /dev/null +++ b/support/testing/tests/init/test_systemd_selinux/linux-squashfs.fragment @@ -0,0 +1 @@ +CONFIG_SQUASHFS=y diff --git a/support/testing/tests/package/sample_python_pytest_asyncio.py b/support/testing/tests/package/sample_python_pytest_asyncio.py new file mode 100644 index 0000000000..cdb8cd9fb9 --- /dev/null +++ b/support/testing/tests/package/sample_python_pytest_asyncio.py @@ -0,0 +1,31 @@ +import asyncio +import pytest + + +x = 1 + + +@pytest.fixture() +def f1(): + global x + x = 2 + yield 15 + x = 3 + + +@pytest.mark.asyncio +async def test_1(): + assert x == 1 + + +@pytest.mark.asyncio +async def test_2(f1): + assert x == 2 + assert f1 == 15 + + +@pytest.mark.asyncio +async def test_3(): + assert x == 3 + await asyncio.sleep(0.1) + assert x == 3 diff --git a/support/testing/tests/package/test_lualdap.py b/support/testing/tests/package/test_lualdap.py new file mode 100644 index 0000000000..2ec0d58228 --- /dev/null +++ b/support/testing/tests/package/test_lualdap.py @@ -0,0 +1,25 @@ +from tests.package.test_lua import TestLuaBase + + +class TestLuaLuaLdap(TestLuaBase): + config = TestLuaBase.config + \ + """ + BR2_PACKAGE_LUA=y + BR2_PACKAGE_LUALDAP=y + """ + + def test_run(self): + self.login() + self.module_test("lualdap") + + +class TestLuajitLuaLdap(TestLuaBase): + config = TestLuaBase.config + \ + """ + BR2_PACKAGE_LUAJIT=y + BR2_PACKAGE_LUALDAP=y + """ + + def test_run(self): + self.login() + self.module_test("lualdap") diff --git a/support/testing/tests/package/test_python_pytest_asyncio.py b/support/testing/tests/package/test_python_pytest_asyncio.py new file mode 100644 index 0000000000..caf034be7b --- /dev/null +++ b/support/testing/tests/package/test_python_pytest_asyncio.py @@ -0,0 +1,20 @@ +import os + +from tests.package.test_python import TestPythonPackageBase + + +class TestPythonPy3PytestAsyncio(TestPythonPackageBase): + __test__ = True + config = TestPythonPackageBase.config + \ + """ + BR2_PACKAGE_PYTHON3=y + BR2_PACKAGE_PYTHON_PYTEST=y + BR2_PACKAGE_PYTHON_PYTEST_ASYNCIO=y + """ + sample_scripts = ["tests/package/sample_python_pytest_asyncio.py"] + + def run_sample_scripts(self): + for script in self.sample_scripts: + cmd = self.interpreter + " -m pytest " + os.path.basename(script) + _, exit_code = self.emulator.run(cmd, timeout=self.timeout) + self.assertEqual(exit_code, 0) diff --git a/support/testing/tests/toolchain/test_external_bootlin.py b/support/testing/tests/toolchain/test_external_bootlin.py index 9f0df9788b..af60c21f7d 100644 --- a/support/testing/tests/toolchain/test_external_bootlin.py +++ b/support/testing/tests/toolchain/test_external_bootlin.py @@ -1553,6 +1553,186 @@ class TestExternalToolchainBootlinOpenriscUclibcStable(TestExternalToolchain): TestExternalToolchain.common_check(self) +class TestExternalToolchainBootlinPowerpc440fpGlibcBleedingEdge(TestExternalToolchain): + config = """ + BR2_powerpc=y + BR2_powerpc_440fp=y + BR2_TOOLCHAIN_EXTERNAL=y + BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y + BR2_TOOLCHAIN_EXTERNAL_BOOTLIN_POWERPC_440FP_GLIBC_BLEEDING_EDGE=y + # BR2_TARGET_ROOTFS_TAR is not set + """ + toolchain_prefix = "powerpc-linux" + + def test_run(self): + TestExternalToolchain.common_check(self) + + +class TestExternalToolchainBootlinPowerpc440fpGlibcStable(TestExternalToolchain): + config = """ + BR2_powerpc=y + BR2_powerpc_440fp=y + BR2_TOOLCHAIN_EXTERNAL=y + BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y + BR2_TOOLCHAIN_EXTERNAL_BOOTLIN_POWERPC_440FP_GLIBC_STABLE=y + # BR2_TARGET_ROOTFS_TAR is not set + """ + toolchain_prefix = "powerpc-linux" + + def test_run(self): + TestExternalToolchain.common_check(self) + + +class TestExternalToolchainBootlinPowerpc440fpMuslBleedingEdge(TestExternalToolchain): + config = """ + BR2_powerpc=y + BR2_powerpc_440fp=y + BR2_TOOLCHAIN_EXTERNAL=y + BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y + BR2_TOOLCHAIN_EXTERNAL_BOOTLIN_POWERPC_440FP_MUSL_BLEEDING_EDGE=y + # BR2_TARGET_ROOTFS_TAR is not set + """ + toolchain_prefix = "powerpc-linux" + + def test_run(self): + TestExternalToolchain.common_check(self) + + +class TestExternalToolchainBootlinPowerpc440fpMuslStable(TestExternalToolchain): + config = """ + BR2_powerpc=y + BR2_powerpc_440fp=y + BR2_TOOLCHAIN_EXTERNAL=y + BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y + BR2_TOOLCHAIN_EXTERNAL_BOOTLIN_POWERPC_440FP_MUSL_STABLE=y + # BR2_TARGET_ROOTFS_TAR is not set + """ + toolchain_prefix = "powerpc-linux" + + def test_run(self): + TestExternalToolchain.common_check(self) + + +class TestExternalToolchainBootlinPowerpc440fpUclibcBleedingEdge(TestExternalToolchain): + config = """ + BR2_powerpc=y + BR2_powerpc_440fp=y + BR2_TOOLCHAIN_EXTERNAL=y + BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y + BR2_TOOLCHAIN_EXTERNAL_BOOTLIN_POWERPC_440FP_UCLIBC_BLEEDING_EDGE=y + # BR2_TARGET_ROOTFS_TAR is not set + """ + toolchain_prefix = "powerpc-linux" + + def test_run(self): + TestExternalToolchain.common_check(self) + + +class TestExternalToolchainBootlinPowerpc440fpUclibcStable(TestExternalToolchain): + config = """ + BR2_powerpc=y + BR2_powerpc_440fp=y + BR2_TOOLCHAIN_EXTERNAL=y + BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y + BR2_TOOLCHAIN_EXTERNAL_BOOTLIN_POWERPC_440FP_UCLIBC_STABLE=y + # BR2_TARGET_ROOTFS_TAR is not set + """ + toolchain_prefix = "powerpc-linux" + + def test_run(self): + TestExternalToolchain.common_check(self) + + +class TestExternalToolchainBootlinPowerpce300c3GlibcBleedingEdge(TestExternalToolchain): + config = """ + BR2_powerpc=y + BR2_powerpc_e300c3=y + BR2_TOOLCHAIN_EXTERNAL=y + BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y + BR2_TOOLCHAIN_EXTERNAL_BOOTLIN_POWERPC_E300C3_GLIBC_BLEEDING_EDGE=y + # BR2_TARGET_ROOTFS_TAR is not set + """ + toolchain_prefix = "powerpc-linux" + + def test_run(self): + TestExternalToolchain.common_check(self) + + +class TestExternalToolchainBootlinPowerpce300c3GlibcStable(TestExternalToolchain): + config = """ + BR2_powerpc=y + BR2_powerpc_e300c3=y + BR2_TOOLCHAIN_EXTERNAL=y + BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y + BR2_TOOLCHAIN_EXTERNAL_BOOTLIN_POWERPC_E300C3_GLIBC_STABLE=y + # BR2_TARGET_ROOTFS_TAR is not set + """ + toolchain_prefix = "powerpc-linux" + + def test_run(self): + TestExternalToolchain.common_check(self) + + +class TestExternalToolchainBootlinPowerpce300c3MuslBleedingEdge(TestExternalToolchain): + config = """ + BR2_powerpc=y + BR2_powerpc_e300c3=y + BR2_TOOLCHAIN_EXTERNAL=y + BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y + BR2_TOOLCHAIN_EXTERNAL_BOOTLIN_POWERPC_E300C3_MUSL_BLEEDING_EDGE=y + # BR2_TARGET_ROOTFS_TAR is not set + """ + toolchain_prefix = "powerpc-linux" + + def test_run(self): + TestExternalToolchain.common_check(self) + + +class TestExternalToolchainBootlinPowerpce300c3MuslStable(TestExternalToolchain): + config = """ + BR2_powerpc=y + BR2_powerpc_e300c3=y + BR2_TOOLCHAIN_EXTERNAL=y + BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y + BR2_TOOLCHAIN_EXTERNAL_BOOTLIN_POWERPC_E300C3_MUSL_STABLE=y + # BR2_TARGET_ROOTFS_TAR is not set + """ + toolchain_prefix = "powerpc-linux" + + def test_run(self): + TestExternalToolchain.common_check(self) + + +class TestExternalToolchainBootlinPowerpce300c3UclibcBleedingEdge(TestExternalToolchain): + config = """ + BR2_powerpc=y + BR2_powerpc_e300c3=y + BR2_TOOLCHAIN_EXTERNAL=y + BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y + BR2_TOOLCHAIN_EXTERNAL_BOOTLIN_POWERPC_E300C3_UCLIBC_BLEEDING_EDGE=y + # BR2_TARGET_ROOTFS_TAR is not set + """ + toolchain_prefix = "powerpc-linux" + + def test_run(self): + TestExternalToolchain.common_check(self) + + +class TestExternalToolchainBootlinPowerpce300c3UclibcStable(TestExternalToolchain): + config = """ + BR2_powerpc=y + BR2_powerpc_e300c3=y + BR2_TOOLCHAIN_EXTERNAL=y + BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y + BR2_TOOLCHAIN_EXTERNAL_BOOTLIN_POWERPC_E300C3_UCLIBC_STABLE=y + # BR2_TARGET_ROOTFS_TAR is not set + """ + toolchain_prefix = "powerpc-linux" + + def test_run(self): + TestExternalToolchain.common_check(self) + + class TestExternalToolchainBootlinPowerpce500mcGlibcBleedingEdge(TestExternalToolchain): config = """ BR2_powerpc=y @@ -1673,6 +1853,66 @@ class TestExternalToolchainBootlinPowerpc64e5500GlibcStable(TestExternalToolchai TestExternalToolchain.common_check(self) +class TestExternalToolchainBootlinPowerpc64e6500GlibcBleedingEdge(TestExternalToolchain): + config = """ + BR2_powerpc64=y + BR2_powerpc_e6500=y + BR2_TOOLCHAIN_EXTERNAL=y + BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y + BR2_TOOLCHAIN_EXTERNAL_BOOTLIN_POWERPC64_E6500_GLIBC_BLEEDING_EDGE=y + # BR2_TARGET_ROOTFS_TAR is not set + """ + toolchain_prefix = "powerpc64-linux" + + def test_run(self): + TestExternalToolchain.common_check(self) + + +class TestExternalToolchainBootlinPowerpc64e6500GlibcStable(TestExternalToolchain): + config = """ + BR2_powerpc64=y + BR2_powerpc_e6500=y + BR2_TOOLCHAIN_EXTERNAL=y + BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y + BR2_TOOLCHAIN_EXTERNAL_BOOTLIN_POWERPC64_E6500_GLIBC_STABLE=y + # BR2_TARGET_ROOTFS_TAR is not set + """ + toolchain_prefix = "powerpc64-linux" + + def test_run(self): + TestExternalToolchain.common_check(self) + + +class TestExternalToolchainBootlinPowerpc64e6500MuslBleedingEdge(TestExternalToolchain): + config = """ + BR2_powerpc64=y + BR2_powerpc_e6500=y + BR2_TOOLCHAIN_EXTERNAL=y + BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y + BR2_TOOLCHAIN_EXTERNAL_BOOTLIN_POWERPC64_E6500_MUSL_BLEEDING_EDGE=y + # BR2_TARGET_ROOTFS_TAR is not set + """ + toolchain_prefix = "powerpc64-linux" + + def test_run(self): + TestExternalToolchain.common_check(self) + + +class TestExternalToolchainBootlinPowerpc64e6500MuslStable(TestExternalToolchain): + config = """ + BR2_powerpc64=y + BR2_powerpc_e6500=y + BR2_TOOLCHAIN_EXTERNAL=y + BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y + BR2_TOOLCHAIN_EXTERNAL_BOOTLIN_POWERPC64_E6500_MUSL_STABLE=y + # BR2_TARGET_ROOTFS_TAR is not set + """ + toolchain_prefix = "powerpc64-linux" + + def test_run(self): + TestExternalToolchain.common_check(self) + + class TestExternalToolchainBootlinPowerpc64power8GlibcBleedingEdge(TestExternalToolchain): config = """ BR2_powerpc64=y @@ -2327,7 +2567,8 @@ class TestExternalToolchainBootlinX86i686UclibcStable(TestExternalToolchain): class TestExternalToolchainBootlinXtensalx60UclibcBleedingEdge(TestExternalToolchain): config = """ BR2_xtensa=y - BR2_xtensa_fsf=y + BR2_XTENSA_CUSTOM=y + BR2_XTENSA_LITTLE_ENDIAN=y BR2_TOOLCHAIN_EXTERNAL=y BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y BR2_TOOLCHAIN_EXTERNAL_BOOTLIN_XTENSA_LX60_UCLIBC_BLEEDING_EDGE=y @@ -2342,7 +2583,8 @@ class TestExternalToolchainBootlinXtensalx60UclibcBleedingEdge(TestExternalToolc class TestExternalToolchainBootlinXtensalx60UclibcStable(TestExternalToolchain): config = """ BR2_xtensa=y - BR2_xtensa_fsf=y + BR2_XTENSA_CUSTOM=y + BR2_XTENSA_LITTLE_ENDIAN=y BR2_TOOLCHAIN_EXTERNAL=y BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y BR2_TOOLCHAIN_EXTERNAL_BOOTLIN_XTENSA_LX60_UCLIBC_STABLE=y |