From a091185af1ec344951063d92258756550d7aa567 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Tue, 17 Jan 2017 23:13:47 -0800 Subject: [PATCH] Handle 'non-ASCII in password' warning for Russian installs Summary: Since 26.17, anaconda shows a warning when the user password contains non-ASCII characters, and requires a second Done click to confirm. This change should handle that. On the 'catch cases where password typing went wrong and re-try' bit: to keep that, but not re-type the password *every single time* on the Russian install test, we'd have to make the needle match the text of the warning. This is problematic because then that needle will be able to break without us easily noticing; that's why I wanted to keep the 'warning bar' needle text-free. Unfortunately, that means we have to skip the protection for switched-layout installs. Note the protection was actually not working for any non-English install anyhow, because the needle had `LANGUAGE-english` as a tag. We never noticed that. Failed password typing is pretty rare now, so we can live without the protection - it's just nice to have it for the English install tests because there's so many of them. Test Plan: Run the Russian install with a recent Rawhide image, check it clicks 'Done' twice. Note, it will still fail, because of RHBZ #1413813. Reviewers: jskladan, garretraziel_but_actually_jsedlak_who_uses_stupid_nicknames Reviewed By: garretraziel_but_actually_jsedlak_who_uses_stupid_nicknames Subscribers: tflink Differential Revision: https://phab.qa.fedoraproject.org/D1084 --- needles/anaconda/universal/warning_bar.json | 3 +-- tests/_do_install_and_reboot.pm | 13 +++++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/needles/anaconda/universal/warning_bar.json b/needles/anaconda/universal/warning_bar.json index 06d7ddb0..f382eb61 100644 --- a/needles/anaconda/universal/warning_bar.json +++ b/needles/anaconda/universal/warning_bar.json @@ -11,7 +11,6 @@ "properties": [], "tags": [ "ENV-DISTRI-fedora", - "LANGUAGE-english", "anaconda_warning_bar" ] -} \ No newline at end of file +} diff --git a/tests/_do_install_and_reboot.pm b/tests/_do_install_and_reboot.pm index 5d5c70f5..8533e6d3 100644 --- a/tests/_do_install_and_reboot.pm +++ b/tests/_do_install_and_reboot.pm @@ -71,8 +71,10 @@ sub run { wait_still_screen 2; $self->type_user_password(); # even with all our slow typing this still *sometimes* seems to - # miss a character, so let's try again if we have a warning bar - if (check_screen "anaconda_warning_bar", 3) { + # miss a character, so let's try again if we have a warning bar. + # But not if we're installing with a switched layout, as those + # will *always* result in a warning bar at this point (see below) + if (!get_var("SWITCHED_LAYOUT") && check_screen "anaconda_warning_bar", 3) { wait_screen_change { send_key "shift-tab"; }; wait_still_screen 2; $self->type_user_password(); @@ -82,6 +84,13 @@ sub run { } assert_and_click "anaconda_install_user_creation_make_admin"; assert_and_click "anaconda_spoke_done"; + # since 20170105, we will get a warning here when the password + # contains non-ASCII characters. Assume only switched layouts + # produce non-ASCII characters, though this isn't strictly true + if (get_var('SWITCHED_LAYOUT') && check_screen "anaconda_warning_bar", 3) { + wait_still_screen 1; + assert_and_click "anaconda_spoke_done"; + } # Check username (and hence keyboard layout) if non-English if (get_var('LANGUAGE')) {