[PATCH] test: dm: add button_cmd test

Tom Rini trini at konsulko.com
Fri Mar 1 15:53:28 CET 2024


On Wed, Feb 14, 2024 at 05:03:46PM +0000, Caleb Connolly wrote:

> Add a test for the button_cmd feature. This validates that commands can
> be mapped to two buttons, that the correct command runs based on which
> button is pressed, that only 1 command is run, and that no command runs
> if button_cmd_0_name is wrong or unset.
> 
> CONFIG_BUTTON is now enabled automatically and was removed when running
> save_defconfig.
> 
> Signed-off-by: Caleb Connolly <caleb.connolly at linaro.org>

Locally this fails:
========================================== FAILURES ===========================================
______________________________ test_ut[ut_dm_dm_test_button_cmd] ______________________________
test/py/u_boot_spawn.py:195: in expect
    c = os.read(self.fd, 1024).decode(errors='replace')
E   OSError: [Errno 5] Input/output error

During handling of the above exception, another exception occurred:
test/py/tests/test_ut.py:509: in test_ut
    output = u_boot_console.run_command('ut ' + ut_subtest)
test/py/u_boot_console_base.py:266: in run_command
    m = self.p.expect([self.prompt_compiled] + self.bad_patterns)
test/py/u_boot_spawn.py:204: in expect
    raise ValueError('U-Boot exited with %s' % info)
E   ValueError: U-Boot exited with signal 11 (SIGSEGV)
------------------------------------ Captured stdout call -------------------------------------
=> ut dm dm_test_button_cmd
Test: dm_test_button_cmd: button.c
BTN 'button1'> env set test_button_cmds_0 PASS
BTN 'button1'> env set test_button_cmds_0 PASS
BTN 'button2'> env set test_button_cmds_1 PASS
=================================== short test summary info ===================================
FAILED test/py/tests/test_ut.py::test_ut[ut_dm_dm_test_button_cmd] - ValueError: U-Boot exit...

On top of current master.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20240301/310c71d2/attachment.sig>


More information about the U-Boot mailing list