[PATCH 00/15] test: Improvements to make check et al

From: Simon Glass <sjg@chromium.org> It is helpful to be able to run 'make qcheck' to run a subset of the tests in a short time. However this has not always been reliable. Since this feature is not tested in CI it can sometimes break. Now that things are working correctly, add it the various 'make check' combinations to CI, so they will remain functional. Simon Glass (15): patman: Drop hard-coded patchwork server patman: Handle invalid characters in patch files lwip: Fix some unicode warnings from pytest malloc: Avoid defining calloc() buildman: Deal with DTC in environemnt in test_skip_dtc() buildman: Fix pylint warning in test_skip_dtc() buildman: Handle CPP being in the environment buildman: Handle CROSS_COMPILE being in the environment dtoc: Add a test for the fdt_util.EnsureCompiled with indir test: Update test_fdt_add_pubkey() to use a separate dir test/run: Provide the full path to dtc test/run: Skip xPL tests with make tcheck test/run: Run more quietly test/run: Tidy up the tool path for binman CI: Check that make check et al work correctly .gitlab-ci.yml | 47 +++++++++++++++++++ common/malloc_simple.c | 2 +- include/malloc.h | 1 + .../ports/unix/posixlib/include/posix/inet.h | 2 +- .../unix/posixlib/include/posix/sockets.h | 2 +- .../contrib/ports/unix/posixlib/lwipopts.h | 2 +- test/py/tests/test_vboot.py | 2 +- test/run | 45 +++++++++++------- tools/buildman/boards.py | 4 +- tools/buildman/func_test.py | 3 +- tools/buildman/test.py | 10 ++-- tools/dtoc/test/dtoc_test_inc.dts | 14 ++++++ tools/dtoc/test/test-include.dtsi | 5 ++ tools/dtoc/test_fdt.py | 10 ++++ tools/patman/cseries.py | 1 - tools/patman/patchstream.py | 2 +- 16 files changed, 120 insertions(+), 32 deletions(-) create mode 100644 tools/dtoc/test/dtoc_test_inc.dts create mode 100644 tools/dtoc/test/test-include.dtsi -- 2.43.0 base-commit: b351843588c4618496e73707c64466433b26fad9 branch: makee

From: Simon Glass <sjg@chromium.org> Since there is now a new server at patchwork.u-boot.org allow using this if selected in the ~/.patman file. Signed-off-by: Simon Glass <sjg@chromium.org> --- tools/patman/cseries.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/patman/cseries.py b/tools/patman/cseries.py index bcbc4963cea..009e6f000b7 100644 --- a/tools/patman/cseries.py +++ b/tools/patman/cseries.py @@ -511,7 +511,6 @@ class Cseries(cser_helper.CseriesHelper): """ ser, version = self._parse_series_and_version(name, version) link = self.link_get(ser.name, version) - pwork.url = 'https://patchwork.ozlabs.org' url = self.loop.run_until_complete(pwork.get_series_url(link)) print(f'Opening {url}') -- 2.43.0

Hi, On Tue, 19 Aug 2025 at 13:40, Simon Glass <sjg@u-boot.org> wrote:
From: Simon Glass <sjg@chromium.org>
Since there is now a new server at patchwork.u-boot.org allow using this if selected in the ~/.patman file.
Signed-off-by: Simon Glass <sjg@chromium.org> ---
tools/patman/cseries.py | 1 - 1 file changed, 1 deletion(-)
diff --git a/tools/patman/cseries.py b/tools/patman/cseries.py index bcbc4963cea..009e6f000b7 100644 --- a/tools/patman/cseries.py +++ b/tools/patman/cseries.py @@ -511,7 +511,6 @@ class Cseries(cser_helper.CseriesHelper): """ ser, version = self._parse_series_and_version(name, version) link = self.link_get(ser.name, version) - pwork.url = 'https://patchwork.ozlabs.org' url = self.loop.run_until_complete(pwork.get_series_url(link)) print(f'Opening {url}')
-- 2.43.0
_______________________________________________ Concept mailing list -- concept@u-boot.org To unsubscribe send an email to concept-leave@u-boot.org
This looks pretty good.

On Tue, 19 Aug 2025 at 13:40, Simon Glass <imon.glass@gmail.com> wrote:
Hi,
On Tue, 19 Aug 2025 at 13:40, Simon Glass <sjg@u-boot.org> wrote:
From: Simon Glass <sjg@chromium.org>
Since there is now a new server at patchwork.u-boot.org allow using this if selected in the ~/.patman file.
Signed-off-by: Simon Glass <sjg@chromium.org> ---
tools/patman/cseries.py | 1 - 1 file changed, 1 deletion(-)
diff --git a/tools/patman/cseries.py b/tools/patman/cseries.py index bcbc4963cea..009e6f000b7 100644 --- a/tools/patman/cseries.py +++ b/tools/patman/cseries.py @@ -511,7 +511,6 @@ class Cseries(cser_helper.CseriesHelper): """ ser, version = self._parse_series_and_version(name, version) link = self.link_get(ser.name, version) - pwork.url = 'https://patchwork.ozlabs.org' url = self.loop.run_until_complete(pwork.get_series_url(link)) print(f'Opening {url}')
-- 2.43.0
_______________________________________________ Concept mailing list -- concept@u-boot.org To unsubscribe send an email to concept-leave@u-boot.org
This looks pretty good.
Tested-by: Simon Glass <sjg@chromium.org>

From: Simon Glass <sjg@chromium.org> In some cases latin1 encoding may be used in source files. If 'high-ascii' are used, patman may report an error: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf3 in position 1051: invalid continuation byte Fix this by replacing these characters. This may cause the patch to fail to apply, but at least it can be checked. Signed-off-by: Simon Glass <sjg@chromium.org> --- tools/patman/patchstream.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/patman/patchstream.py b/tools/patman/patchstream.py index 45040877f8c..120004a3e0d 100644 --- a/tools/patman/patchstream.py +++ b/tools/patman/patchstream.py @@ -831,7 +831,7 @@ def fix_patch(backup_dir, fname, series, cmt, keep_change_id=False, fname = os.path.join(cwd or '', fname) handle, tmpname = tempfile.mkstemp() outfd = os.fdopen(handle, 'w', encoding='utf-8') - infd = open(fname, 'r', encoding='utf-8') + infd = open(fname, 'r', encoding='utf-8', errors='replace') pst = PatchStream(series, keep_change_id=keep_change_id, insert_base_commit=insert_base_commit) pst.commit = cmt -- 2.43.0

From: Simon Glass <sjg@chromium.org> Fix various warnings of the form: Skipping file '[..]/lib/lwip/lwip/contrib/ports/unix/posixlib/ include/posix/inet.h' due to unicode error Signed-off-by: Simon Glass <sjg@chromium.org> --- lib/lwip/lwip/contrib/ports/unix/posixlib/include/posix/inet.h | 2 +- .../lwip/contrib/ports/unix/posixlib/include/posix/sockets.h | 2 +- lib/lwip/lwip/contrib/ports/unix/posixlib/lwipopts.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/lwip/lwip/contrib/ports/unix/posixlib/include/posix/inet.h b/lib/lwip/lwip/contrib/ports/unix/posixlib/include/posix/inet.h index c7bc124916d..4f5921d8828 100644 --- a/lib/lwip/lwip/contrib/ports/unix/posixlib/include/posix/inet.h +++ b/lib/lwip/lwip/contrib/ports/unix/posixlib/include/posix/inet.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2023 Joan Lled� <jlledom@member.fsf.org> + * Copyright (C) 2023 Joan Lledo <jlledom@member.fsf.org> * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/lib/lwip/lwip/contrib/ports/unix/posixlib/include/posix/sockets.h b/lib/lwip/lwip/contrib/ports/unix/posixlib/include/posix/sockets.h index f390066616a..aeffe8c103c 100644 --- a/lib/lwip/lwip/contrib/ports/unix/posixlib/include/posix/sockets.h +++ b/lib/lwip/lwip/contrib/ports/unix/posixlib/include/posix/sockets.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2023 Joan Lled� <jlledom@member.fsf.org> + * Copyright (C) 2023 Joan Lledo <jlledom@member.fsf.org> * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/lib/lwip/lwip/contrib/ports/unix/posixlib/lwipopts.h b/lib/lwip/lwip/contrib/ports/unix/posixlib/lwipopts.h index 1b38aa3aef1..b081fb1f3e6 100644 --- a/lib/lwip/lwip/contrib/ports/unix/posixlib/lwipopts.h +++ b/lib/lwip/lwip/contrib/ports/unix/posixlib/lwipopts.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2023 Joan Lled� <jlledom@member.fsf.org> + * Copyright (C) 2023 Joan Lledo <jlledom@member.fsf.org> * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: -- 2.43.0

From: Simon Glass <sjg@chromium.org> The C runtime calls malloc() before starting main(), e.g. to get some memory to use for dynamic linking. If CONFIG_TPL_SYS_MALLOC_SIMPLE is enabled, the calloc() symbol is defined within U-Boot. The C runtime may call that too. Use the same #define technique as for malloc_simple(), to fix a crash on my machine when running: /tmp/b/sandbox_vpl/tpl/u-boot-tpl -D This does not happen in CI, perhaps because the C runtime uses malloc() instead of calloc(). Signed-off-by: Simon Glass <sjg@chromium.org> --- common/malloc_simple.c | 2 +- include/malloc.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/common/malloc_simple.c b/common/malloc_simple.c index f0f90a095bd..d820ded68c3 100644 --- a/common/malloc_simple.c +++ b/common/malloc_simple.c @@ -65,7 +65,7 @@ void *memalign_simple(size_t align, size_t bytes) } #if CONFIG_IS_ENABLED(SYS_MALLOC_SIMPLE) -void *calloc(size_t nmemb, size_t elem_size) +void *calloc_simple(size_t nmemb, size_t elem_size) { size_t size = nmemb * elem_size; void *ptr; diff --git a/include/malloc.h b/include/malloc.h index 9e0be482416..728451086aa 100644 --- a/include/malloc.h +++ b/include/malloc.h @@ -882,6 +882,7 @@ void malloc_disable_testing(void); #if CONFIG_IS_ENABLED(SYS_MALLOC_SIMPLE) #define malloc malloc_simple #define realloc realloc_simple +#define calloc calloc_simple #define memalign memalign_simple #if IS_ENABLED(CONFIG_VALGRIND) #define free free_simple -- 2.43.0

From: Simon Glass <sjg@chromium.org> If DTC happens to be set in the environment provided to buildman itself, this test currently fails. Fix it by removing any DTC variable before starting the test. Signed-off-by: Simon Glass <sjg@chromium.org> --- tools/buildman/test.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/buildman/test.py b/tools/buildman/test.py index 735203e934c..c7000b58bdf 100644 --- a/tools/buildman/test.py +++ b/tools/buildman/test.py @@ -1012,6 +1012,7 @@ class TestBuild(unittest.TestCase): def test_skip_dtc(self): """Test skipping building the dtc tool""" + os.environ.pop('DTC', None) old_path = os.getenv('PATH') try: os.environ['PATH'] = self.base_dir -- 2.43.0

From: Simon Glass <sjg@chromium.org> Use a different variable to avoid overriding the toolchain module in this function. Signed-off-by: Simon Glass <sjg@chromium.org> --- tools/buildman/test.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/buildman/test.py b/tools/buildman/test.py index c7000b58bdf..b4e612bc5d6 100644 --- a/tools/buildman/test.py +++ b/tools/buildman/test.py @@ -1030,14 +1030,14 @@ class TestBuild(unittest.TestCase): build = builder.Builder(self.toolchains, self.base_dir, None, 0, 2, dtc_skip=True) - toolchain = self.toolchains.Select('arm') - env = build.make_environment(toolchain) + tch = self.toolchains.Select('arm') + env = build.make_environment(tch) self.assertIn(b'DTC', env) # Try the normal case, i.e. not skipping the dtc build build = builder.Builder(self.toolchains, self.base_dir, None, 0, 2) - toolchain = self.toolchains.Select('arm') - env = build.make_environment(toolchain) + tch = self.toolchains.Select('arm') + env = build.make_environment(tch) self.assertNotIn(b'DTC', env) finally: os.environ['PATH'] = old_path -- 2.43.0

From: Simon Glass <sjg@chromium.org> If CPP is set (e.g. to 'gcc -E') buildman currently gives an error. Add a little more logic to handle this case. Signed-off-by: Simon Glass <sjg@chromium.org> --- tools/buildman/boards.py | 4 ++-- tools/buildman/func_test.py | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/buildman/boards.py b/tools/buildman/boards.py index eaeeb5ec8dc..2330315fe95 100644 --- a/tools/buildman/boards.py +++ b/tools/buildman/boards.py @@ -247,8 +247,8 @@ class KconfigScanner: temp = None if b'#include' in tools.read_file(defconfig): - cmd = [ - os.getenv('CPP', 'cpp'), + cpp = os.getenv('CPP', 'cpp').split() + cmd = cpp + [ '-nostdinc', '-P', '-I', self._srctree, '-undef', diff --git a/tools/buildman/func_test.py b/tools/buildman/func_test.py index 968765b713c..6fc08e02fb8 100644 --- a/tools/buildman/func_test.py +++ b/tools/buildman/func_test.py @@ -427,7 +427,8 @@ class TestFunctional(unittest.TestCase): return self._HandleCommandSize(args) elif cmd.endswith( 'cpp'): return self._HandleCommandCpp(args) - + elif cmd == 'gcc' and args[0] == '-E': + return self._HandleCommandCpp(args[1:]) if not result: # Not handled, so abort print('unknown command', kwargs) -- 2.43.0

From: Simon Glass <sjg@chromium.org> If CROSS_COMPILE is set in the environment passed to buildman, testMakeEnvironment() fails. Fix this by removing the variable before starting the test. Signed-off-by: Simon Glass <sjg@chromium.org> --- tools/buildman/test.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/buildman/test.py b/tools/buildman/test.py index b4e612bc5d6..a134ac4f917 100644 --- a/tools/buildman/test.py +++ b/tools/buildman/test.py @@ -650,6 +650,7 @@ class TestBuild(unittest.TestCase): def testMakeEnvironment(self): """Test the MakeEnvironment function""" + os.environ.pop('CROSS_COMPILE', None) tc = self.toolchains.Select('arm') env = tc.MakeEnvironment(False) self.assertEqual(env[b'CROSS_COMPILE'], b'arm-linux-') -- 2.43.0

From: Simon Glass <sjg@chromium.org> Provide a test which covers this feature of the EnsureCompiled() function. Signed-off-by: Simon Glass <sjg@chromium.org> --- tools/dtoc/test/dtoc_test_inc.dts | 14 ++++++++++++++ tools/dtoc/test/test-include.dtsi | 5 +++++ tools/dtoc/test_fdt.py | 10 ++++++++++ 3 files changed, 29 insertions(+) create mode 100644 tools/dtoc/test/dtoc_test_inc.dts create mode 100644 tools/dtoc/test/test-include.dtsi diff --git a/tools/dtoc/test/dtoc_test_inc.dts b/tools/dtoc/test/dtoc_test_inc.dts new file mode 100644 index 00000000000..bf87fffb8fc --- /dev/null +++ b/tools/dtoc/test/dtoc_test_inc.dts @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Test device tree file for dtoc + * + * Copyright 2017 Google, Inc + */ + +/dts-v1/; + +/ { +}; + +/include/ "test-include.dtsi" +#include "test-include.dtsi" diff --git a/tools/dtoc/test/test-include.dtsi b/tools/dtoc/test/test-include.dtsi new file mode 100644 index 00000000000..45b9da6dd0a --- /dev/null +++ b/tools/dtoc/test/test-include.dtsi @@ -0,0 +1,5 @@ +// SPDX-License-Identifier: GPL-2.0+ +/ { + #address-cells = <1>; + #size-cells = <1>; +}; diff --git a/tools/dtoc/test_fdt.py b/tools/dtoc/test_fdt.py index a0bed4e18bb..d66b7eb0f98 100755 --- a/tools/dtoc/test_fdt.py +++ b/tools/dtoc/test_fdt.py @@ -932,6 +932,16 @@ class TestFdtUtil(unittest.TestCase): finally: tools.outdir = old_outdir + def test_ensure_compiled_indir(self): + """Test compiling with input directories specified""" + tmpdir = tempfile.mkdtemp(prefix='test_fdt.') + dest = os.path.join(tmpdir, 'try.dts') + shutil.copy(find_dtb_file('dtoc_test_inc.dts'), dest) + + dtb = fdt_util.EnsureCompiled(dest, indir=['tools/dtoc/test']) + self.assertEqual(dtb, fdt_util.EnsureCompiled(dtb)) + shutil.rmtree(tmpdir) + def test_get_phandle_name_offset(self): val = fdt_util.GetPhandleNameOffset(self.node, 'missing') self.assertIsNone(val) -- 2.43.0

From: Simon Glass <sjg@chromium.org> This test uses the same directory as the vboot tests, which means that they conflict when tests are run in parallel. Add a 'pk-' prefix to avoid this. Signed-off-by: Simon Glass <sjg@chromium.org> --- test/py/tests/test_vboot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/py/tests/test_vboot.py b/test/py/tests/test_vboot.py index 06229db41dd..a2545ab3b60 100644 --- a/test/py/tests/test_vboot.py +++ b/test/py/tests/test_vboot.py @@ -634,7 +634,7 @@ def test_fdt_add_pubkey(ubman, name, sha_algo, padding, sign_options, algo_arg): # Check with fit_check_sign that FIT is signed with key utils.run_and_log(ubman, [fit_check_sign, '-f', fit, '-k', dtb]) - tmpdir = os.path.join(ubman.config.result_dir, name) + '/' + tmpdir = os.path.join(ubman.config.result_dir, f'pk-{name}') + '/' if not os.path.exists(tmpdir): os.mkdir(tmpdir) datadir = ubman.config.source_dir + '/test/py/tests/vboot/' -- 2.43.0

From: Simon Glass <sjg@chromium.org> The current directory may be changed by a tool run from this script, so use an absolute path when setting the DTC variable. Signed-off-by: Simon Glass <sjg@chromium.org> --- test/run | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/run b/test/run index 6352562e73e..b9a8eb1ea3f 100755 --- a/test/run +++ b/test/run @@ -75,12 +75,15 @@ if [ -z "$tools_only" ]; then echo "${prompt}" run_test "sandbox_flattree" ./test/py/test.py --bd sandbox_flattree \ ${para} --build -k "${ut_mark_expr}" +else + # Make sure sandbox_spl is built, as we need it from now on + ./test/py/test.py --bd sandbox_spl --build -k none fi # Set up a path to dtc (device-tree compiler) and libfdt.py, a library it # provides and which is built by the sandbox_spl config. Also set up the path # to tools build by the build. -DTC_DIR=build-sandbox_spl/scripts/dtc +DTC_DIR=$(pwd)/build-sandbox_spl/scripts/dtc export PYTHONPATH=${DTC_DIR}/pylibfdt export DTC=${DTC_DIR}/dtc TOOLS_DIR=build-sandbox_spl/tools -- 2.43.0

From: Simon Glass <sjg@chromium.org> The original purpose of 'make tcheck' was to run the tools and skip any pytests. This has been lost by the addition of sandbox_noinst and sandbox_vpl Restore the intended behaviour by skipping all tests with sandbox_spl (since it still needs to be built) and skipping the other builds entirely. Signed-off-by: Simon Glass <sjg@chromium.org> --- test/run | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/test/run b/test/run index b9a8eb1ea3f..c48f08e0844 100755 --- a/test/run +++ b/test/run @@ -50,31 +50,33 @@ if [ -z "$tools_only" ]; then echo "${prompt}" run_test "sandbox" ./test/py/test.py --bd sandbox --build ${para} \ -k "${mark_expr}" -fi -# Run tests which require sandbox_spl -echo "${prompt}" -run_test "sandbox_spl" ./test/py/test.py --bd sandbox_spl --build ${para} \ + # Run tests which require sandbox_spl + echo "${prompt}" + run_test "sandbox_spl" ./test/py/test.py --bd sandbox_spl \ + --build ${para} \ -k 'test_ofplatdata or test_handoff or test_spl' -# Run the same tests with sandbox_noinst (i.e. without OF_PLATDATA_INST) -echo "${prompt}" -run_test "sandbox_noinst" ./test/py/test.py --bd sandbox_noinst --build ${para} \ + # Run the same tests with sandbox_noinst (i.e. without OF_PLATDATA_INST) + echo "${prompt}" + run_test "sandbox_noinst" ./test/py/test.py --bd sandbox_noinst \ + --build ${para} \ -k 'test_ofplatdata or test_handoff or test_spl' -# Run tests which require sandbox_vpl -echo "${prompt}" -run_test "sandbox_vpl" ./test/py/test.py --bd sandbox_vpl --build ${para} \ + # Run tests which require sandbox_vpl + echo "${prompt}" + run_test "sandbox_vpl" ./test/py/test.py --bd sandbox_vpl \ + --build ${para} \ -k 'vpl or test_spl' -if [ -z "$tools_only" ]; then # Run tests for the flat-device-tree version of sandbox. This is a special # build which does not enable CONFIG_OF_LIVE for the live device tree, so we can # check that functionality is the same. The standard sandbox build (above) uses # CONFIG_OF_LIVE. echo "${prompt}" run_test "sandbox_flattree" ./test/py/test.py --bd sandbox_flattree \ - ${para} --build -k "${ut_mark_expr}" + --build ${para} \ + -k "${ut_mark_expr}" else # Make sure sandbox_spl is built, as we need it from now on ./test/py/test.py --bd sandbox_spl --build -k none -- 2.43.0

From: Simon Glass <sjg@chromium.org> Pytest shows about 10 lines of output of limited merit at the top. Use the -q flag to request that it doesn't so that the actionable things are more visible. Signed-off-by: Simon Glass <sjg@chromium.org> --- test/run | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/test/run b/test/run index c48f08e0844..1f60fc8fb61 100755 --- a/test/run +++ b/test/run @@ -13,6 +13,8 @@ run_test() { [ $? -ne 0 ] && failures=$((failures+1)) } +quiet=-q + # Clean up things the Makefile created unset MAKE MAKEFLAGS MAKELEVEL MAKEOVERRIDES MAKE_TERMERR MAKE_TERMOUT @@ -49,24 +51,24 @@ if [ -z "$tools_only" ]; then # Run all tests that the standard sandbox build can support echo "${prompt}" run_test "sandbox" ./test/py/test.py --bd sandbox --build ${para} \ - -k "${mark_expr}" + ${quiet} -k "${mark_expr}" # Run tests which require sandbox_spl echo "${prompt}" run_test "sandbox_spl" ./test/py/test.py --bd sandbox_spl \ - --build ${para} \ + --build ${para} ${quiet} \ -k 'test_ofplatdata or test_handoff or test_spl' # Run the same tests with sandbox_noinst (i.e. without OF_PLATDATA_INST) echo "${prompt}" run_test "sandbox_noinst" ./test/py/test.py --bd sandbox_noinst \ - --build ${para} \ + --build ${para} ${quiet} \ -k 'test_ofplatdata or test_handoff or test_spl' # Run tests which require sandbox_vpl echo "${prompt}" run_test "sandbox_vpl" ./test/py/test.py --bd sandbox_vpl \ - --build ${para} \ + --build ${para} ${quiet} \ -k 'vpl or test_spl' # Run tests for the flat-device-tree version of sandbox. This is a special @@ -75,7 +77,7 @@ if [ -z "$tools_only" ]; then # CONFIG_OF_LIVE. echo "${prompt}" run_test "sandbox_flattree" ./test/py/test.py --bd sandbox_flattree \ - --build ${para} \ + --build ${para} ${quiet} \ -k "${ut_mark_expr}" else # Make sure sandbox_spl is built, as we need it from now on -- 2.43.0

From: Simon Glass <sjg@chromium.org> Binman needs access to tools like mkimage and cbfstool to run all the tests. Set up the TOOLS_DIR earlier and allow use of a TOOLS_DIR environment variable to specify where the tools are. This can be used from CI, for example. Signed-off-by: Simon Glass <sjg@chromium.org> --- test/run | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/test/run b/test/run index 1f60fc8fb61..f6d39989fb8 100755 --- a/test/run +++ b/test/run @@ -90,9 +90,12 @@ fi DTC_DIR=$(pwd)/build-sandbox_spl/scripts/dtc export PYTHONPATH=${DTC_DIR}/pylibfdt export DTC=${DTC_DIR}/dtc -TOOLS_DIR=build-sandbox_spl/tools +TOOLS_DIR=$(pwd)/build-sandbox_spl/tools -run_test "binman" ./tools/binman/binman --toolpath ${TOOLS_DIR} test +# TOOLPATH may be defined to provide mkimage, cbfstool, etc. +export PATH=$PATH:${TOOLS_DIR} + +run_test "binman" ./tools/binman/binman ${TOOLPATH} test run_test "patman" ./tools/patman/patman test run_test "u_boot_pylib" ./tools/u_boot_pylib/u_boot_pylib @@ -106,8 +109,7 @@ run_test "dtoc" ./tools/dtoc/dtoc -t # Code-coverage tests cannot run in parallel, so skip them in that case if [ -z "${para}" ]; then - export PATH=$PATH:${TOOLS_DIR} - run_test "binman code coverage" ./tools/binman/binman test -T + run_test "binman code coverage" ./tools/binman/binman ${TOOLPATH} test -T run_test "dtoc code coverage" ./tools/dtoc/dtoc -T run_test "fdt code coverage" ./tools/dtoc/test_fdt -T fi -- 2.43.0

From: Simon Glass <sjg@chromium.org> Add these to CI so that we can keep them running more easily. Sadly the 'make check' takes about 10mins to run, so put these in the test.py stage, where there are other slow tests. Unfortunately 'make pcheck' doesn't work in CI: https://concept.u-boot.org/u-boot/u-boot/-/jobs/115074 The problem may be due to a race between image-creation and testing using those images. Further work is needed to improve handling of fixtures when running tests in parallel. Signed-off-by: Simon Glass <sjg@chromium.org> --- .gitlab-ci.yml | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a8dbf1970a2..642f3483fc2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -336,6 +336,53 @@ Check packing of Python tools: script: - make pip +# Template for running the 'make check' tools +.python_check_template: + stage: test.py + rules: + - if: $LAB_ONLY == "1" + when: never + - if: $TEST_SUITES == "1" + when: always + - when: never + before_script: + - git config --global user.name "GitLab CI Runner"; + git config --global user.email trini@konsulko.com; + git config --global --add safe.directory "${CI_PROJECT_DIR}"; + export USER=gitlab; + python3 -m venv /tmp/venv; + . /tmp/venv/bin/activate; + pip install -r test/py/requirements.txt -r tools/binman/requirements.txt + -r tools/buildman/requirements.txt -r tools/patman/requirements.txt + -r tools/u_boot_pylib/requirements.txt; + export UBOOT_TRAVIS_BUILD_DIR=/tmp/tools-only; + export PYTHONPATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt"; + export PATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH}"; + # Set environment variables + - export TOOLPATH="--toolpath ${pwd}/build-sandbox/tools --toolpath /opt/coreboot" + - export PATH=/opt/qemu/bin:${PATH} + +Check make check: + extends: .python_check_template + script: + - make check + +Check make qcheck: + extends: .python_check_template + script: + - make qcheck + +Check make tcheck: + extends: .python_check_template + script: + - make tcheck + +# This currently fails, so disable it +#Check make pcheck: +# extends: .python_check_template +# script: +# - make pcheck + # Test sandbox with test.py sandbox test.py: variables: -- 2.43.0
participants (2)
-
Simon Glass
-
Simon Glass