| c10eb9d3 | 22-Jan-2016 |
Stephen Warren <swarren@nvidia.com> |
test/py: drain console log at the end of any failed test
Tests may fail for a number of reasons, and in particular for reasons other than a timeout waiting for U-Boot to print expected data. If the
test/py: drain console log at the end of any failed test
Tests may fail for a number of reasons, and in particular for reasons other than a timeout waiting for U-Boot to print expected data. If the last operation that a failed test performs is not waiting for U-Boot to print something, then any trailing output from U-Boot during that test's operation will not be logged as part of that test, but rather either along with the next test, or even thrown away, potentiall hiding clues re: the test failure reason.
Solve this by explicitly draining (and hence logging) the U-Boot output in the case of failed tests.
Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Simon Glass <sjg@chromium.org>
show more ...
|
| 636f38d8 | 22-Jan-2016 |
Stephen Warren <swarren@nvidia.com> |
test/py: move U-Boot respawn trigger to the test core
Prior to this change, U-Boot was lazilly (re-)spawned if/when a test attempted to interact with it, and no active connection existed. This appro
test/py: move U-Boot respawn trigger to the test core
Prior to this change, U-Boot was lazilly (re-)spawned if/when a test attempted to interact with it, and no active connection existed. This approach was simple, yet had the disadvantage that U-Boot might be spawned in the middle of a test function, e.g. after the test had already performed actions such as creating data files, etc. In that case, this could cause the log to contain the sequence (1) some test logs, (2) U-Boot's boot process, (3) the rest of that test's logs. This isn't optimally readable. This issue will affect the upcoming DFU and enhanced UMS tests.
This change converts u_boot_console to be a function-scoped fixture, so that pytest attempts to re-create the object for each test invocation. This allows the fixture factory function to ensure that U-Boot is spawned prior to every test. In practice, the same object is returned each time so there is essentially no additional overhead due to this change.
This allows us to remove:
- The explicit ensure_spawned() call from test_sleep, since the core now ensures that the spawn happens before the test code is executed.
- The laxy calls to ensure_spawned() in the u_boot_console_* implementations.
The one downside is that test_env's "state_ttest_env" fixture must be converted to a function-scoped fixture too, since a module-scoped fixture cannot use a function-scoped fixture. To avoid overhead, we use the same trick of returning the same object each time.
Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Simon Glass <sjg@chromium.org>
show more ...
|
| 747440d0 | 19-Jan-2016 |
Simon Glass <sjg@chromium.org> |
dm: video: test: Test that bitmap display works correctly
Add a test for the 'bmp' command. Test both the uncompressed and compressed versions of the file, since they use different code paths.
Sign
dm: video: test: Test that bitmap display works correctly
Add a test for the 'bmp' command. Test both the uncompressed and compressed versions of the file, since they use different code paths.
Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Anatolij Gustschin <agust@denx.de>
show more ...
|
| 1c8b4d5f | 15-Jan-2016 |
Stephen Warren <swarren@nvidia.com> |
test/py: add a test for the sleep command
Execute "sleep", and validate that it sleeps for approximately the correct amount of time.
Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Sim
test/py: add a test for the sleep command
Execute "sleep", and validate that it sleeps for approximately the correct amount of time.
Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Simon Glass <sjg@chromium.org>
show more ...
|
| 3045d7f0 | 15-Jan-2016 |
Stephen Warren <swarren@nvidia.com> |
test/py: test the ums command
This test invokes the "ums" command in U-Boot, and validates that a USB storage device is enumerated on the test host system, and can be read from.
Signed-off-by: Step
test/py: test the ums command
This test invokes the "ums" command in U-Boot, and validates that a USB storage device is enumerated on the test host system, and can be read from.
Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Simon Glass <sjg@chromium.org>
show more ...
|
| cc156f3f | 15-Jan-2016 |
Stephen Warren <swarren@nvidia.com> |
test/py: test the shell if command
Migrate all most tests from command_ut.c into the Python test system. This allows the tests to be run against any U-Boot binary that supports the if command (i.e.
test/py: test the shell if command
Migrate all most tests from command_ut.c into the Python test system. This allows the tests to be run against any U-Boot binary that supports the if command (i.e. where hush is enabled) without requiring that binary to be permanently bloated with the code from command_ut.
Some tests in command_ut.c can only be executed from C code, since they test internal (more unit-level) features of various U-Boot APIs. The migrated tests can all operate directly from the U-Boot console.
Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Simon Glass <sjg@chromium.org>
show more ...
|
| 8b86c609 | 15-Jan-2016 |
Stephen Warren <swarren@nvidia.com> |
test/py: add test of basic shell functionality
This tests whether the following features of the U-Boot shell: - Execution of a directly entered command. - Compound commands (; delimiter). - Quoting
test/py: add test of basic shell functionality
This tests whether the following features of the U-Boot shell: - Execution of a directly entered command. - Compound commands (; delimiter). - Quoting of arguments containing spaces. - Executing commands from environment variables.
Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Simon Glass <sjg@chromium.org>
show more ...
|
| 98cee89b | 15-Jan-2016 |
Stephen Warren <swarren@wwwdotorg.org> |
test/py: test the md/mw commands
This tests whether md/mw work, and affect each-other.
Command repeat is also tested.
test/cmd_repeat.sh is removed, since the new Python-based test does everything
test/py: test the md/mw commands
This tests whether md/mw work, and affect each-other.
Command repeat is also tested.
test/cmd_repeat.sh is removed, since the new Python-based test does everything it used to.
Signed-off-by: Stephen Warren <swarren@wwwdotorg.org> Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Simon Glass <sjg@chromium.org>
show more ...
|
| 5ab097ab | 15-Jan-2016 |
Stephen Warren <swarren@wwwdotorg.org> |
test/py: add test of setenv/printenv/echo
This tests basic environment variable functionality.
Signed-off-by: Stephen Warren <swarren@wwwdotorg.org> Signed-off-by: Stephen Warren <swarren@nvidia.co
test/py: add test of setenv/printenv/echo
This tests basic environment variable functionality.
Signed-off-by: Stephen Warren <swarren@wwwdotorg.org> Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Simon Glass <sjg@chromium.org>
show more ...
|
| 472040d5 | 15-Jan-2016 |
Stephen Warren <swarren@wwwdotorg.org> |
test/py: test that sandbox exits when asked
Test the sandbox port's implementation of the reset command and SIGHUP handling. These should both cause the U-Boot process to exit gracefully.
Signed-of
test/py: test that sandbox exits when asked
Test the sandbox port's implementation of the reset command and SIGHUP handling. These should both cause the U-Boot process to exit gracefully.
Signed-off-by: Stephen Warren <swarren@wwwdotorg.org> Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Simon Glass <sjg@chromium.org>
show more ...
|