02fc3473e1
As reported on the mailing list [1], TestPolkitSystemd and TestPolkitInitd are failing since we bumped the Bootlin toolchain 2023.08 [2]. The issue is caused by expat (XML library) package detecting arc4random_buf() introduced by glibc 2.36 [3]. With arc4random_buf() support enabled, expat hang Polkit while reading its policy files (XML files) due to a lack of entropy on the system. Upgrading the kernel allows to avoid such issue thanks to random_get_entropy_fallback() introduced in 5.10.119 (backpored) [4]. Build the vexpress-v2p-ca9 (armv7) 5.10.202 using the kernel configuration file found in /proc/config.gz but with additional kernel options provided by SYSTEMD_LINUX_CONFIG_FIXUPS. Indeed some kernel options requested by systemd were missing in 5.10.7 kernel. Build the versatile-pb (armv5) kernel using the same kernel configuration as qemu_arm_versatile_defconfig but with additional kernel options like for vexpress-v2p-ca9. While at it, enable IKCONFIG_PROC option to provide the kernel configuration at runtime in /proc/config.gz. Runtime tested: https://gitlab.com/kubu93/buildroot/-/pipelines/1097887826 (tests.package.test_polkit.TestPolkit*) https://gitlab.com/kubu93/buildroot/-/pipelines/1097705399 (tests.init.*) Fixes: https://gitlab.com/buildroot.org/buildroot/-/jobs/5689309948 (TestPolkitSystemd) https://gitlab.com/buildroot.org/buildroot/-/jobs/5689309947 (TestPolkitInitd) [1] http://lists.busybox.net/pipermail/buildroot/2023-December/680445.html [2]452365a385
[3] https://sourceware.org/git/?p=glibc.git;a=commit;h=6f4e0fcfa2d2b0915816a3a3a1d48b4763a7dee2 [4] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=fdca775081527364621857957655207d83035376 Signed-off-by: Romain Naour <romain.naour@smile.fr> Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr> (cherry picked from commit241a8b0615
) Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
136 lines
4.5 KiB
Python
Executable File
136 lines
4.5 KiB
Python
Executable File
#!/usr/bin/env python3
|
|
import argparse
|
|
import multiprocessing
|
|
import os
|
|
import sys
|
|
|
|
import nose2
|
|
|
|
from infra.basetest import BRConfigTest
|
|
|
|
import infra
|
|
|
|
|
|
def main():
|
|
parser = argparse.ArgumentParser(description='Run Buildroot tests')
|
|
parser.add_argument('testname', nargs='*',
|
|
help='list of test cases to execute')
|
|
parser.add_argument('-l', '--list', action='store_true',
|
|
help='list of available test cases')
|
|
parser.add_argument('-a', '--all', action='store_true',
|
|
help='execute all test cases')
|
|
parser.add_argument('-s', '--stdout', action='store_true',
|
|
help='log everything to stdout')
|
|
parser.add_argument('-o', '--output',
|
|
help='output directory')
|
|
parser.add_argument('-d', '--download',
|
|
help='download directory')
|
|
parser.add_argument('-p', '--prepare-only', action='store_true',
|
|
help='download emulator builtin binaries')
|
|
parser.add_argument('-k', '--keep',
|
|
help='keep build directories',
|
|
action='store_true')
|
|
parser.add_argument('-t', '--testcases', type=int, default=1,
|
|
help='number of testcases to run simultaneously')
|
|
parser.add_argument('-j', '--jlevel', type=int,
|
|
help='BR2_JLEVEL to use for each testcase')
|
|
parser.add_argument('--timeout-multiplier', type=int, default=1,
|
|
help='increase timeouts (useful for slow machines)')
|
|
|
|
args = parser.parse_args()
|
|
|
|
script_path = os.path.realpath(__file__)
|
|
test_dir = os.path.dirname(script_path)
|
|
|
|
if args.stdout:
|
|
BRConfigTest.logtofile = False
|
|
|
|
if args.list:
|
|
print("List of tests")
|
|
nose2.discover(argv=[script_path,
|
|
"-s", test_dir,
|
|
"-v",
|
|
"--collect-only"],
|
|
plugins=["nose2.plugins.collect"])
|
|
return 0
|
|
|
|
if args.download is None:
|
|
args.download = os.getenv("BR2_DL_DIR")
|
|
if args.download is None:
|
|
print("Missing download directory, please use -d/--download")
|
|
print("")
|
|
parser.print_help()
|
|
return 1
|
|
|
|
BRConfigTest.downloaddir = os.path.abspath(args.download)
|
|
|
|
if args.prepare_only:
|
|
emulator_builtin_binaries = ["kernel-vexpress-5.10.202",
|
|
"vexpress-v2p-ca9-5.10.202.dtb",
|
|
"kernel-versatile-5.10.202",
|
|
"versatile-pb-5.10.202.dtb"]
|
|
print("Downloading emulator builtin binaries")
|
|
for binary in emulator_builtin_binaries:
|
|
infra.download(BRConfigTest.downloaddir, binary)
|
|
return 0
|
|
|
|
if args.output is None:
|
|
print("Missing output directory, please use -o/--output")
|
|
print("")
|
|
parser.print_help()
|
|
return 1
|
|
|
|
if not os.path.exists(args.output):
|
|
os.mkdir(args.output)
|
|
|
|
BRConfigTest.outputdir = os.path.abspath(args.output)
|
|
|
|
if args.all is False and not args.testname:
|
|
print("No test selected")
|
|
print("")
|
|
parser.print_help()
|
|
return 1
|
|
|
|
BRConfigTest.keepbuilds = args.keep
|
|
|
|
if args.testcases != 1:
|
|
if args.testcases < 1:
|
|
print("Invalid number of testcases to run simultaneously")
|
|
print("")
|
|
parser.print_help()
|
|
return 1
|
|
# same default BR2_JLEVEL as package/Makefile.in
|
|
br2_jlevel = 1 + multiprocessing.cpu_count()
|
|
each_testcase = int((br2_jlevel + args.testcases) / args.testcases)
|
|
BRConfigTest.jlevel = each_testcase
|
|
|
|
if args.jlevel:
|
|
if args.jlevel < 0:
|
|
print("Invalid BR2_JLEVEL to use for each testcase")
|
|
print("")
|
|
parser.print_help()
|
|
return 1
|
|
# the user can override the auto calculated value
|
|
BRConfigTest.jlevel = args.jlevel
|
|
|
|
if args.timeout_multiplier < 1:
|
|
print("Invalid multiplier for timeout values")
|
|
print("")
|
|
parser.print_help()
|
|
return 1
|
|
BRConfigTest.timeout_multiplier = args.timeout_multiplier
|
|
|
|
nose2_args = ["-v",
|
|
"-N", str(args.testcases),
|
|
"-s", test_dir,
|
|
"-c", os.path.join(test_dir, "conf/unittest.cfg")]
|
|
|
|
if args.testname:
|
|
nose2_args += args.testname
|
|
|
|
nose2.discover(argv=nose2_args)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
sys.exit(main())
|