summaryrefslogtreecommitdiff
path: root/test/common
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-07-25 00:14:39 +0300
committerSimon Glass <sjg@chromium.org>2021-08-01 18:05:24 +0300
commitcb8970092f2cd5f1eaadf7d15d28cb905067e07f (patch)
treefbc4925e478f7bb40f24bb09dbb1da8d4e33da3f /test/common
parentea40b20431c0c5de1856c56f965757a40df8d3d7 (diff)
downloadu-boot-cb8970092f2cd5f1eaadf7d15d28cb905067e07f.tar.xz
sandbox: Reduce keyed autoboot delay
The autoboot tests are a recent addition to U-Boot, providing much-needed coverage in this area. A side effect of the keyed autoboot test is that this feature is enabled in sandbox always. This changes the autoboot prompt and confuses the pytests. Some tests become slower, for example the vboot tests take about 27s now instead of 3s. We don't actually need this feature enabled to be able to run the tests. Add a switch to allow sandbox to turn it on and off as needed. Use this in the one test that needs it. Add a command-line flag in case this is desired in normal use. Signed-off-by: Simon Glass <sjg@chromium.org> Fixes: 25c8b9f298e ("test: add first autoboot unit tests") Reviewed-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
Diffstat (limited to 'test/common')
-rw-r--r--test/common/test_autoboot.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/common/test_autoboot.c b/test/common/test_autoboot.c
index 6564ac7049..42a1e4ab1f 100644
--- a/test/common/test_autoboot.c
+++ b/test/common/test_autoboot.c
@@ -16,13 +16,19 @@
static int check_for_input(struct unit_test_state *uts, const char *in,
bool correct)
{
+ bool old_val;
/* The bootdelay is set to 1 second in test_autoboot() */
const char *autoboot_prompt =
"Enter password \"a\" in 1 seconds to stop autoboot";
console_record_reset_enable();
console_in_puts(in);
+
+ /* turn on keyed autoboot for the test, if possible */
+ old_val = autoboot_set_keyed(true);
autoboot_command("echo Autoboot password unlock not successful");
+ old_val = autoboot_set_keyed(old_val);
+
ut_assert_nextline(autoboot_prompt);
if (!correct)
ut_assert_nextline("Autoboot password unlock not successful");