From ed817bf0f305bae59d82e92aff1ad4869d40652c Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Fri, 12 Sep 2025 16:29:24 -0700 Subject: [PATCH] desktop_update_graphical: handle multiple key import prompts Signed-off-by: Adam Williamson --- tests/desktop_update_graphical.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/desktop_update_graphical.pm b/tests/desktop_update_graphical.pm index 1ee81c67..218db152 100644 --- a/tests/desktop_update_graphical.pm +++ b/tests/desktop_update_graphical.pm @@ -101,14 +101,16 @@ sub run { click_lastmatch if (check_screen "desktop_package_tool_update_download_unsigned", 30); } elsif ($desktop eq 'gnome' && !get_var("ADVISORY_OR_TASK")) { - # we might get a key import prompt + # we might get key import prompts # https://gitlab.gnome.org/GNOME/gnome-software/-/issues/2874 # this won't happen for update tests as we've already # imported it in an earlier dnf command-line operation - if (check_screen 'desktop_package_tool_import_key', 30) { + my $limit = 5; + while (check_screen 'desktop_package_tool_import_key', 30 && $limit) { click_lastmatch; my $pass = get_var("USER_PASSWORD", "weakpassword"); type_very_safely("$pass\n") if (check_screen("auth_required", 10)); + $limit--; } } # If there is an issue and Software reports it, let us click