From e1ffd8aabd45da8f99d0ef7546da70ea8d2ef7fd Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Wed, 22 May 2019 15:18:08 -0700 Subject: [PATCH] Fix text install test for 'use password' now being default 'use password' now seems to be default when creating a user in text mode, so we need to handle that. Signed-off-by: Adam Williamson --- lib/utils.pm | 12 +++++++++++- tests/install_text.pm | 7 +++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/lib/utils.pm b/lib/utils.pm index c071d919..3bb0cbb6 100644 --- a/lib/utils.pm +++ b/lib/utils.pm @@ -7,7 +7,7 @@ use Exporter; use lockapi; use testapi; -our @EXPORT = qw/run_with_error_check type_safely type_very_safely desktop_vt boot_to_login_screen console_login console_switch_layout desktop_switch_layout console_loadkeys_us do_bootloader boot_decrypt check_release menu_launch_type start_cockpit repo_setup gnome_initial_setup anaconda_create_user check_desktop_clean download_modularity_tests quit_firefox advisory_get_installed_packages advisory_check_nonmatching_packages start_with_launcher quit_with_shortcut disable_firefox_studies select_rescue_mode copy_devcdrom_as_isofile bypass_1691487/; +our @EXPORT = qw/run_with_error_check type_safely type_very_safely desktop_vt boot_to_login_screen console_login console_switch_layout desktop_switch_layout console_loadkeys_us do_bootloader boot_decrypt check_release menu_launch_type start_cockpit repo_setup gnome_initial_setup anaconda_create_user check_desktop_clean download_modularity_tests quit_firefox advisory_get_installed_packages advisory_check_nonmatching_packages start_with_launcher quit_with_shortcut disable_firefox_studies select_rescue_mode copy_devcdrom_as_isofile bypass_1691487 get_release_number/; sub run_with_error_check { my ($func, $error_screen) = @_; @@ -880,3 +880,13 @@ sub bypass_1691487 { script_run 'echo "trial bypass dup chars brc#1691487"'; } } + +sub get_release_number { + # return the release number; so usually VERSION, but for Rawhide, + # we return RAWREL. This allows us to avoid constantly doing stuff + # like `if ($version eq "Rawhide" || $version > 30)`. + my $version = get_var("VERSION"); + my $rawrel = get_var("RAWREL", "Rawhide"); + return $rawrel if ($version eq "Rawhide"); + return $version +} diff --git a/tests/install_text.pm b/tests/install_text.pm index 720d5924..db5e1fd8 100644 --- a/tests/install_text.pm +++ b/tests/install_text.pm @@ -61,8 +61,11 @@ sub run { type_string get_var("USER_LOGIN", "test"); send_key "ret"; wait_still_screen 5; - # typing "4\n" on abrt screen causes system to reboot, so be careful - run_with_error_check(sub {type_string "4\n"}, "anaconda_text_error"); # use password + # from Rawhide-20190503.n.0 (F31) onwards, 'use password' is default + if (get_release_number() > 30) { + # typing "4\n" on abrt screen causes system to reboot, so be careful + run_with_error_check(sub {type_string "4\n"}, "anaconda_text_error"); # use password + } wait_still_screen 5; type_string "5\n"; # set password wait_still_screen 5;