[PATCH 1/6] beagleplay: Drop EFI self-tests

From: Simon Glass <sjg@chromium.org> These don't actually seem to work, since the rest cannot be handled by the lab. Disable them. Preparing for reset. Press any key... FAILED: test/py/tests/test_efi_selftest.py:20: in test_efi_selftest_base raise Exception('Failures occurred during the EFI selftest') E Exception: Failures occurred during the EFI selftest 48053.8 ms Signed-off-by: Simon Glass <sjg@chromium.org> --- configs/am62x_beagleplay_a53_defconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/configs/am62x_beagleplay_a53_defconfig b/configs/am62x_beagleplay_a53_defconfig index 5cb51732da5..bbef33ace65 100644 --- a/configs/am62x_beagleplay_a53_defconfig +++ b/configs/am62x_beagleplay_a53_defconfig @@ -53,7 +53,6 @@ CONFIG_SPL_DM_MAILBOX=y CONFIG_SPL_POWER_DOMAIN=y CONFIG_SPL_RAM_DEVICE=y CONFIG_SPL_YMODEM_SUPPORT=y -CONFIG_CMD_BOOTEFI_SELFTEST=y CONFIG_CMD_NVEDIT_EFI=y CONFIG_CMD_DFU=y CONFIG_CMD_GPIO=y -- 2.43.0 base-commit: 290829cc0d20dc4da5a8dfa43b94adcf368bc1b1 branch: labf

From: Simon Glass <sjg@chromium.org> It is quite tricky to debug problems in the test.py code itself, as when something goes wrong the exception failure is caught and reported as a test failure. Add a -E option to simplify debugging. Signed-off-by: Simon Glass <sjg@chromium.org> --- test/py/conftest.py | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/test/py/conftest.py b/test/py/conftest.py index 4460e5a3af2..7ac777fea7f 100644 --- a/test/py/conftest.py +++ b/test/py/conftest.py @@ -87,6 +87,9 @@ def pytest_addoption(parser): help='Compile U-Boot before running tests') parser.addoption('--buildman', default=False, action='store_true', help='Use buildman to build U-Boot (assuming --build is given)') + parser.addoption( + '-E', '--allow-exceptions', '-E', default=False, action='store_true', + help='Avoid catching exceptions with test failures') parser.addoption('--gdbserver', default=None, help='Run sandbox under gdbserver. The argument is the channel '+ 'over which gdbserver should communicate, e.g. localhost:1234') @@ -336,6 +339,7 @@ def pytest_configure(config): ubconfig.connection_ok = True ubconfig.timing = config.getoption('timing') ubconfig.role = config.getoption('role') + ubconfig.allow_exceptions = config.getoption('allow_exceptions') env_vars = ( 'board_type', @@ -507,6 +511,9 @@ def ubman(request): if not ubconfig.connection_ok: pytest.skip('Cannot get target connection') return None + if ubman_fix.config.allow_exceptions: + ubman_fix.ensure_spawned() + return ubman_fix try: ubman_fix.ensure_spawned() except OSError as err: @@ -880,20 +887,23 @@ def pytest_runtest_protocol(item, nextitem): test_list.append(item.name) tests_not_run.remove(item.name) - try: + if ubman_fix.config.allow_exceptions: msg_log(msg) - except: - # If something went wrong with logging, it's better to let the test - # process continue, which may report other exceptions that triggered - # the logging issue (e.g. ubman_fix.log wasn't created). Hence, just - # squash the exception. If the test setup failed due to e.g. syntax - # error somewhere else, this won't be seen. However, once that issue - # is fixed, if this exception still exists, it will then be logged as - # part of the test's stdout. - import traceback - print('Exception occurred while logging runtest status:') - traceback.print_exc() - # FIXME: Can we force a test failure here? + else: + try: + msg_log(msg) + except: + # If something went wrong with logging, it's better to let the test + # process continue, which may report other exceptions that triggered + # the logging issue (e.g. ubman_fix.log wasn't created). Hence, just + # squash the exception. If the test setup failed due to e.g. syntax + # error somewhere else, this won't be seen. However, once that issue + # is fixed, if this exception still exists, it will then be logged + # as part of the test's stdout. + import traceback + print('Exception occurred while logging runtest status:') + traceback.print_exc() + # FIXME: Can we force a test failure here? log.end_section(item.name) -- 2.43.0 base-commit: 290829cc0d20dc4da5a8dfa43b94adcf368bc1b1 branch: labf

From: Simon Glass <sjg@chromium.org> The V variable includes the -v flag if verbose operation is requested in Labgrid. Add it to the console cmdline. Signed-off-by: Simon Glass <sjg@chromium.org> --- test/hooks/bin/console.labgrid-sjg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/hooks/bin/console.labgrid-sjg b/test/hooks/bin/console.labgrid-sjg index f521acea4a5..13b3d169681 100644 --- a/test/hooks/bin/console.labgrid-sjg +++ b/test/hooks/bin/console.labgrid-sjg @@ -38,6 +38,6 @@ exec labgrid-client -V do-bootstrap ${bootstrap:-1} -V do-build ${build:-1} \ -V do-send ${send:-0} -V do-clean ${clean:-0} ${vars} \ - -V process-limit ${BUILDMAN_PROCESS_LIMIT:-0} \ + -V process-limit ${BUILDMAN_PROCESS_LIMIT:-0} ${V} \ -r "${U_BOOT_BOARD_IDENTITY}" ${strategy} ${verbose} -a console \ ${console_log} -- 2.43.0 base-commit: 290829cc0d20dc4da5a8dfa43b94adcf368bc1b1 branch: labf

From: Simon Glass <sjg@chromium.org> One line is indented with tab instead of space. Fix it. Signed-off-by: Simon Glass <sjg@chromium.org> --- test/py/conftest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/py/conftest.py b/test/py/conftest.py index 7ac777fea7f..16f28db6e23 100644 --- a/test/py/conftest.py +++ b/test/py/conftest.py @@ -170,7 +170,7 @@ def get_details(config): if build_dir_extra: env['U_BOOT_BUILD_DIR_EXTRA'] = build_dir_extra - # Make sure the script sees that it is being run from pytest + # Make sure the script sees that it is being run from pytest env['U_BOOT_SOURCE_DIR'] = source_dir proc = subprocess.run(cmd, stdout=subprocess.PIPE, -- 2.43.0 base-commit: 290829cc0d20dc4da5a8dfa43b94adcf368bc1b1 branch: labf

From: Simon Glass <sjg@chromium.org> Labgrid has a --log-output option to allow writing its log output to a file. Add a way to control this from Labgrid's U-Boot scripts. Signed-off-by: Simon Glass <sjg@chromium.org> --- test/hooks/bin/console.labgrid-sjg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/hooks/bin/console.labgrid-sjg b/test/hooks/bin/console.labgrid-sjg index 13b3d169681..fb91c5eacb8 100644 --- a/test/hooks/bin/console.labgrid-sjg +++ b/test/hooks/bin/console.labgrid-sjg @@ -38,6 +38,6 @@ exec labgrid-client -V do-bootstrap ${bootstrap:-1} -V do-build ${build:-1} \ -V do-send ${send:-0} -V do-clean ${clean:-0} ${vars} \ - -V process-limit ${BUILDMAN_PROCESS_LIMIT:-0} ${V} \ + -V process-limit ${BUILDMAN_PROCESS_LIMIT:-0} ${log_output} ${V} \ -r "${U_BOOT_BOARD_IDENTITY}" ${strategy} ${verbose} -a console \ ${console_log} -- 2.43.0 base-commit: 290829cc0d20dc4da5a8dfa43b94adcf368bc1b1 branch: labf

From: Simon Glass <sjg@chromium.org> No caller uses this argument, so drop it. Signed-off-by: Simon Glass <sjg@chromium.org> --- test/py/console_sandbox.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/test/py/console_sandbox.py b/test/py/console_sandbox.py index da55d2fcc1f..dd721067f8f 100644 --- a/test/py/console_sandbox.py +++ b/test/py/console_sandbox.py @@ -60,14 +60,11 @@ class ConsoleSandbox(ConsoleBase): cmd += self.sandbox_flags return Spawn(cmd, cwd=self.config.source_dir, decode_signal=True) - def restart_uboot_with_flags(self, flags, expect_reset=False, use_dtb=True): + def restart_uboot_with_flags(self, flags, use_dtb=True): """Run U-Boot with the given command-line flags Args: flags: List of flags to pass, each a string - expect_reset: Boolean indication whether this boot is expected - to be reset while the 1st boot process after main boot before - prompt. False by default. use_dtb: True to use a device tree file, False to run without one Returns: @@ -77,7 +74,7 @@ class ConsoleSandbox(ConsoleBase): try: self.sandbox_flags = flags self.use_dtb = use_dtb - return self.restart_uboot(expect_reset) + return self.restart_uboot(False) finally: self.sandbox_flags = [] self.use_dtb = True -- 2.43.0 base-commit: 290829cc0d20dc4da5a8dfa43b94adcf368bc1b1 branch: labf
participants (1)
-
Simon Glass