From ce0a04b40a0f92f3eeef7d5ca11ab5e7827f88be Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Wed, 3 Jan 2024 14:13:30 -0800 Subject: [PATCH] Wait and re-assert before entering decryption passphrase (#2256682) New Plymouth seems to have a bug where it shows the decryption prompt briefly then shows a spinner and refreshes it, throwing away any already-typed input. This is breaking our tests quite often (any time os-autoinst is "lucky" enough to spot the first brief appearance of the prompt and start typing). To work around it, after we first see the prompt, wait for the screen to settle and re-assert the needle before typing. This should reliably wait out the refresh cycle. Signed-off-by: Adam Williamson --- lib/utils.pm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/utils.pm b/lib/utils.pm index be3e286e..7d788b06 100644 --- a/lib/utils.pm +++ b/lib/utils.pm @@ -408,6 +408,11 @@ sub boot_decrypt { # decrypt storage during boot; arg is timeout (in seconds) my $timeout = shift || 60; assert_screen "boot_enter_passphrase", $timeout; + # FIXME: wait and re-assert to workaround + # https://bugzilla.redhat.com/show_bug.cgi?id=2256682 , can + # drop this is that is fixed + wait_still_screen 3; + assert_screen "boot_enter_passphrase"; type_string get_var("ENCRYPT_PASSWORD"); send_key "ret"; }