diff --git a/.gitignore b/.gitignore index 02bae73d..7602defe 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ .tox/ .coverage coverage.xml +.tidyall.d/ diff --git a/.perltidyrc b/.perltidyrc new file mode 100644 index 00000000..66964422 --- /dev/null +++ b/.perltidyrc @@ -0,0 +1,16 @@ +# Workaround needed for handling non-ASCII in files. +# # See . +--character-encoding=none +--no-valign +# 120 characters would be desired but it is not feasible right now +#-l=120 # 120 characters per line +-l=160 +-fbl # don't change blank lines +-fnl # don't remove new lines +-nsfs # no spaces before semicolons +-baao # space after operators +-bbao # space before operators +-pt=2 # no spaces around () +-bt=2 # no spaces around [] +-sbt=2 # no spaces around {} +-sct # stack closing tokens )} diff --git a/.tidyallrc b/.tidyallrc new file mode 100644 index 00000000..a516a41c --- /dev/null +++ b/.tidyallrc @@ -0,0 +1,3 @@ +[PerlTidy] +select = **/*.pm +argv = --profile=$ROOT/.perltidyrc diff --git a/.zuul.yaml b/.zuul.yaml index 41cc1e2f..428a7c11 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -6,7 +6,7 @@ - job: name: os-autoinst-perl run: ci/perl.yaml - nodeset: fedora-latest-container + nodeset: fedora-36-vm - project: check: diff --git a/ci/perl.yaml b/ci/perl.yaml index bbc8ec58..bf0b9d37 100644 --- a/ci/perl.yaml +++ b/ci/perl.yaml @@ -2,7 +2,7 @@ tasks: - name: Install required packages package: - name: ['os-autoinst', 'perl-Test-Strict', 'perl-Test-Harness', 'perl-JSON', 'perl-REST-Client'] + name: ['os-autoinst', 'perl-Test-Strict', 'perl-Test-Harness', 'perl-JSON', 'perl-REST-Client', 'perl-Code-TidyAll'] state: present become: yes - name: Run perl tests diff --git a/lib/anaconda.pm b/lib/anaconda.pm index bafb05ad..820c97a3 100644 --- a/lib/anaconda.pm +++ b/lib/anaconda.pm @@ -28,7 +28,7 @@ sub select_disks { ); my %iscsi = %{$args{iscsi}}; # Anaconda hub - assert_screen "anaconda_main_hub", 300; # + assert_screen "anaconda_main_hub", 300; # Damn animation delay can cause bad clicks here too - wait for it sleep 1; assert_and_click "anaconda_main_hub_install_destination"; @@ -150,7 +150,7 @@ sub custom_blivet_add_partition { assert_and_click "anaconda_blivet_size_unit"; assert_and_click "anaconda_blivet_size_unit_mib"; - send_key "shift-tab"; # input is one tab back from unit selection listbox + send_key "shift-tab"; # input is one tab back from unit selection listbox # size input can contain whole set of different values, so we can't match it with needle type_safely $args{size} . "\n"; @@ -176,7 +176,7 @@ sub custom_blivet_add_partition { } sub custom_blivet_format_partition { - # This subroutine formats a selected partition. To use it, you must select the + # This subroutine formats a selected partition. To use it, you must select the # partition by other means before you format it using this routine. # You have to create a needle for any non-existing filesystem that is # passed via the $type, such as anaconda_blivet_part_fs_ext4. @@ -202,14 +202,14 @@ sub custom_blivet_format_partition { sub custom_blivet_resize_partition { # This subroutine resizes the selected (active) partition to a given value. Note, that # if the selected value is bigger than the available space, it will only be - # resized to fill up the available space no matter the number. + # resized to fill up the available space no matter the number. # This routine cannot will not be able to select a particular partition!!! my %args = @_; # Start editing the partition and select the Resize option assert_and_click "anaconda_blivet_part_edit"; assert_and_click "anaconda_blivet_part_resize"; # Select the appropriate units. Note, that there must a be needle existing - # for each possible unit that you might want to use, such as + # for each possible unit that you might want to use, such as # "anaconda_blivet_size_unit_gib". assert_and_click "anaconda_blivet_part_drop_select"; assert_and_click "anaconda_blivet_size_unit_$args{units}"; @@ -300,7 +300,7 @@ sub get_full_repo { # only Server my $variant = 'Everything'; $variant = 'Server' if (get_var("MODULAR")); - $repourl .= "/${variant}/".get_var("ARCH")."/os"; + $repourl .= "/${variant}/" . get_var("ARCH") . "/os"; } return $repourl; } @@ -365,7 +365,7 @@ sub crash_anaconda_text { # This routine uses the Anaconda crash trigger to break the ongoing Anaconda installation to simulate # an Anaconda crash and runs a series of steps that results in creating a bug in Bugzilla. # It is used in the `install_text.pm` test and can be switched on by using the CRASH_REPORT - # variable set to 1. + # variable set to 1. # # First let us navigate to reach the shell window in Anaconda using the alt-f3 combo, # this should take us to another terminal, where we can simulate the crash. @@ -395,14 +395,14 @@ sub report_bug_text { # a textual console. # We will not create a needle for every menu item, and we will fail, # if there will be no positive Bugzilla confirmation shown at the end - # of the process and then we will fail. + # of the process and then we will fail. # # Let us record the time of this test run. Later, we will use it to # limit the Bugzilla search. my $timestamp = time(); # # First, collect the credentials. - my $login = get_var("BUGZILLA_LOGIN"); + my $login = get_var("BUGZILLA_LOGIN"); my $password = get_var("_SECRET_BUGZILLA_PASSWORD"); my $apikey = get_var("_SECRET_BUGZILLA_APIKEY"); # Choose item 1 - Report the bug. @@ -419,12 +419,12 @@ sub report_bug_text { type_password $password; type_string "\n"; sleep 10; - # Save the report without changing it. + # Save the report without changing it. # It would need some more tweaking to actually type into the report, but since # it is reported even if unchanged, we leave it as such. type_string ":wq\n"; # Wait until the Crash menu appears again. - # The same screen shows the result of the Bugzilla operation, + # The same screen shows the result of the Bugzilla operation, # so if the needle matches, the bug has been created in Bugzilla. # Bugzilla connection is slow so we need to wait out some time, # therefore let's use a cycle that will check each 10 seconds and @@ -435,7 +435,7 @@ sub report_bug_text { ++$counter; } # Sometimes, Bugzilla throws out a communication error although the bug has been - # created successfully. If this happens, we will softfail and leave the creation + # created successfully. If this happens, we will softfail and leave the creation # check to a later step. if ($counter > 12) { record_soft_failure "Warning: Bugzilla has reported an error which could mean that the bug has not been created correctly, but it probably is not a real problem, if the test has not failed completely. "; @@ -443,7 +443,7 @@ sub report_bug_text { # Now, let us check with Bugzilla directly, if the bug has been created. # First, we shall get a Bugzilla format timestamp to use it in the query. - # The timestamp will limit the list of bugs to those that have been created since + # The timestamp will limit the list of bugs to those that have been created since # the then -> resulting with high probability in the one that this test run # has just created. $timestamp = convert_to_bz_timestamp($timestamp); @@ -455,7 +455,7 @@ sub report_bug_text { else { print("BUGZILLA: The last bug was found: $lastbug\n"); } - # We have found that the bug indeed is in the bugzilla (otherwise + # We have found that the bug indeed is in the bugzilla (otherwise # we would have died already) so now we close it to clean up after this test run. my $result = close_notabug($lastbug, $apikey); unless ($result) { @@ -467,5 +467,5 @@ sub report_bug_text { # Quit anaconda type_string "4\n"; - + } diff --git a/lib/anacondatest.pm b/lib/anacondatest.pm index 7d427fcd..b9a6907e 100644 --- a/lib/anacondatest.pm +++ b/lib/anacondatest.pm @@ -21,7 +21,8 @@ sub post_fail_hook { if (check_screen "anaconda_error_report", 10) { assert_and_click "anaconda_error_report"; $has_traceback = 1; - } elsif (check_screen "anaconda_text_error", 10) { # also for text install + } elsif (check_screen "anaconda_text_error", 10) { + # also for text install type_string "1\n"; $has_traceback = 1; } @@ -77,27 +78,27 @@ sub post_fail_hook { } if ($dracut) { - upload_logs "/run/initramfs/rdsosreport.txt", failok=>1; + upload_logs "/run/initramfs/rdsosreport.txt", failok => 1; # that's all that's really useful, so... return; } unless (script_run "df -h > /tmp/df.log") { - upload_logs "/tmp/df.log", failok=>1; + upload_logs "/tmp/df.log", failok => 1; } unless (script_run "free -h > /tmp/free.log") { - upload_logs "/tmp/free.log", failok=>1; + upload_logs "/tmp/free.log", failok => 1; } - upload_logs "/tmp/X.log", failok=>1; - upload_logs "/tmp/anaconda.log", failok=>1; - upload_logs "/tmp/packaging.log", failok=>1; - upload_logs "/tmp/storage.log", failok=>1; - upload_logs "/tmp/syslog", failok=>1; - upload_logs "/tmp/program.log", failok=>1; - upload_logs "/tmp/dnf.log", failok=>1; - upload_logs "/tmp/dnf.librepo.log", failok=>1; - upload_logs "/tmp/dnf.rpm.log", failok=>1; - upload_logs "/tmp/dbus.log", failok=>1; + upload_logs "/tmp/X.log", failok => 1; + upload_logs "/tmp/anaconda.log", failok => 1; + upload_logs "/tmp/packaging.log", failok => 1; + upload_logs "/tmp/storage.log", failok => 1; + upload_logs "/tmp/syslog", failok => 1; + upload_logs "/tmp/program.log", failok => 1; + upload_logs "/tmp/dnf.log", failok => 1; + upload_logs "/tmp/dnf.librepo.log", failok => 1; + upload_logs "/tmp/dnf.rpm.log", failok => 1; + upload_logs "/tmp/dbus.log", failok => 1; if ($has_traceback) { # Upload Anaconda traceback logs @@ -128,7 +129,8 @@ sub root_console { # 0 means use console_login's default, non-zero values # passed to console_login timeout => 0, - @_); + @_ + ); if (get_var("SERIAL_CONSOLE")) { # select first virtio terminal, we rely on anaconda having run # a root shell on it for us @@ -141,7 +143,7 @@ sub root_console { # tty3 has a shell on all f31+ installer and live images send_key "ctrl-alt-f3"; } - console_login(user=>"root", timeout=>$args{timeout}); + console_login(user => "root", timeout => $args{timeout}); } 1; diff --git a/lib/bugzilla.pm b/lib/bugzilla.pm index 245ce64b..998ce308 100644 --- a/lib/bugzilla.pm +++ b/lib/bugzilla.pm @@ -32,7 +32,7 @@ sub convert_to_bz_timestamp { sub get_newest_bug { # This subroutine makes an API call to Bugzilla and - # fetches the newest bug that have been created. + # fetches the newest bug that have been created. # This will be the bug created by Anaconda in this # test run. my ($timestamp, $login) = @_; diff --git a/lib/cockpit.pm b/lib/cockpit.pm index bb9a7496..50e7ce5c 100644 --- a/lib/cockpit.pm +++ b/lib/cockpit.pm @@ -22,7 +22,7 @@ sub start_cockpit { # run firefox directly in X as root. never do this, kids! type_string "startx /usr/bin/firefox -width 1024 -height 768 http://localhost:9090\n"; assert_screen "cockpit_login", 60; - wait_still_screen(stilltime=>5, similarity_level=>45); + wait_still_screen(stilltime => 5, similarity_level => 45); if ($login) { type_safely "root"; wait_screen_change { send_key "tab"; }; @@ -56,6 +56,6 @@ sub check_updates { my $logfile = shift; sleep 2; my $checkresult = script_run "dnf check-update > $logfile"; - upload_logs "$logfile", failok=>1; - return($checkresult); + upload_logs "$logfile", failok => 1; + return ($checkresult); } diff --git a/lib/fedoradistribution.pm b/lib/fedoradistribution.pm index c325fc06..a634e87b 100644 --- a/lib/fedoradistribution.pm +++ b/lib/fedoradistribution.pm @@ -59,13 +59,13 @@ sub x11_start_program { send_key "alt-f2"; assert_screen "desktop_runner"; type_string $program, 20; - sleep 5; # because of KDE dialog - SUSE guys are doing the same! + sleep 5; # because of KDE dialog - SUSE guys are doing the same! send_key "ret", 1; } # ensure_installed checks if a package is already installed and if not install it. -# To make it happen, it will switch to a virtual terminal (if not already there) -# and try to install the package. DNF will skip the installation, +# To make it happen, it will switch to a virtual terminal (if not already there) +# and try to install the package. DNF will skip the installation, # if it is already installed. sub ensure_installed { my ($self, @packages) = @_; @@ -75,48 +75,48 @@ sub ensure_installed { # We will check if GUI elements are present, that would suggest that we are not in the # console but in GUI. if (check_screen("apps_menu_button")) { - # In that case, we want to return to GUI after the routine finishes. + # In that case, we want to return to GUI after the routine finishes. $stay_on_console = 0; - # From GUI we need to switch to the console. - send_key("ctrl-alt-f3"); - # Let's wait to allow for screen changes. - sleep 5; - # And do the login. - console_login(); + # From GUI we need to switch to the console. + send_key("ctrl-alt-f3"); + # Let's wait to allow for screen changes. + sleep 5; + # And do the login. + console_login(); } # Try to install the packages via dnf. If it is already installed, DNF will not do anything # so there is no need to do any complicated magic. assert_script_run("dnf install -y @packages", timeout => 240); # If we need to leave the console. if ($stay_on_console == 0) { - desktop_vt(); + desktop_vt(); } } -# This subroutine switches to the root account. +# This subroutine switches to the root account. # On Fedora, the system can be installed with a valid root account (root password assigned) # or without it (with root password empty). If no root password is provided through environment -# variables, we assume that the system is a "rootless" system. In that case we will use -# `sudo -i` to acquire the administrator access. +# variables, we assume that the system is a "rootless" system. In that case we will use +# `sudo -i` to acquire the administrator access. sub become_root { - # If ROOT_PASSWORD exists, it means that the root account exists, too. + # If ROOT_PASSWORD exists, it means that the root account exists, too. # To become root, we will use the real root account and we'll switch to it. if (check_var("ROOT_PASSWORD")) { - my $password = get_var("ROOT_PASSWORD"); - enter_cmd("su -", max_interval => 15, wait_screen_changes => 3); - type_password($password, max_interval => 15); - send_key("ret"); + my $password = get_var("ROOT_PASSWORD"); + enter_cmd("su -", max_interval => 15, wait_screen_changes => 3); + type_password($password, max_interval => 15); + send_key("ret"); } # If no root password is set, it means, that we are only using an administrator # who is in the wheel group and therefore we will use the sudo command to obtain # the admin rights. else { my $password = get_var("USER_PASSWORD") || "weakpassword"; - enter_cmd("sudo -i", max_interval => 15, wait_screen_changes => 3); - # The SUDO warning might be displayed so let's wait it out a bit. - sleep 2; - type_password($password, max_interval => 15); - send_key("ret"); + enter_cmd("sudo -i", max_interval => 15, wait_screen_changes => 3); + # The SUDO warning might be displayed so let's wait it out a bit. + sleep 2; + type_password($password, max_interval => 15); + send_key("ret"); } sleep 2; # Now we should be root. Let's check for root prompt. @@ -132,7 +132,7 @@ sub become_root { # passed to it after the command has finished to save some time. # The serial console is only accessible for the root user, so that # mechanism does not work when not root (why would anyone use sudo -# if they were root already anyway). +# if they were root already anyway). # To override this, call `make_serial_writable` from `utils.pm` in the # beginning of the test script to enable serial console for normal users. sub script_sudo { @@ -144,9 +144,9 @@ sub script_sudo { my $str; if ($wait > 0) { - # Create a uniqe hash from the command and the wait time. - $str = testapi::hashed_string("SS$prog$wait"); - # Chain the commands to pass the message to the serial console. + # Create a uniqe hash from the command and the wait time. + $str = testapi::hashed_string("SS$prog$wait"); + # Chain the commands to pass the message to the serial console. $prog = "$prog; echo $str > /dev/$testapi::serialdev"; } # Run the command with `sudo -k` @@ -156,7 +156,7 @@ sub script_sudo { type_password($password); send_key "ret"; # Wait for the message hash to appear on the serial console which indicates - # that the command has finished. No matter what time has passed, finish + # that the command has finished. No matter what time has passed, finish # or die if no message appears on time. if ($str) { return testapi::wait_serial($str, $wait); @@ -171,7 +171,7 @@ sub assert_script_sudo { my ($self, $prog, $wait) = @_; script_sudo($prog, $wait); # Validate that the command exited with a correct exit code. - validate_script_output('echo $?', sub { $_ == 0 } ); + validate_script_output('echo $?', sub { $_ == 0 }); return; } diff --git a/lib/freeipa.pm b/lib/freeipa.pm index 9dc5b97c..ed64b032 100644 --- a/lib/freeipa.pm +++ b/lib/freeipa.pm @@ -44,7 +44,7 @@ sub start_webui { disable_firefox_studies; type_string "startx /usr/bin/firefox -width 1024 -height 768 https://ipa001.test.openqa.fedoraproject.org\n"; assert_screen ["freeipa_webui_login", $user_screen], 60; - wait_still_screen(stilltime=>5, similarity_level=>45); + wait_still_screen(stilltime => 5, similarity_level => 45); # softfail on kerberos ticket bugs meaning we get auto-logged in # as the requested user when we don't expect to be if (match_has_tag $user_screen) { diff --git a/lib/installedtest.pm b/lib/installedtest.pm index a47ef3db..703f2301 100644 --- a/lib/installedtest.pm +++ b/lib/installedtest.pm @@ -16,9 +16,10 @@ sub root_console { # Switch to a default or specified TTY and log in as root. my $self = shift; my %args = ( - tty => 1, # what TTY to login to - timeout => 0, # passed through to console_login - @_); + tty => 1, # what TTY to login to + timeout => 0, # passed through to console_login + @_ + ); if (get_var("SERIAL_CONSOLE")) { # select the first virtio terminal, for now we assume we can # always use that (we may have to make this smarter in future) @@ -28,7 +29,7 @@ sub root_console { # For normal terminal emulation, use key combo to reach a tty send_key "ctrl-alt-f$args{tty}"; } - console_login(timeout=>$args{timeout}); # Do the login. + console_login(timeout => $args{timeout}); # Do the login. } sub post_fail_hook { @@ -44,7 +45,7 @@ sub post_fail_hook { assert_script_run "dhclient"; } else { - $self->root_console(tty=>6); + $self->root_console(tty => 6); # fix up keyboard layout, if we failed before the test did this # itself; if it's already been done, should be safe, will just # fail and carry on @@ -89,7 +90,7 @@ sub post_fail_hook { } if ($dracut) { - upload_logs "/run/initramfs/rdsosreport.txt", failok=>1; + upload_logs "/run/initramfs/rdsosreport.txt", failok => 1; # that's all that's really useful, so... return; } @@ -126,14 +127,14 @@ sub post_fail_hook { } # Sometimes useful for diagnosing FreeIPA issues - upload_logs "/etc/nsswitch.conf", failok=>1; + upload_logs "/etc/nsswitch.conf", failok => 1; if (get_var("FLAVOR") eq "updates-everything-boot-iso") { # for installer creation test script_run "df -h"; - upload_logs "/root/imgbuild/pylorax.log", failok=>1; - upload_logs "/root/imgbuild/lorax.log", failok=>1; - upload_logs "/root/imgbuild/program.log", failok=>1; + upload_logs "/root/imgbuild/pylorax.log", failok => 1; + upload_logs "/root/imgbuild/lorax.log", failok => 1; + upload_logs "/root/imgbuild/program.log", failok => 1; } if (get_var("TEST") eq "live_build") { @@ -150,10 +151,10 @@ sub post_fail_hook { } } - # For update tests, let's do the update package info log stuff, - # it may be useful for diagnosing the cause of the failure - advisory_get_installed_packages; - advisory_check_nonmatching_packages(fatal=>0); +# For update tests, let's do the update package info log stuff, +# it may be useful for diagnosing the cause of the failure +advisory_get_installed_packages; +advisory_check_nonmatching_packages(fatal => 0); 1; diff --git a/lib/modularity.pm b/lib/modularity.pm index ac3585d3..170f0939 100644 --- a/lib/modularity.pm +++ b/lib/modularity.pm @@ -11,7 +11,7 @@ use utils; our @EXPORT = qw(parse_module_list is_listed); # This subroutine takes the output from the dnf module list command -# and deletes all unnecessary stuff and returns an array of hash +# and deletes all unnecessary stuff and returns an array of hash # references where each hash consists of (module, stream, profile). # The subroutine only recognizes one profile but it is enough # for the sake of the modularity testing. @@ -37,7 +37,7 @@ sub parse_module_list { sub is_listed { my ($module, $stream, $listref) = @_; my $found = 0; - foreach (@{ $listref }) { + foreach (@{$listref}) { if ($_->{module} eq $module and $_->{stream} eq $stream) { $found = 1; } diff --git a/lib/utils.pm b/lib/utils.pm index aa19303c..5c1a0cab 100644 --- a/lib/utils.pm +++ b/lib/utils.pm @@ -21,9 +21,9 @@ sub run_with_error_check { # by using 'unless' and 'expect_not_found=>1' here we avoid # the web UI showing each failure to see the error message as # a 'failed match' - die "Error screen appeared" unless (wait_serial($error_screen, timeout=>5, expect_not_found=>1)); + die "Error screen appeared" unless (wait_serial($error_screen, timeout => 5, expect_not_found => 1)); $func->(); - die "Error screen appeared" unless (wait_serial($error_screen, timeout=>5, expect_not_found=>1)); + die "Error screen appeared" unless (wait_serial($error_screen, timeout => 5, expect_not_found => 1)); } else { die "Error screen appeared" if (check_screen $error_screen, 5); @@ -39,7 +39,7 @@ sub type_safely { type_string($string, wait_screen_change => 3, max_interval => 20); # similarity level 38 as there will commonly be a flashing # cursor and the default level (47) is too tight - wait_still_screen(stilltime=>2, similarity_level=>38); + wait_still_screen(stilltime => 2, similarity_level => 38); } # high-level 'type this string extremely safely and rather slow' @@ -49,7 +49,7 @@ sub type_very_safely { type_string($string, wait_screen_change => 1, max_interval => 1); # similarity level 38 as there will commonly be a flashing # cursor and the default level (47) is too tight - wait_still_screen(stilltime=>5, similarity_level=>38); + wait_still_screen(stilltime => 5, similarity_level => 38); } sub get_release_number { @@ -59,7 +59,7 @@ sub get_release_number { my $version = get_var("VERSION"); my $rawrel = get_var("RAWREL", "Rawhide"); return $rawrel if ($version eq "Rawhide"); - return $version + return $version; } # Wait for login screen to appear. Handle the annoying GPU buffer @@ -71,7 +71,7 @@ sub boot_to_login_screen { $args{timeout} //= 300; if (testapi::is_serial_terminal) { # For serial console, just wait for the login prompt - unless (wait_serial "login:", timeout=>$args{timeout}) { + unless (wait_serial "login:", timeout => $args{timeout}) { die "No login prompt shown on serial console."; } } @@ -82,14 +82,14 @@ sub boot_to_login_screen { # The following is true for non-serial console. my $count = 5; while (check_screen("login_screen", 3) && $count > 0) { - sleep 5; - $count -= 1; + sleep 5; + $count -= 1; + } + assert_screen "login_screen", $args{timeout}; + if (match_has_tag "graphical_login") { + wait_still_screen 10, 30; + assert_screen "login_screen"; } - assert_screen "login_screen", $args{timeout}; - if (match_has_tag "graphical_login") { - wait_still_screen 10, 30; - assert_screen "login_screen"; - } } } @@ -116,7 +116,7 @@ sub desktop_switch_layout { # if already selected, we're good return if (check_screen "${environment}_layout_${layout}", 3); # otherwise we need to switch - my $switcher = "alt-shift"; # anaconda + my $switcher = "alt-shift"; # anaconda $switcher = "super-spc" if $environment eq 'gnome'; # KDE? not used yet send_key $switcher; @@ -130,7 +130,7 @@ sub desktop_switch_layout { sub _console_login_finish { # The check differs according to the console used. if (testapi::is_serial_terminal) { - unless (wait_serial("-bash-.*[#\$]", timeout=>5, expect_not_found=>1)) { + unless (wait_serial("-bash-.*[#\$]", timeout => 5, expect_not_found => 1)) { record_soft_failure "It looks like profile sourcing failed"; } } @@ -150,7 +150,8 @@ sub console_login { password => get_var("ROOT_PASSWORD", "weakpassword"), # default is 10 seconds, set below, 0 means 'default' timeout => 0, - @_); + @_ + ); $args{timeout} ||= 10; # Since we do not test many serial console tests, and we probably @@ -161,7 +162,7 @@ sub console_login { # enable a new proper login based on the user variable. if (get_var("SERIAL_CONSOLE")) { # Check for the usual prompt. - if (wait_serial("~\][#\$]", timeout=>5, quiet=>1)) { + if (wait_serial("~\][#\$]", timeout => 5, quiet => 1)) { type_string "logout\n"; # Wait a bit to let the logout properly finish. sleep 10; @@ -175,7 +176,7 @@ sub console_login { # Let's perform a simple login test. This is the same as # whoami, but has the advantage of existing in installer env assert_script_run "id -un"; - unless (wait_serial $args{user}, timeout=>5) { + unless (wait_serial $args{user}, timeout => 5) { die "Logging onto the serial console has failed."; } } @@ -268,9 +269,9 @@ sub desktop_vt { # stop as soon as any command fails, so we use ||: to make the # first grep return 0 even if it matches nothing eval { $xout = script_output ' loginctl | grep test ||:; ps -e | egrep "(startplasma|gnome-session|Xwayland|Xorg)" | grep -o tty[0-9] ||:' }; - my $tty = 1; # default + my $tty = 1; # default while ($xout =~ /tty(\d)/g) { - $tty = $1; # most recent match is probably best + $tty = $1; # most recent match is probably best } send_key "ctrl-alt-f${tty}"; # work around https://gitlab.gnome.org/GNOME/gnome-software/issues/582 @@ -382,7 +383,8 @@ sub do_bootloader { # in SLOF usb-xhci driver failed sometimes in powerpc type_safely " $args{params}"; } - save_screenshot; # for debug purpose + # for debug purpose + save_screenshot; # ctrl-X boots from grub editor mode send_key "ctrl-x"; # return boots all other cases @@ -435,9 +437,9 @@ sub disable_firefox_studies { assert_script_run 'printf "// required comment\npref(\'general.config.filename\', \'openqa-overrides.cfg\');\npref(\'general.config.obscure_value\', 0);\n" > ' . $prefix . '$(rpm --eval %_libdir)/firefox/browser/defaults/preferences/openqa-overrides.js'; assert_script_run 'printf "// required comment\npref(\'browser.urlbar.quicksuggest.shouldShowOnboardingDialog\', false);\npref(\'privacy.restrict3rdpartystorage.rollout.enabledByDefault\', false);\n" > ' . $prefix . '$(rpm --eval %_libdir)/firefox/openqa-overrides.cfg'; # for debugging - upload_logs "$prefix/usr/lib64/firefox/browser/defaults/preferences/openqa-overrides.js", failok=>1; - upload_logs "$prefix/usr/lib64/firefox/openqa-overrides.cfg", failok=>1; - upload_logs "$prefix/usr/lib64/firefox/distribution/policies.json", failok=>1; + upload_logs "$prefix/usr/lib64/firefox/browser/defaults/preferences/openqa-overrides.js", failok => 1; + upload_logs "$prefix/usr/lib64/firefox/openqa-overrides.cfg", failok => 1; + upload_logs "$prefix/usr/lib64/firefox/distribution/policies.json", failok => 1; } sub repos_mirrorlist { @@ -522,7 +524,7 @@ sub _repo_setup_compose { assert_script_run 'dnf config-manager --set-disabled updates-testing updates'; # script_run returns the exit code, so 'unless' here means 'if the file exists' unless (script_run 'test -f /etc/yum.repos.d/fedora-updates-modular.repo') { - assert_script_run 'dnf config-manager --set-disabled updates-testing-modular updates-modular'; + assert_script_run 'dnf config-manager --set-disabled updates-testing-modular updates-modular'; } # we use script_run here as the rawhide and modular repo files # won't always exist and we don't want to bother testing or @@ -532,9 +534,9 @@ sub _repo_setup_compose { script_run "sed -i -e 's,^metalink,#metalink,g' -e 's,^mirrorlist,#mirrorlist,g' -e 's,^#baseurl.*basearch,baseurl=${location}/Modular/\$basearch,g' -e 's,^#baseurl.*source,baseurl=${location}/Modular/source,g' /etc/yum.repos.d/{fedora-modular,fedora-rawhide-modular}.repo", 0; # this can be used for debugging if something is going wrong -# unless (script_run 'pushd /etc/yum.repos.d && tar czvf yumreposd.tar.gz * && popd') { -# upload_logs "/etc/yum.repos.d/yumreposd.tar.gz"; -# } + # unless (script_run 'pushd /etc/yum.repos.d && tar czvf yumreposd.tar.gz * && popd') { + # upload_logs "/etc/yum.repos.d/yumreposd.tar.gz"; + # } } sub _repo_setup_updates { @@ -545,9 +547,9 @@ sub _repo_setup_updates { my $currrel = get_var("CURRREL", "0"); repos_mirrorlist(); # this can be used for debugging repo config if something is wrong -# unless (script_run 'pushd /etc/yum.repos.d && tar czvf yumreposd.tar.gz * && popd') { -# upload_logs "/etc/yum.repos.d/yumreposd.tar.gz"; -# } + # unless (script_run 'pushd /etc/yum.repos.d && tar czvf yumreposd.tar.gz * && popd') { + # upload_logs "/etc/yum.repos.d/yumreposd.tar.gz"; + # } if ($version > $currrel) { # Disable updates-testing so other bad updates don't break us # this will do nothing on upgrade tests as we're on a stable @@ -650,11 +652,11 @@ sub console_initial_setup { # Set timezone type_string "2\n"; wait_still_screen 5; - type_string "1\n"; # Set timezone + type_string "1\n"; # Set timezone wait_still_screen 5; - type_string "1\n"; # Europe + type_string "1\n"; # Europe wait_still_screen 5; - type_string "37\n"; # Prague + type_string "37\n"; # Prague wait_still_screen 7; # Set root password @@ -670,14 +672,14 @@ sub console_initial_setup { # Create user type_string "5\n"; wait_still_screen 5; - type_string "1\n"; # create new + type_string "1\n"; # create new wait_still_screen 5; - type_string "3\n"; # set username + type_string "3\n"; # set username wait_still_screen 5; type_string get_var("USER_LOGIN", "test"); send_key "ret"; wait_still_screen 5; - type_string "5\n"; # set password + type_string "5\n"; # set password wait_still_screen 5; type_string get_var("USER_PASSWORD", "weakpassword"); send_key "ret"; @@ -685,13 +687,13 @@ sub console_initial_setup { type_string get_var("USER_PASSWORD", "weakpassword"); send_key "ret"; wait_still_screen 5; - type_string "6\n"; # make him an administrator + type_string "6\n"; # make him an administrator wait_still_screen 5; type_string "c\n"; wait_still_screen 7; assert_screen "console_initial_setup_done", 30; - type_string "c\n"; # continue + type_string "c\n"; # continue } sub handle_welcome_screen { @@ -734,17 +736,17 @@ sub gnome_initial_setup { # https://fedoraproject.org//wiki/Changes/ReduceInitialSetupRedundancy # https://bugzilla.redhat.com/show_bug.cgi?id=1474787 , # except 'language' is never *really* skipped (see above) - @nexts = grep {$_ ne 'keyboard'} @nexts; - @nexts = grep {$_ ne 'timezone'} @nexts; + @nexts = grep { $_ ne 'keyboard' } @nexts; + @nexts = grep { $_ ne 'timezone' } @nexts; # 'additional software sources' screen did not display on F28-F34: # https://gitlab.gnome.org/GNOME/gnome-initial-setup/-/issues/59 - @nexts = grep {$_ ne 'software'} @nexts if ($relnum < 35); + @nexts = grep { $_ ne 'software' } @nexts if ($relnum < 35); } else { # 'timezone' and 'software' are suppressed for the 'existing user' # form of g-i-s - @nexts = grep {$_ ne 'software'} @nexts; - @nexts = grep {$_ ne 'timezone'} @nexts; + @nexts = grep { $_ ne 'software' } @nexts; + @nexts = grep { $_ ne 'timezone' } @nexts; } # note: in g-i-s 3.37.91 and later, the first screen in systemwide @@ -763,13 +765,13 @@ sub gnome_initial_setup { # wait a bit in case of animation wait_still_screen 3; # one more check for frickin auth_required - if (check_screen "auth_required") { + if (check_screen "auth_required") { record_soft_failure "Unexpected authentication required: https://gitlab.gnome.org/GNOME/gnome-initial-setup/-/issues/106"; send_key "esc"; } # GDM 3.24.1 dumps a cursor in the middle of the screen here... mouse_hide if ($args{prelogin}); - for my $n (1..scalar(@nexts)) { + for my $n (1 .. scalar(@nexts)) { # click 'Next' $nexts times, moving the mouse to avoid # highlight problems, sleeping to give it time to get # to the next screen between clicks @@ -799,7 +801,7 @@ sub gnome_initial_setup { # it's not visible we may have hit # https://bugzilla.redhat.com/show_bug.cgi?id=1997310 , which # we'll handle as a soft failure - mouse_set(100,100); + mouse_set(100, 100); if (check_screen "skip_button", 60) { wait_screen_change { click_lastmatch; }; } @@ -853,7 +855,7 @@ sub anaconda_create_user { @_ ); my $user_login = get_var("USER_LOGIN") || "test"; - assert_and_click("anaconda_install_user_creation", timeout=>$args{timeout}); + assert_and_click("anaconda_install_user_creation", timeout => $args{timeout}); assert_screen "anaconda_install_user_creation_screen"; # wait out animation wait_still_screen 2; @@ -934,21 +936,21 @@ sub check_desktop { } sub download_modularity_tests { -# Download the modularity test script, place in the system and then -# modify the access rights to make it executable. + # Download the modularity test script, place in the system and then + # modify the access rights to make it executable. my ($whitelist) = @_; # we need python3-yaml for the script to run assert_script_run 'dnf -y install python3-yaml', 180; assert_script_run 'curl -o /root/test.py https://pagure.io/fedora-qa/modularity_testing_scripts/raw/master/f/modular_functions.py'; if ($whitelist eq 'whitelist') { - assert_script_run 'curl -o /root/whitelist https://pagure.io/fedora-qa/modularity_testing_scripts/raw/master/f/whitelist'; + assert_script_run 'curl -o /root/whitelist https://pagure.io/fedora-qa/modularity_testing_scripts/raw/master/f/whitelist'; } assert_script_run 'chmod 755 /root/test.py'; } sub quit_firefox { -# Quit Firefox, handling the 'close multiple tabs' warning screen if -# it shows up. Expects to quit to a recognizable console + # Quit Firefox, handling the 'close multiple tabs' warning screen if + # it shows up. Expects to quit to a recognizable console send_key "ctrl-q"; # expect to get to either the tabs warning or a console if (check_screen ["user_console", "root_console", "firefox_close_tabs"], 30) { @@ -972,18 +974,18 @@ sub quit_firefox { record_soft_failure "No console on exit from Firefox, probably RHBZ #2094137"; power "reset"; boot_to_login_screen; - console_login(user=>"root", password=>get_var("ROOT_PASSWORD")); + console_login(user => "root", password => get_var("ROOT_PASSWORD")); } sub start_with_launcher { -# Get the name of the needle with a launcher, find the launcher in the menu -# and click on it to start the application. This function works for the -# Gnome desktop. + # Get the name of the needle with a launcher, find the launcher in the menu + # and click on it to start the application. This function works for the + # Gnome desktop. # $launcher holds the launcher needle, but some of the apps are hidden in a submenu # so this must be handled first to find the launcher needle. - my ($launcher,$submenu,$group) = @_; + my ($launcher, $submenu, $group) = @_; $submenu //= ''; $group //= ''; my $desktop = get_var('DESKTOP'); @@ -1020,7 +1022,7 @@ sub start_with_launcher { assert_and_click $launcher; wait_still_screen 5; } - elsif ($desktop eq 'kde'){ + elsif ($desktop eq 'kde') { # Click on the KDE launcher icon assert_and_click 'kde_menu_launcher'; wait_still_screen 2; @@ -1047,7 +1049,7 @@ sub start_with_launcher { sub quit_with_shortcut { -# Quit the application using the Alt-F4 keyboard shortcut + # Quit the application using the Alt-F4 keyboard shortcut send_key 'alt-f4'; wait_still_screen 5; assert_screen 'workspace'; @@ -1067,12 +1069,12 @@ sub advisory_get_installed_packages { # occasionally, for some reason, it's unhappy about sorting; # we shouldn't fail the test in this case, just upload the # files so we can see why... - upload_logs "/tmp/allpkgs.txt", failok=>1; - upload_logs "/var/log/updatepkgs.txt", failok=>1; + upload_logs "/tmp/allpkgs.txt", failok => 1; + upload_logs "/var/log/updatepkgs.txt", failok => 1; } # we'll try and upload the output even if comm 'failed', as it # does in fact still write it in some cases - upload_logs "/var/log/testedpkgs.txt", failok=>1; + upload_logs "/var/log/testedpkgs.txt", failok => 1; } sub advisory_check_nonmatching_packages { @@ -1106,8 +1108,8 @@ sub advisory_check_nonmatching_packages { script_run 'for pkg in $(cat /var/log/updatepkgnames.txt); do rpm -q $pkg && rpm -q $pkg --last | head -1 | cut -d" " -f1 | sed -e \'s,\^,\\\\\\\\^,g\' | xargs rpm -q --qf "%{SOURCERPM} %{EPOCH} %{NAME}-%{VERSION}-%{RELEASE}\n" >> /tmp/installedupdatepkgs.txt; done'; script_run 'sort -u -o /tmp/installedupdatepkgs.txt /tmp/installedupdatepkgs.txt'; # for debugging, may as well always upload these, can't hurt anything - upload_logs "/tmp/installedupdatepkgs.txt", failok=>1; - upload_logs "/var/log/updatepkgs.txt", failok=>1; + upload_logs "/tmp/installedupdatepkgs.txt", failok => 1; + upload_logs "/var/log/updatepkgs.txt", failok => 1; # if any line appears in installedupdatepkgs.txt but not updatepkgs.txt, # we have a problem. if (script_run 'comm -23 /tmp/installedupdatepkgs.txt /var/log/updatepkgs.txt > /var/log/installednotupdatedpkgs.txt') { @@ -1119,7 +1121,7 @@ sub advisory_check_nonmatching_packages { # this exits 1 if the file is zero-length, 0 if it's longer # if it's 0, that's *BAD*: we want to upload the file and fail unless (script_run 'test -s /var/log/installednotupdatedpkgs.txt') { - upload_logs "/var/log/installednotupdatedpkgs.txt", failok=>1; + upload_logs "/var/log/installednotupdatedpkgs.txt", failok => 1; my $message = "Package(s) from update not installed when it should have been! See installednotupdatedpkgs.txt"; if ($args{fatal}) { set_var("_ACNMP_DONE", "1"); @@ -1172,7 +1174,7 @@ sub select_rescue_mode { } } - assert_screen "rescue_select", 180; # it takes time to start anaconda + assert_screen "rescue_select", 180; # it takes time to start anaconda } sub copy_devcdrom_as_isofile { @@ -1334,10 +1336,10 @@ sub check_prerelease { assert_screen "prerelease_note"; } elsif ($prerelease == 0) { - # If the prerelease note is shown, where it should not be, die! - if (check_screen "prerelease_note") { + # If the prerelease note is shown, where it should not be, die! + if (check_screen "prerelease_note") { die "The PRERELEASE tag is shown, but it should NOT be."; - } + } } } @@ -1419,12 +1421,12 @@ sub click_unwanted_notifications { my @closed; while ($count > 0 && check_screen "desktop_update_notification_popup", 5) { $count -= 1; - push (@closed, 'update'); + push(@closed, 'update'); click_lastmatch; } if (check_screen "akonadi_migration_agent_running", 5) { click_lastmatch; - push (@closed, 'akonadi'); + push(@closed, 'akonadi'); } return @closed; } @@ -1438,8 +1440,8 @@ sub register_application { } # The KDE desktop tests are very difficult to maintain, because the transparency -# of the menu requires a lot of different needles to cover the elements. -# Therefore it is useful to change the background to a solid colour. +# of the menu requires a lot of different needles to cover the elements. +# Therefore it is useful to change the background to a solid colour. # Since many needles have been already created with a black background # we will keep it that way. The following code has been taken from the # KDE startstop tests but it is good to have it here, because it will be @@ -1447,7 +1449,7 @@ sub register_application { sub solidify_wallpaper { my $desktop = get_var("DESKTOP"); if ($desktop eq "kde") { - # Run the Desktop settings + # Run the Desktop settings # FIXME workaround a weird bug where alt-d-s does something # different until you right click on the desktop: # https://bugzilla.redhat.com/show_bug.cgi?id=1933118 @@ -1485,14 +1487,14 @@ sub solidify_wallpaper { # Start the terminal to set up backgrounds. menu_launch_type "gnome-terminal"; # wait to be sure it's fully open - wait_still_screen(stilltime=>5, similarity_level=>38); + wait_still_screen(stilltime => 5, similarity_level => 38); # When the application opens, run command in it to set the background to black type_very_safely "gsettings set org.gnome.desktop.background picture-uri ''"; send_key 'ret'; - wait_still_screen(stilltime=>2, similarity_level=>38); + wait_still_screen(stilltime => 2, similarity_level => 38); type_very_safely "gsettings set org.gnome.desktop.background primary-color '#000000'"; send_key 'ret'; - wait_still_screen(stilltime=>2, similarity_level=>38); + wait_still_screen(stilltime => 2, similarity_level => 38); quit_with_shortcut(); # check that is has changed color assert_screen 'apps_settings_screen_black'; @@ -1505,7 +1507,7 @@ sub check_and_install_git { unless (get_var("CANNED")) { if (script_run("rpm -q git")) { assert_script_run("dnf install -y git"); - } + } } } @@ -1540,13 +1542,13 @@ sub download_testdata { # On Fedora, the serial console is not writable for regular users which lames # some of the openQA commands that send messages to the serial console to check # that a command has finished, for example assert_script_run, etc. -# This routine changes the rights on the serial console file and makes it -# writable for everyone, so that those commands work. This is actually very useful +# This routine changes the rights on the serial console file and makes it +# writable for everyone, so that those commands work. This is actually very useful # for testing commands from users' perspective. The routine also handles becoming the root. # We agree that this is not the "correct" way, to enable users to type onto serial console # and that it correctly should be done via groups (dialout) but that would require rebooting # the virtual machine. Therefore we do it this way, which has immediate effect. -sub make_serial_writable{ +sub make_serial_writable { become_root(); sleep 2; # Make serial console writable for everyone. @@ -1555,6 +1557,6 @@ sub make_serial_writable{ # Exit the root account enter_cmd("exit"); sleep 2; -} +} 1; diff --git a/main.pm b/main.pm index ece5eb52..f575cec6 100644 --- a/main.pm +++ b/main.pm @@ -33,7 +33,7 @@ testapi::set_distribution(fedoradistribution->new()); # Stolen from openSUSE. sub unregister_needle_tags($) { my $tag = shift; - my @a = @{ needle::tags($tag) }; + my @a = @{needle::tags($tag)}; for my $n (@a) { $n->unregister(); } } @@ -49,14 +49,14 @@ sub unregister_needle_tags($) { # 'LANGUAGE-' at all. sub unregister_prefix_tags { my ($prefix, $valueref) = @_; - NEEDLE: for my $needle ( needle::all() ) { + NEEDLE: for my $needle (needle::all()) { my $unregister = 0; - for my $tag ( @{$needle->{'tags'}} ) { + for my $tag (@{$needle->{'tags'}}) { if ($tag =~ /^\Q$prefix/) { # We have at least one tag matching the prefix, so we # *MAY* want to un-register the needle $unregister = 1; - for my $value ( @{$valueref} ) { + for my $value (@{$valueref}) { # At any point if we hit a prefix-value match, we # know we need to keep this needle and can skip # to the next @@ -85,13 +85,13 @@ sub cleanup_needles() { # Unregister desktop needles of other desktops when DESKTOP is specified if (get_var('DESKTOP')) { - unregister_prefix_tags('DESKTOP', [ get_var('DESKTOP') ]) + unregister_prefix_tags('DESKTOP', [get_var('DESKTOP')]); } # Unregister non-language-appropriate needles. See unregister_except_ # tags for details; basically all needles with at least one LANGUAGE- # tag will be unregistered unless they match the current langauge. - my $langref = [ get_var('LANGUAGE') || 'english' ]; + my $langref = [get_var('LANGUAGE') || 'english']; unregister_prefix_tags('LANGUAGE', $langref); } $needle::cleanuphandler = \&cleanup_needles; @@ -192,15 +192,15 @@ sub load_install_tests() { my $partitioning = get_var('PARTITIONING'); # if PARTITIONING is unset, or one of [...], use disk_guided_empty, # which is the simplest / 'default' case. - if (! $partitioning || $partitioning ~~ ['guided_empty', 'guided_free_space']) { + if (!$partitioning || $partitioning ~~ ['guided_empty', 'guided_free_space']) { $storage = "tests/disk_guided_empty.pm"; } else { - $storage = "tests/disk_".$partitioning.".pm"; + $storage = "tests/disk_" . $partitioning . ".pm"; } autotest::loadtest $storage; - if (get_var("ENCRYPT_PASSWORD")){ + if (get_var("ENCRYPT_PASSWORD")) { autotest::loadtest "tests/disk_guided_encrypted.pm"; } diff --git a/t/00-tidy.t b/t/00-tidy.t new file mode 100755 index 00000000..c98463f5 --- /dev/null +++ b/t/00-tidy.t @@ -0,0 +1,7 @@ +#!/usr/bin/perl +# Copyright 2021 SUSE LLC +# SPDX-License-Identifier: GPL-2.0-or-later + +use Test::Strict; +use Test::Code::TidyAll; +tidyall_ok(); diff --git a/tests/_addrepo_metalink_post.pm b/tests/_addrepo_metalink_post.pm index 9f7f01fa..2007ac04 100644 --- a/tests/_addrepo_metalink_post.pm +++ b/tests/_addrepo_metalink_post.pm @@ -8,7 +8,7 @@ sub run { } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/_advisory_post.pm b/tests/_advisory_post.pm index 62d796fb..76023ed0 100644 --- a/tests/_advisory_post.pm +++ b/tests/_advisory_post.pm @@ -5,7 +5,7 @@ use utils; sub run { my $self = shift; - $self->root_console(tty=>3); + $self->root_console(tty => 3); # figure out which packages from the update actually got installed # (if any) as part of this test advisory_get_installed_packages; @@ -15,7 +15,7 @@ sub run { } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/_advisory_update.pm b/tests/_advisory_update.pm index c7722457..8aa983f7 100644 --- a/tests/_advisory_update.pm +++ b/tests/_advisory_update.pm @@ -7,7 +7,7 @@ sub run { my $self = shift; # do the 'repo setup' steps, which set up a repo containing the # update packages and run 'dnf update' - $self->root_console(tty=>3); + $self->root_console(tty => 3); repo_setup; if (get_var("ADVISORY_BOOT_TEST")) { # to test boot stuff - in case the update touched grub2, or dracut, @@ -25,7 +25,7 @@ sub run { } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/_anaconda_network_static.pm b/tests/_anaconda_network_static.pm index d628224b..5f25a0d2 100644 --- a/tests/_anaconda_network_static.pm +++ b/tests/_anaconda_network_static.pm @@ -29,7 +29,7 @@ sub run { } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/_boot_to_anaconda.pm b/tests/_boot_to_anaconda.pm index f52e3fb3..796503eb 100644 --- a/tests/_boot_to_anaconda.pm +++ b/tests/_boot_to_anaconda.pm @@ -77,7 +77,7 @@ sub run { # call do_bootloader with postinstall=0, the params, and the mutex, # unless we're a VNC install client (no bootloader there) unless (get_var("VNC_CLIENT")) { - do_bootloader(postinstall=>0, params=>$params, mutex=>$mutex, timeout=>$timeout); + do_bootloader(postinstall => 0, params => $params, mutex => $mutex, timeout => $timeout); } # Read variables for identification tests (see further). @@ -99,7 +99,7 @@ sub run { # we direct the installer to virtio-console1, and use # virtio-console as a root console select_console('virtio-console1'); - unless (wait_serial "Use text mode", timeout=>120) { die "Anaconda has not started."; } + unless (wait_serial "Use text mode", timeout => 120) { die "Anaconda has not started."; } type_string "2\n"; unless (wait_serial "Installation") { die "Text version of Anaconda has not started."; } } @@ -133,17 +133,17 @@ sub run { my $relnum = get_release_number; my $dclick = 0; $dclick = 1 if (get_var("DESKTOP") eq "kde"); - assert_and_click("live_start_anaconda_icon", dclick=>$dclick); + assert_and_click("live_start_anaconda_icon", dclick => $dclick); unless (check_screen "anaconda_select_install_lang", 180) { # click it again - on KDE since 2019-10 or so it seems # like the first attempt sometimes just doesn't work - assert_and_click("live_start_anaconda_icon", dclick=>$dclick, timeout=>300); + assert_and_click("live_start_anaconda_icon", dclick => $dclick, timeout => 300); } } my $language = get_var('LANGUAGE') || 'english'; # wait for anaconda to appear; we click to work around # RHBZ #1566066 if it happens - assert_and_click("anaconda_select_install_lang", timeout=>300); + assert_and_click("anaconda_select_install_lang", timeout => 300); # Select install language wait_screen_change { assert_and_click "anaconda_select_install_lang_input"; }; @@ -180,7 +180,7 @@ sub run { # Here, we will watch for the graphical elements in Anaconda main hub. my $branched = get_var('VERSION'); if ($identification eq 'true' or $branched ne "Rawhide") { - check_left_bar(); # See utils.pm + check_left_bar(); # See utils.pm check_prerelease(); check_version(); } @@ -188,13 +188,13 @@ sub run { # didn't match anything: if the Rawhide warning didn't # show by now it never will, so we'll just wait for the # hub to show up. - assert_screen "anaconda_main_hub", 900; # + assert_screen "anaconda_main_hub", 900; } } } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/_check_install_source.pm b/tests/_check_install_source.pm index 713f43cb..732a26fa 100644 --- a/tests/_check_install_source.pm +++ b/tests/_check_install_source.pm @@ -94,16 +94,16 @@ sub run { } # just for convenience - sometimes it's useful to see this log # for a success case - upload_logs "/tmp/packaging.log", failok=>1; + upload_logs "/tmp/packaging.log", failok => 1; send_key "ctrl-alt-f6"; # Anaconda hub - assert_screen "anaconda_main_hub", 30; # + assert_screen "anaconda_main_hub", 30; } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/_collect_data.pm b/tests/_collect_data.pm index 51a03b52..2f04ee88 100644 --- a/tests/_collect_data.pm +++ b/tests/_collect_data.pm @@ -4,7 +4,7 @@ use testapi; sub run { my $self = shift; - $self->root_console(tty=>4); + $self->root_console(tty => 4); assert_script_run 'top -i -n20 -b > /var/tmp/top.log', 120; upload_logs '/var/tmp/top.log'; unless (get_var("CANNED")) { @@ -20,7 +20,7 @@ sub run { } sub test_flags { - return { 'ignore_failure' => 1 }; + return {'ignore_failure' => 1}; } 1; diff --git a/tests/_console_avc_crash.pm b/tests/_console_avc_crash.pm index ee3a591e..a47bfbd2 100644 --- a/tests/_console_avc_crash.pm +++ b/tests/_console_avc_crash.pm @@ -5,7 +5,7 @@ use testapi; sub run { my $self = shift; - $self->root_console(tty=>3, timeout=>30); + $self->root_console(tty => 3, timeout => 30); # if this is a non-English, non-switched layout, load US layout # at this point # FIXME: this is all kind of a mess, as on such configs we need diff --git a/tests/_console_login.pm b/tests/_console_login.pm index 950b533f..ae0b0aab 100644 --- a/tests/_console_login.pm +++ b/tests/_console_login.pm @@ -11,14 +11,14 @@ sub run { # with a password that requires Arabic support. # Such attempt to log in would always fail. if (get_var("LANGUAGE") ne "arabic" && get_var("USER_LOGIN") ne "false") { - console_login(user=>get_var("USER_LOGIN", "test"), password=>get_var("USER_PASSWORD", "weakpassword")); + console_login(user => get_var("USER_LOGIN", "test"), password => get_var("USER_PASSWORD", "weakpassword")); } if (get_var("ROOT_PASSWORD")) { - console_login(user=>"root", password=>get_var("ROOT_PASSWORD")); + console_login(user => "root", password => get_var("ROOT_PASSWORD")); } } sub test_flags { - return { fatal => 1, milestone => 1 }; + return {fatal => 1, milestone => 1}; } 1; # vim: set sw=4 et: diff --git a/tests/_console_shutdown.pm b/tests/_console_shutdown.pm index e9cbbc67..38d0cc6b 100644 --- a/tests/_console_shutdown.pm +++ b/tests/_console_shutdown.pm @@ -10,7 +10,7 @@ sub run { # use the desktops' graphical shutdown methods, we just go to a # console and run 'poweroff'. We can write separate tests for # properly testing shutdown/reboot/log out from desktops. - $self->root_console(tty=>4); + $self->root_console(tty => 4); # disable the hidden grub menu on Workstation, so post-install # tests that need to edit boot params will see it. Don't use # assert_script_run as this will fail when it's not set @@ -23,7 +23,7 @@ sub run { # even if shutdown fails. we should have a separate test for shutdown/ # logout/reboot stuff, might need some refactoring. sub test_flags { - return { 'norollback' => 1, 'ignore_failure' => 1 }; + return {'norollback' => 1, 'ignore_failure' => 1}; } 1; diff --git a/tests/_console_wait_login.pm b/tests/_console_wait_login.pm index b885249e..8c1498d2 100644 --- a/tests/_console_wait_login.pm +++ b/tests/_console_wait_login.pm @@ -11,7 +11,7 @@ sub run { # handle bootloader, if requested if (get_var("GRUB_POSTINSTALL")) { - do_bootloader(postinstall=>1, params=>get_var("GRUB_POSTINSTALL"), timeout=>$wait_time); + do_bootloader(postinstall => 1, params => get_var("GRUB_POSTINSTALL"), timeout => $wait_time); $wait_time = 240; } @@ -28,16 +28,16 @@ sub run { # this avoids us waiting 90 seconds for a # to show up my $origprompt = $testapi::distri->{serial_term_prompt}; $testapi::distri->{serial_term_prompt} = '$ '; - console_login(user=>get_var("USER_LOGIN", "test"), password=>get_var("USER_PASSWORD", "weakpassword")); + console_login(user => get_var("USER_LOGIN", "test"), password => get_var("USER_PASSWORD", "weakpassword")); $testapi::distri->{serial_term_prompt} = $origprompt; } if (get_var("ROOT_PASSWORD")) { - console_login(user=>"root", password=>get_var("ROOT_PASSWORD")); + console_login(user => "root", password => get_var("ROOT_PASSWORD")); } } sub test_flags { - return { fatal => 1, milestone => 1 }; + return {fatal => 1, milestone => 1}; } 1; diff --git a/tests/_coreos_install.pm b/tests/_coreos_install.pm index 3cd0b850..6f15cb9d 100644 --- a/tests/_coreos_install.pm +++ b/tests/_coreos_install.pm @@ -12,7 +12,7 @@ sub run { } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/_do_install_and_reboot.pm b/tests/_do_install_and_reboot.pm index 36c335b9..608ffc9a 100644 --- a/tests/_do_install_and_reboot.pm +++ b/tests/_do_install_and_reboot.pm @@ -109,20 +109,20 @@ sub run { # there are various things we might have to do at a console here # before we actually reboot. let's figure them all out first... my @actions; - push (@actions, 'consoletty0') if (get_var("ARCH") eq "aarch64"); - push (@actions, 'abrt') if (get_var("ABRT", '') eq "system"); - push (@actions, 'rootpw') if (get_var("INSTALLER_NO_ROOT")); + push(@actions, 'consoletty0') if (get_var("ARCH") eq "aarch64"); + push(@actions, 'abrt') if (get_var("ABRT", '') eq "system"); + push(@actions, 'rootpw') if (get_var("INSTALLER_NO_ROOT")); # FIXME: remove plymouth from Server install_default_upload on # non-aarch64 to work around RHBZ #1933378 unless (get_var("ARCH") eq "aarch64") { if (get_var("FLAVOR") eq "Server-dvd-iso" && get_var("TEST") eq "install_default_upload") { - push (@actions, 'noplymouth'); + push(@actions, 'noplymouth'); } } # memcheck test doesn't need to reboot at all. Rebooting from GUI # for lives is unreliable. And if we're already doing something # else at a console, we may as well reboot from there too - push (@actions, 'reboot') if (!get_var("MEMCHECK") && (get_var("LIVE") || @actions)); + push(@actions, 'reboot') if (!get_var("MEMCHECK") && (get_var("LIVE") || @actions)); # our approach for taking all these actions doesn't work on VNC # installs, fortunately we don't need any of them in that case # yet, so for now let's just flush the list here if we're VNC @@ -137,14 +137,14 @@ sub run { } # OK, if we're here, we got actions, so head to a console. Switch # to console after liveinst sometimes takes a while, so 30 secs - $self->root_console(timeout=>30); + $self->root_console(timeout => 30); # this is something a couple of actions may need to know my $mount = "/mnt/sysimage"; if (get_var("CANNED")) { # finding the actual host system root is fun for ostree... $mount = "/mnt/sysimage/ostree/deploy/fedora*/deploy/*.?"; } - if (grep {$_ eq 'consoletty0'} @actions) { + if (grep { $_ eq 'consoletty0' } @actions) { # somehow, by this point, localized keyboard layout has been # loaded for this tty, so for French and Arabic at least we # need to load the 'us' layout again for the next command to @@ -158,22 +158,22 @@ sub run { # regenerate the bootloader config assert_script_run "chroot $mount grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg"; } - if (grep {$_ eq 'abrt'} @actions) { - # Chroot in the newly installed system and switch on ABRT systemwide - assert_script_run "chroot $mount abrt-auto-reporting 1"; + if (grep { $_ eq 'abrt' } @actions) { + # Chroot in the newly installed system and switch on ABRT systemwide + assert_script_run "chroot $mount abrt-auto-reporting 1"; } - if (grep {$_ eq 'rootpw'} @actions) { + if (grep { $_ eq 'rootpw' } @actions) { my $root_password = get_var("ROOT_PASSWORD") || "weakpassword"; assert_script_run "echo 'root:$root_password' | chpasswd -R $mount"; } - if (grep {$_ eq 'noplymouth'} @actions) { + if (grep { $_ eq 'noplymouth' } @actions) { assert_script_run "chroot $mount dnf -y remove plymouth"; } - type_string "reboot\n" if (grep {$_ eq 'reboot'} @actions); + type_string "reboot\n" if (grep { $_ eq 'reboot' } @actions); } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/_graphical_input.pm b/tests/_graphical_input.pm index 0a8b7ff3..5c4756da 100644 --- a/tests/_graphical_input.pm +++ b/tests/_graphical_input.pm @@ -56,7 +56,7 @@ sub run { } sub test_flags { - return { fatal => 1, always_rollback => 1 }; + return {fatal => 1, always_rollback => 1}; } 1; diff --git a/tests/_graphical_wait_login.pm b/tests/_graphical_wait_login.pm index 95b3926b..33334676 100644 --- a/tests/_graphical_wait_login.pm +++ b/tests/_graphical_wait_login.pm @@ -17,17 +17,17 @@ sub run { # handle bootloader, if requested if (get_var("GRUB_POSTINSTALL")) { - do_bootloader(postinstall=>1, params=>get_var("GRUB_POSTINSTALL"), timeout=>$wait_time); + do_bootloader(postinstall => 1, params => get_var("GRUB_POSTINSTALL"), timeout => $wait_time); $wait_time = 300; } # Handle pre-login initial setup if we're doing INSTALL_NO_USER if (get_var("INSTALL_NO_USER") && !get_var("_setup_done")) { if (get_var("DESKTOP") eq 'gnome') { - gnome_initial_setup(prelogin=>1, timeout=>$wait_time); + gnome_initial_setup(prelogin => 1, timeout => $wait_time); } else { - anaconda_create_user(timeout=>$wait_time); + anaconda_create_user(timeout => $wait_time); # wait out animation wait_still_screen 3; assert_and_click "initialsetup_finish_configuration"; @@ -88,7 +88,7 @@ sub run { # root user now, for subsequent tests to work if (get_var("IMAGE_DEPLOY")) { send_key "ctrl-alt-f3"; - console_login(user=>get_var("USER_LOGIN", "test"), password=>get_var("USER_PASSWORD", "weakpassword")); + console_login(user => get_var("USER_LOGIN", "test"), password => get_var("USER_PASSWORD", "weakpassword")); type_string "sudo su\n"; type_string "$password\n"; my $root_password = get_var("ROOT_PASSWORD") || "weakpassword"; @@ -100,11 +100,11 @@ sub run { # Move the mouse somewhere it won't highlight the match areas mouse_set(300, 800); # KDE can take ages to start up - check_desktop(timeout=>120); + check_desktop(timeout => 120); } sub test_flags { - return { fatal => 1, milestone => 1 }; + return {fatal => 1, milestone => 1}; } 1; diff --git a/tests/_installer_build.pm b/tests/_installer_build.pm index 66801a8d..76f436b6 100644 --- a/tests/_installer_build.pm +++ b/tests/_installer_build.pm @@ -26,13 +26,13 @@ sub run { $cmd .= " --repo=/etc/yum.repos.d/advisory.repo --repo=/etc/yum.repos.d/workarounds.repo ./results"; assert_script_run $cmd, 2400; # good to have the log around for checks - upload_logs "pylorax.log", failok=>1; + upload_logs "pylorax.log", failok => 1; assert_script_run "mv results/images/boot.iso ./${advortask}-netinst-${arch}.iso"; upload_asset "./${advortask}-netinst-x86_64.iso"; } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/_iot_zezere_remote.pm b/tests/_iot_zezere_remote.pm index f2a92e8f..00b4dc58 100644 --- a/tests/_iot_zezere_remote.pm +++ b/tests/_iot_zezere_remote.pm @@ -52,7 +52,7 @@ sub run { sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/_iot_zezere_server.pm b/tests/_iot_zezere_server.pm index 0661c2d4..76df9f45 100644 --- a/tests/_iot_zezere_server.pm +++ b/tests/_iot_zezere_server.pm @@ -39,7 +39,7 @@ sub run { sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/_live_build.pm b/tests/_live_build.pm index cd37e265..a9cd8455 100644 --- a/tests/_live_build.pm +++ b/tests/_live_build.pm @@ -80,7 +80,7 @@ sub run { } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/_memcheck.pm b/tests/_memcheck.pm index 00f0cd8b..953cdbf9 100644 --- a/tests/_memcheck.pm +++ b/tests/_memcheck.pm @@ -1,17 +1,17 @@ use base "anacondatest"; - use strict; - use testapi; - - sub run { - my $self = shift; - $self->root_console(); - upload_logs '/tmp/memory.dat'; - } - - sub test_flags { - return { fatal => 1 }; - } - - 1; - - # vim: set sw=4 et: +use strict; +use testapi; + +sub run { + my $self = shift; + $self->root_console(); + upload_logs '/tmp/memory.dat'; +} + +sub test_flags { + return {fatal => 1}; +} + +1; + +# vim: set sw=4 et: diff --git a/tests/_podman_client.pm b/tests/_podman_client.pm index cba1762e..c63449b5 100644 --- a/tests/_podman_client.pm +++ b/tests/_podman_client.pm @@ -8,7 +8,7 @@ use utils; sub run { my $self = shift; - $self->root_console(tty=>3); + $self->root_console(tty => 3); # wait for server to be set up mutex_lock "podman_server_ready"; mutex_unlock "podman_server_ready"; @@ -25,7 +25,7 @@ sub run { sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/_post_network_static.pm b/tests/_post_network_static.pm index 8213e227..e54fa3fa 100644 --- a/tests/_post_network_static.pm +++ b/tests/_post_network_static.pm @@ -13,7 +13,7 @@ sub run { } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/_setup_browser.pm b/tests/_setup_browser.pm index 3981f439..18e327ff 100644 --- a/tests/_setup_browser.pm +++ b/tests/_setup_browser.pm @@ -24,7 +24,7 @@ sub run { } sub test_flags { - return { fatal => 1, milestone => 1 }; + return {fatal => 1, milestone => 1}; } 1; diff --git a/tests/_software_selection.pm b/tests/_software_selection.pm index 721c5595..d01a32a9 100644 --- a/tests/_software_selection.pm +++ b/tests/_software_selection.pm @@ -5,7 +5,7 @@ use testapi; sub run { my $self = shift; # Anaconda hub - assert_screen "anaconda_main_hub", 300; # + assert_screen "anaconda_main_hub", 300; # Select package set. Minimal is the default, if 'default' is specified, skip selection, # but verify correct default in some cases @@ -41,24 +41,24 @@ sub run { # select desired environment # go through the list 20 times at max (to prevent infinite loop when it's missing) - for (my $i = 0; !check_screen("anaconda_".$packageset."_highlighted", 1) && $i < 20; $i++) { - send_key "down"; + for (my $i = 0; !check_screen("anaconda_" . $packageset . "_highlighted", 1) && $i < 20; $i++) { + send_key "down"; } send_key "spc"; # check that desired environment is selected - assert_screen "anaconda_".$packageset."_selected"; + assert_screen "anaconda_" . $packageset . "_selected"; assert_and_click "anaconda_spoke_done"; # Anaconda hub - assert_screen "anaconda_main_hub", 50; # + assert_screen "anaconda_main_hub", 50; } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/_support_server.pm b/tests/_support_server.pm index e752b6ed..670d2a08 100644 --- a/tests/_support_server.pm +++ b/tests/_support_server.pm @@ -74,7 +74,7 @@ sub _pxe_setup { # download kernel and initramfs my $location = get_var("LOCATION"); my $kernpath = "images/pxeboot"; - # for some crazy reason these are in a different place for ppc64 + # for some crazy reason these are in a different place for ppc64 $kernpath = "ppc/ppc64" if ($arch eq 'ppc64le'); assert_script_run "curl -o /var/lib/tftpboot/fedora/vmlinuz $location/Everything/${arch}/os/${kernpath}/vmlinuz"; assert_script_run "curl -o /var/lib/tftpboot/fedora/initrd.img $location/Everything/${arch}/os/${kernpath}/initrd.img"; @@ -93,7 +93,7 @@ sub _pxe_setup { } sub run { - my $self=shift; + my $self = shift; # disable systemd-resolved, it conflicts with dnsmasq unless (script_run "systemctl is-active systemd-resolved.service") { script_run "systemctl stop systemd-resolved.service"; @@ -168,7 +168,7 @@ sub run { } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/_vnc_client_connect.pm b/tests/_vnc_client_connect.pm index f2e8b436..f41d0d63 100644 --- a/tests/_vnc_client_connect.pm +++ b/tests/_vnc_client_connect.pm @@ -20,7 +20,7 @@ sub run { } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/_vnc_client_connect_pre.pm b/tests/_vnc_client_connect_pre.pm index 6577a484..fa3b01c4 100644 --- a/tests/_vnc_client_connect_pre.pm +++ b/tests/_vnc_client_connect_pre.pm @@ -7,7 +7,7 @@ use utils; sub run { my $self = shift; boot_to_login_screen(timeout => 300); - $self->root_console(tty=>3); + $self->root_console(tty => 3); setup_tap_static('172.16.2.115', 'vnc002.test.openqa.fedoraproject.org'); # test test: check if we can see the server assert_script_run "ping -c 2 172.16.2.114"; @@ -18,7 +18,7 @@ sub run { } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/_vncconnect_client_setup.pm b/tests/_vncconnect_client_setup.pm index cee15162..176bfe40 100644 --- a/tests/_vncconnect_client_setup.pm +++ b/tests/_vncconnect_client_setup.pm @@ -13,7 +13,7 @@ sub run { } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/_vncconnect_client_setup_pre.pm b/tests/_vncconnect_client_setup_pre.pm index 3bd4a4a2..cc64a4e6 100644 --- a/tests/_vncconnect_client_setup_pre.pm +++ b/tests/_vncconnect_client_setup_pre.pm @@ -7,7 +7,7 @@ use utils; sub run { my $self = shift; boot_to_login_screen(timeout => 300); - $self->root_console(tty=>3); + $self->root_console(tty => 3); setup_tap_static('172.16.2.117', 'vnc004.test.openqa.fedoraproject.org'); # install tigervnc (Boxes doesn't do reverse VNC) assert_script_run "dnf -y install tigervnc", 180; @@ -17,7 +17,7 @@ sub run { } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/anaconda_help.pm b/tests/anaconda_help.pm index da455c0c..bec8b42e 100644 --- a/tests/anaconda_help.pm +++ b/tests/anaconda_help.pm @@ -50,7 +50,7 @@ sub run { # on GNOME installs (Workstation Live and Silverblue) we don't # need to set a root password or create a user; on other flavors # we must - unless (get_var("DESKTOP") eq "gnome" ) { + unless (get_var("DESKTOP") eq "gnome") { assert_and_click "anaconda_install_root_password"; # from anaconda-35.22.1 onwards, we have to click 'enable root # account' before typing the password. For older versions, diff --git a/tests/applications/clocks/aaa_setup.pm b/tests/applications/clocks/aaa_setup.pm index c0d4828a..b0d1112c 100644 --- a/tests/applications/clocks/aaa_setup.pm +++ b/tests/applications/clocks/aaa_setup.pm @@ -9,8 +9,8 @@ use utils; sub run { my $self = shift; - # At first, we need to set time and time zones manually. - $self->root_console(tty=>3); + # At first, we need to set time and time zones manually. + $self->root_console(tty => 3); # Switch off automatic time. assert_script_run("timedatectl set-ntp 0"); # Set the time zone diff --git a/tests/applications/clocks/alarm.pm b/tests/applications/clocks/alarm.pm index a62c2483..0ad1c1a5 100644 --- a/tests/applications/clocks/alarm.pm +++ b/tests/applications/clocks/alarm.pm @@ -9,7 +9,7 @@ sub run { my $self = shift; # Click on the Alarm button. - assert_and_click("clocks_button_alarm"); + assert_and_click("clocks_button_alarm"); # Add a new alarm using the Add Alarm button assert_and_click("clocks_button_add_alarm"); diff --git a/tests/applications/eog/aaa_setup.pm b/tests/applications/eog/aaa_setup.pm index 4f1bab69..c7609d90 100644 --- a/tests/applications/eog/aaa_setup.pm +++ b/tests/applications/eog/aaa_setup.pm @@ -9,7 +9,7 @@ use utils; sub run { my $self = shift; # Switch to console - $self->root_console(tty=>3); + $self->root_console(tty => 3); # Perform git test check_and_install_git(); # Download the test data @@ -35,7 +35,7 @@ sub run { # Select the image.jpg file. assert_and_click("eog_file_select_jpg", button => "left", timeout => 30); - + # Hit enter to open it. send_key("ret"); diff --git a/tests/applications/eog/about.pm b/tests/applications/eog/about.pm index 14e5b146..ca8c145f 100644 --- a/tests/applications/eog/about.pm +++ b/tests/applications/eog/about.pm @@ -7,7 +7,7 @@ use utils; sub run { my $self = shift; - + # Open the menu assert_and_click("gnome_burger_menu"); wait_still_screen(3); diff --git a/tests/applications/eog/basic_view.pm b/tests/applications/eog/basic_view.pm index 2ff2ef73..489b3b50 100644 --- a/tests/applications/eog/basic_view.pm +++ b/tests/applications/eog/basic_view.pm @@ -7,7 +7,7 @@ use utils; sub run { my $self = shift; - + # Check that the picture name is shown assert_screen "eog_picture_name"; diff --git a/tests/applications/eog/browse.pm b/tests/applications/eog/browse.pm index 9ed016f1..2ba19f1e 100644 --- a/tests/applications/eog/browse.pm +++ b/tests/applications/eog/browse.pm @@ -7,7 +7,7 @@ use utils; sub run { my $self = shift; - + # Go to next picture. send_key("right"); wait_still_screen(2); diff --git a/tests/applications/eog/fullscreen.pm b/tests/applications/eog/fullscreen.pm index ab70166c..3800ccee 100644 --- a/tests/applications/eog/fullscreen.pm +++ b/tests/applications/eog/fullscreen.pm @@ -7,7 +7,7 @@ use utils; sub run { my $self = shift; - + # Toggle full screen send_key("f11"); wait_still_screen 2; diff --git a/tests/applications/eog/help.pm b/tests/applications/eog/help.pm index 55119bed..cebb3c28 100644 --- a/tests/applications/eog/help.pm +++ b/tests/applications/eog/help.pm @@ -8,7 +8,7 @@ use utils; sub run { my $self = shift; sleep 2; - + # Open the shortcuts send_key("f1"); wait_still_screen(3); diff --git a/tests/applications/eog/rotate.pm b/tests/applications/eog/rotate.pm index 5bef0649..3f7ac443 100644 --- a/tests/applications/eog/rotate.pm +++ b/tests/applications/eog/rotate.pm @@ -7,7 +7,7 @@ use utils; sub run { my $self = shift; - + # Rotate left send_key("shift-ctrl-r"); wait_still_screen(2); diff --git a/tests/applications/eog/save_as.pm b/tests/applications/eog/save_as.pm index 8fe15901..b5f6425a 100644 --- a/tests/applications/eog/save_as.pm +++ b/tests/applications/eog/save_as.pm @@ -9,7 +9,7 @@ sub run { my $self = shift; sleep 2; assert_screen("eog_image_default"); - + # Shift-ctrl-S to save a file as a new file. send_key("shift-ctrl-s"); wait_still_screen(3); @@ -21,7 +21,7 @@ sub run { wait_still_screen("2"); # Go to console - $self->root_console(tty=>3); + $self->root_console(tty => 3); # List the location assert_script_run("ls /home/test/Pictures/"); diff --git a/tests/applications/eog/shortcuts.pm b/tests/applications/eog/shortcuts.pm index 7dcba0ab..14b40830 100644 --- a/tests/applications/eog/shortcuts.pm +++ b/tests/applications/eog/shortcuts.pm @@ -8,7 +8,7 @@ use utils; sub run { my $self = shift; sleep 2; - + # Open the shortcuts send_key("ctrl-?"); wait_still_screen(3); diff --git a/tests/applications/eog/show_gallery.pm b/tests/applications/eog/show_gallery.pm index 0a5c0ae1..4b2cac85 100644 --- a/tests/applications/eog/show_gallery.pm +++ b/tests/applications/eog/show_gallery.pm @@ -22,7 +22,7 @@ sub run { # Toggle gallery assert_and_click("eog_gallery_show"); wait_still_screen(2); - + } assert_screen("eog_gallery_shown"); } diff --git a/tests/applications/eog/zoom.pm b/tests/applications/eog/zoom.pm index 0bcc846b..419f6915 100644 --- a/tests/applications/eog/zoom.pm +++ b/tests/applications/eog/zoom.pm @@ -8,7 +8,7 @@ use utils; sub run { my $self = shift; sleep 2; - + # Make the image size 1:1 send_key("1"); wait_still_screen(2); diff --git a/tests/applications/evince/aaa_setup.pm b/tests/applications/evince/aaa_setup.pm index bbe3529f..3d5419b5 100644 --- a/tests/applications/evince/aaa_setup.pm +++ b/tests/applications/evince/aaa_setup.pm @@ -10,7 +10,7 @@ use utils; sub run { my $self = shift; # Switch to console - $self->root_console(tty=>3); + $self->root_console(tty => 3); # Perform git test check_and_install_git(); # Download the test data @@ -34,7 +34,7 @@ sub run { # Select the evince.pdf file. assert_and_click("evince_file_select_pdf", button => "left", timeout => 30); - + # Click the Open button to open the file assert_and_click("gnome_button_open", button => "left", timeout => 30); diff --git a/tests/applications/evince/about.pm b/tests/applications/evince/about.pm index 030767d5..ae9af614 100644 --- a/tests/applications/evince/about.pm +++ b/tests/applications/evince/about.pm @@ -6,23 +6,23 @@ use utils; # This part of the suite tests if About works. sub run { -my $self = shift; + my $self = shift; -# Open the menu by clicking on the Burger icon -assert_and_click("gnome_burger_menu", button => "left", timeout => 30); -wait_still_screen 2; + # Open the menu by clicking on the Burger icon + assert_and_click("gnome_burger_menu", button => "left", timeout => 30); + wait_still_screen 2; -# In the menu, select the About item. -assert_and_click("evince_menu_about", button => "left", timeout => 30); + # In the menu, select the About item. + assert_and_click("evince_menu_about", button => "left", timeout => 30); -# Check that the About section has been displayed. -assert_screen("evince_about_shown"); + # Check that the About section has been displayed. + assert_screen("evince_about_shown"); -# Click on Credits button to see the second part of the dialogue. -assert_and_click("evince_about_credits", button => "left", timeout => 30); + # Click on Credits button to see the second part of the dialogue. + assert_and_click("evince_about_credits", button => "left", timeout => 30); -# Check that Credits are accessible and visible, too. -assert_screen("evince_credits_shown"); + # Check that Credits are accessible and visible, too. + assert_screen("evince_credits_shown"); } diff --git a/tests/applications/evince/add_annotation.pm b/tests/applications/evince/add_annotation.pm index 4fd3fdbd..9014b278 100644 --- a/tests/applications/evince/add_annotation.pm +++ b/tests/applications/evince/add_annotation.pm @@ -6,37 +6,37 @@ use utils; # This part of the suite tests an annotation can be added to the displayed content. sub run { -my $self = shift; + my $self = shift; -# Click on the Pencil button. -assert_and_click("evince_add_annotation", button => "left", timeout => 30); + # Click on the Pencil button. + assert_and_click("evince_add_annotation", button => "left", timeout => 30); -# Click on Note text. -assert_and_click("evince_add_annotation_text", button => "left", timeout => 30); + # Click on Note text. + assert_and_click("evince_add_annotation_text", button => "left", timeout => 30); -# Select location to add annotation. -assert_and_click("evince_select_annotation_place", button => "left", timeout => 30); + # Select location to add annotation. + assert_and_click("evince_select_annotation_place", button => "left", timeout => 30); -# Enter some text to the annotation. -type_very_safely("Add note"); + # Enter some text to the annotation. + type_very_safely("Add note"); -# Check that the annotation window has appeared with that text. -assert_screen("evince_annotation_added"); + # Check that the annotation window has appeared with that text. + assert_screen("evince_annotation_added"); -# Close the annotation. -assert_and_click("evince_close_annotation", button => "left", timeout => 30); + # Close the annotation. + assert_and_click("evince_close_annotation", button => "left", timeout => 30); -# Check that the annotation is still placed in the document. -assert_screen("evince_annotation_placed"); + # Check that the annotation is still placed in the document. + assert_screen("evince_annotation_placed"); -# Open the annotation's context menu. -assert_and_click("evince_annotation_placed", button => "right", timeout => 30); + # Open the annotation's context menu. + assert_and_click("evince_annotation_placed", button => "right", timeout => 30); -# Remove the annotation. -assert_and_click("evince_remove_annotation", button => "left", timeout => 30); + # Remove the annotation. + assert_and_click("evince_remove_annotation", button => "left", timeout => 30); -# Check that the annotation has been removed. -assert_screen("evince_annotation_removed"); + # Check that the annotation has been removed. + assert_screen("evince_annotation_removed"); } diff --git a/tests/applications/evince/change_zoom.pm b/tests/applications/evince/change_zoom.pm index 93ab52a0..33949e87 100644 --- a/tests/applications/evince/change_zoom.pm +++ b/tests/applications/evince/change_zoom.pm @@ -6,22 +6,22 @@ use utils; # This part of the suite tests that Evince can change the zoom of the document. sub run { -my $self = shift; + my $self = shift; -# Click on zoom menu to open choices. -assert_and_click("evince_change_zoom", button => "left", timeout => 30); + # Click on zoom menu to open choices. + assert_and_click("evince_change_zoom", button => "left", timeout => 30); -# Select 200%. -assert_and_click("evince_select_zoom_200", button => "left", timeout => 30); + # Select 200%. + assert_and_click("evince_select_zoom_200", button => "left", timeout => 30); -# Check that the document zoom was changed. -assert_screen("evince_document_zoom_200"); + # Check that the document zoom was changed. + assert_screen("evince_document_zoom_200"); } sub test_flags { - return {always_rollback => 1}; + return {always_rollback => 1}; } 1; diff --git a/tests/applications/evince/dual_mode.pm b/tests/applications/evince/dual_mode.pm index dbf1ba4a..3a8aa91e 100644 --- a/tests/applications/evince/dual_mode.pm +++ b/tests/applications/evince/dual_mode.pm @@ -6,32 +6,32 @@ use utils; # This part of the suite tests that Evince is able to display content in a two-page mode. sub run { -my $self = shift; + my $self = shift; -# Click on the Zoom menu to change a different zoom for next steps. -assert_and_click("evince_change_zoom", button => "left", timeout => 30); + # Click on the Zoom menu to change a different zoom for next steps. + assert_and_click("evince_change_zoom", button => "left", timeout => 30); -# Select the Fit Width option to be able to see the whole layout. -assert_and_click("evince_select_zoom_fitwidth", button => "left", timeout => 30); + # Select the Fit Width option to be able to see the whole layout. + assert_and_click("evince_select_zoom_fitwidth", button => "left", timeout => 30); -#Dismiss the dialogue -send_key("esc"); + #Dismiss the dialogue + send_key("esc"); -# Enter the menu -assert_and_click("gnome_burger_menu", button => "left", timeout => 30); + # Enter the menu + assert_and_click("gnome_burger_menu", button => "left", timeout => 30); -# Select the Dual mode -assert_and_click("evince_menu_dual", button => "left", timeout => 30); + # Select the Dual mode + assert_and_click("evince_menu_dual", button => "left", timeout => 30); -# Dismiss the menu -send_key("esc"); + # Dismiss the menu + send_key("esc"); -# Check that the content is displayed in dual mode. -assert_screen("evince_dual_mode", timeout => 30); + # Check that the content is displayed in dual mode. + assert_screen("evince_dual_mode", timeout => 30); } sub test_flags { - return {always_rollback => 1}; + return {always_rollback => 1}; } 1; diff --git a/tests/applications/evince/help.pm b/tests/applications/evince/help.pm index 6735157c..25e8df9b 100644 --- a/tests/applications/evince/help.pm +++ b/tests/applications/evince/help.pm @@ -6,22 +6,22 @@ use utils; # This part of the suite tests that Evince can display the Help pages. sub run { -my $self = shift; + my $self = shift; -# Open menu with Burger icon. -assert_and_click("gnome_burger_menu", button => "left", timeout => 30); -wait_still_screen 2; + # Open menu with Burger icon. + assert_and_click("gnome_burger_menu", button => "left", timeout => 30); + wait_still_screen 2; -# Select the Help item in the menu. -assert_and_click("evince_menu_help", button => "left", timeout => 30); -wait_still_screen 2; + # Select the Help item in the menu. + assert_and_click("evince_menu_help", button => "left", timeout => 30); + wait_still_screen 2; -# Check that Help has been shown. -assert_screen("evince_help_shown", timeout => 30); + # Check that Help has been shown. + assert_screen("evince_help_shown", timeout => 30); } sub test_flags { - return {always_rollback => 1}; + return {always_rollback => 1}; } 1; diff --git a/tests/applications/evince/night_mode.pm b/tests/applications/evince/night_mode.pm index d7b69506..5a69d5b5 100644 --- a/tests/applications/evince/night_mode.pm +++ b/tests/applications/evince/night_mode.pm @@ -6,25 +6,25 @@ use utils; # This part of the suite tests that Evince can be switched into night mode. sub run { -my $self = shift; + my $self = shift; -# Click on the Menu button. -assert_and_click("gnome_burger_menu", timeout => 30, button => "left"); + # Click on the Menu button. + assert_and_click("gnome_burger_menu", timeout => 30, button => "left"); -# Click on the Night mode to select it. -assert_and_click("evince_toggle_night_mode", button => "left", timeout => 30); + # Click on the Night mode to select it. + assert_and_click("evince_toggle_night_mode", button => "left", timeout => 30); -# The menu stays opened, so hit Esc to dismiss it. -send_key("esc"); -wait_still_screen 2; + # The menu stays opened, so hit Esc to dismiss it. + send_key("esc"); + wait_still_screen 2; -# Check that night mode has been activated. -assert_screen("evince_night_mode", timeout => 30); + # Check that night mode has been activated. + assert_screen("evince_night_mode", timeout => 30); } sub test_flags { - return {always_rollback => 1}; + return {always_rollback => 1}; } 1; diff --git a/tests/applications/evince/properties.pm b/tests/applications/evince/properties.pm index e588e4d2..ab16679b 100644 --- a/tests/applications/evince/properties.pm +++ b/tests/applications/evince/properties.pm @@ -6,22 +6,22 @@ use utils; # This part of the suite tests that Evince can show Document Properties. sub run { -my $self = shift; + my $self = shift; -# Open the menu. -assert_and_click("gnome_burger_menu", button => "left", timeout => 30); -wait_still_screen 2; + # Open the menu. + assert_and_click("gnome_burger_menu", button => "left", timeout => 30); + wait_still_screen 2; -# Select the Properties item. -assert_and_click("evince_menu_properties", button => "left", timeout => 30); -wait_still_screen 2; + # Select the Properties item. + assert_and_click("evince_menu_properties", button => "left", timeout => 30); + wait_still_screen 2; -# Check that Properties are shown. -assert_screen("evince_properties_shown", timeout => 30); + # Check that Properties are shown. + assert_screen("evince_properties_shown", timeout => 30); } sub test_flags { - return {always_rollback => 1}; + return {always_rollback => 1}; } 1; diff --git a/tests/applications/evince/rotate.pm b/tests/applications/evince/rotate.pm index cf151e11..f9e73588 100644 --- a/tests/applications/evince/rotate.pm +++ b/tests/applications/evince/rotate.pm @@ -7,28 +7,28 @@ use utils; sub rotate_content { -# Send the key combo to rotate the content -send_key("ctrl-right"); + # Send the key combo to rotate the content + send_key("ctrl-right"); } sub run { -my $self = shift; + my $self = shift; -# Rotate the content once. -rotate_content(); + # Rotate the content once. + rotate_content(); -# Check that the window content has been rotated. -assert_screen("evince_content_rotated_once", timeout => 30); + # Check that the window content has been rotated. + assert_screen("evince_content_rotated_once", timeout => 30); -# Rotate the content again. -rotate_content(); + # Rotate the content again. + rotate_content(); -# Check that the window content has been rotated. -assert_screen("evince_content_rotated_twice", timeout => 30); + # Check that the window content has been rotated. + assert_screen("evince_content_rotated_twice", timeout => 30); } sub test_flags { - return {always_rollback => 1}; + return {always_rollback => 1}; } 1; diff --git a/tests/applications/evince/save_as.pm b/tests/applications/evince/save_as.pm index c5e7ae10..7cef4c83 100644 --- a/tests/applications/evince/save_as.pm +++ b/tests/applications/evince/save_as.pm @@ -6,36 +6,36 @@ use utils; # This part of the suite tests tests that Evince can Save the document As another document. sub run { -my $self = shift; + my $self = shift; -# Open the menu. -assert_and_click("gnome_burger_menu", button => "left", timeout => 30); + # Open the menu. + assert_and_click("gnome_burger_menu", button => "left", timeout => 30); -# Select Save As -assert_and_click("evince_menu_saveas", button => "left", timeout => 30); + # Select Save As + assert_and_click("evince_menu_saveas", button => "left", timeout => 30); -# Type a new name. -type_very_safely("alternative"); + # Type a new name. + type_very_safely("alternative"); -# Click on the Save button -assert_and_click("gnome_button_save_blue", button => "left", timeout => 30); + # Click on the Save button + assert_and_click("gnome_button_save_blue", button => "left", timeout => 30); -# Now the document is saved under a different name. We will switch to the -# terminal console to check that it has been created. -$self->root_console(tty=>3); -my $filename = "alternative.pdf"; -if (script_run("ls /home/test/Documents/${filename}")) { - $filename = "alternativeevince.pdf"; - assert_script_run("ls /home/test/Documents/${filename}"); - record_soft_failure("File name was not pre-selected in Save As dialog: https://gitlab.gnome.org/GNOME/gtk/-/issues/4768"); -} + # Now the document is saved under a different name. We will switch to the + # terminal console to check that it has been created. + $self->root_console(tty => 3); + my $filename = "alternative.pdf"; + if (script_run("ls /home/test/Documents/${filename}")) { + $filename = "alternativeevince.pdf"; + assert_script_run("ls /home/test/Documents/${filename}"); + record_soft_failure("File name was not pre-selected in Save As dialog: https://gitlab.gnome.org/GNOME/gtk/-/issues/4768"); + } -# Now, check that the new file does not differ from the original one. -assert_script_run("diff /home/test/Documents/evince.pdf /home/test/Documents/${filename}"); + # Now, check that the new file does not differ from the original one. + assert_script_run("diff /home/test/Documents/evince.pdf /home/test/Documents/${filename}"); } sub test_flags { - return {always_rollback => 1}; + return {always_rollback => 1}; } 1; diff --git a/tests/applications/evince/search.pm b/tests/applications/evince/search.pm index 14a9de78..e1d42bd1 100644 --- a/tests/applications/evince/search.pm +++ b/tests/applications/evince/search.pm @@ -6,23 +6,23 @@ use utils; # This part of the suite tests the ability to search string in the text. sub run { -my $self = shift; + my $self = shift; -# Click on the Search button to search for text -assert_and_click("evince_search_button", button => "left", timeout => 30); + # Click on the Search button to search for text + assert_and_click("evince_search_button", button => "left", timeout => 30); -# Type *pages*. -type_very_safely("pages"); -# Press Enter. -send_key("ret"); + # Type *pages*. + type_very_safely("pages"); + # Press Enter. + send_key("ret"); -# Check that the typed text has been found. -assert_screen("evince_search_found", timeout => 30); + # Check that the typed text has been found. + assert_screen("evince_search_found", timeout => 30); } sub test_flags { - return {always_rollback => 1}; + return {always_rollback => 1}; } 1; diff --git a/tests/applications/evince/shortcuts.pm b/tests/applications/evince/shortcuts.pm index 44963a32..b56c7825 100644 --- a/tests/applications/evince/shortcuts.pm +++ b/tests/applications/evince/shortcuts.pm @@ -6,34 +6,34 @@ use utils; # This part of the suite tests that Evince displays shortcuts. sub run { -my $self = shift; + my $self = shift; -# Open the menu -assert_and_click("gnome_burger_menu", button => "left", timeout => 30); -wait_still_screen 2; + # Open the menu + assert_and_click("gnome_burger_menu", button => "left", timeout => 30); + wait_still_screen 2; -# Select the Keyboard Shortcuts item -assert_and_click("evince_menu_shortcuts", button => "left", timeout => 30); -wait_still_screen 2; + # Select the Keyboard Shortcuts item + assert_and_click("evince_menu_shortcuts", button => "left", timeout => 30); + wait_still_screen 2; -# Check that Shortcuts has been shown -assert_screen("evince_shortcuts_shown"); + # Check that Shortcuts has been shown + assert_screen("evince_shortcuts_shown"); -# Click on number 2 to arrive to the second page -assert_and_click("evince_shortcuts_second", button => "left", timeout => 30); + # Click on number 2 to arrive to the second page + assert_and_click("evince_shortcuts_second", button => "left", timeout => 30); -# Check that Shortcuts 2 has been shown -assert_screen("evince_shortcuts_second_shown"); + # Check that Shortcuts 2 has been shown + assert_screen("evince_shortcuts_second_shown"); -# Click on number 3 to arrive to the second page -assert_and_click("evince_shortcuts_third", button => "left", timeout => 30); + # Click on number 3 to arrive to the second page + assert_and_click("evince_shortcuts_third", button => "left", timeout => 30); -# Check that Shortcuts 3 has been shown -assert_screen("evince_shortcuts_third_shown"); + # Check that Shortcuts 3 has been shown + assert_screen("evince_shortcuts_third_shown"); } sub test_flags { - return {always_rollback => 1}; + return {always_rollback => 1}; } 1; diff --git a/tests/applications/gnome-text-editor/aaa_setup.pm b/tests/applications/gnome-text-editor/aaa_setup.pm index c8faa7c4..a0626b46 100644 --- a/tests/applications/gnome-text-editor/aaa_setup.pm +++ b/tests/applications/gnome-text-editor/aaa_setup.pm @@ -7,9 +7,9 @@ use utils; sub run { my $self = shift; - + # Go to the root console to set up the test data and necessary stuff. - $self->root_console(tty=>3); + $self->root_console(tty => 3); # Get the test data from the test data repository. check_and_install_git(); @@ -37,7 +37,7 @@ sub run { # Open it send_key("ret"); wait_still_screen(3); - + # Make the application fullscreen send_key("super-up"); wait_still_screen(3); @@ -47,7 +47,7 @@ sub run { } sub test_flags { - return { fatal => 1, milestone => 1 }; + return {fatal => 1, milestone => 1}; } 1; diff --git a/tests/applications/gnome-text-editor/about.pm b/tests/applications/gnome-text-editor/about.pm index 99ed3971..93f09bef 100644 --- a/tests/applications/gnome-text-editor/about.pm +++ b/tests/applications/gnome-text-editor/about.pm @@ -10,7 +10,7 @@ sub run { # Open the menu. assert_and_click("gnome_burger_menu"); wait_still_screen(3); - + # Choose the About item. assert_and_click "gte_about"; wait_still_screen(2); @@ -27,7 +27,7 @@ sub run { } sub test_flags { - return { always_rollback => 1 }; + return {always_rollback => 1}; } 1; diff --git a/tests/applications/gnome-text-editor/delete_line.pm b/tests/applications/gnome-text-editor/delete_line.pm index caa39d12..f28f5314 100644 --- a/tests/applications/gnome-text-editor/delete_line.pm +++ b/tests/applications/gnome-text-editor/delete_line.pm @@ -3,13 +3,13 @@ use strict; use testapi; use utils; -# This part tests that a line of text can be deleted +# This part tests that a line of text can be deleted # and the deletion reverted. sub run { my $self = shift; # Click on a word on the line. - assert_and_click("gte_line_word", clicktime=>0.3); + assert_and_click("gte_line_word", clicktime => 0.3); wait_still_screen(2); # Delete the line send_key("home"); @@ -33,7 +33,7 @@ sub run { } sub test_flags { - return { always_rollback => 1 }; + return {always_rollback => 1}; } 1; diff --git a/tests/applications/gnome-text-editor/find_text.pm b/tests/applications/gnome-text-editor/find_text.pm index 92e0d36a..0b128154 100644 --- a/tests/applications/gnome-text-editor/find_text.pm +++ b/tests/applications/gnome-text-editor/find_text.pm @@ -23,13 +23,13 @@ sub run { send_key "esc"; # Check that correct word is highlighted. assert_screen "gte_found_text"; - + # This tests that a highlight can be removed from a search result. # Use combo for removing the highlighting. send_key "ctrl-end"; # Check that the highlighting was removed. assert_screen "gte_text_added"; - + # We will continue to search and replace a piece of text. # Open Switch and replace send_key "ctrl-h"; @@ -43,7 +43,7 @@ sub run { sleep 1; send_key("delete"); # Type replacement string. We purposefully produce a typo. - type_safely "Wiend"; + type_safely "Wiend"; # Click to find the string assert_and_click "gte_find_next_occurence"; # and replace it. @@ -59,7 +59,7 @@ sub run { } sub test_flags { - return { always_rollback => 1 }; + return {always_rollback => 1}; } 1; diff --git a/tests/applications/gnome-text-editor/line_numbering.pm b/tests/applications/gnome-text-editor/line_numbering.pm index 35dd4a5b..577de2d6 100644 --- a/tests/applications/gnome-text-editor/line_numbering.pm +++ b/tests/applications/gnome-text-editor/line_numbering.pm @@ -8,7 +8,7 @@ use utils; sub run { my $self = shift; - + # Switches on line numbering. assert_and_click "gte_settings_button"; wait_still_screen(3); @@ -47,7 +47,7 @@ sub run { sub test_flags { - return { always_rollback => 1 }; + return {always_rollback => 1}; } 1; diff --git a/tests/applications/gnome-text-editor/new_file.pm b/tests/applications/gnome-text-editor/new_file.pm index bac18756..6fdd8be0 100644 --- a/tests/applications/gnome-text-editor/new_file.pm +++ b/tests/applications/gnome-text-editor/new_file.pm @@ -9,7 +9,7 @@ use utils; sub run { my $self = shift; - + # First we will use key combo to open the new document window. sleep 5; send_key("ctrl-t"); @@ -19,7 +19,7 @@ sub run { type_safely "# My shopping list.\n\n"; type_safely "* **Milk**\n* *Apples*\n* `Bananas`\n* Bread\n* Butter\n* Cheese\n\n"; type_safely "Happy shopping."; - + # Switch on Markdown Highlighting. assert_and_click("gte_settings_button"); assert_and_click "gte_select_highlighting"; @@ -37,14 +37,14 @@ sub run { type_very_safely "list.md"; send_key("ret"); # Check that the file has been created - $self->root_console(tty=>3); + $self->root_console(tty => 3); assert_script_run "ls /home/test/list.md"; desktop_vt(); } sub test_flags { - return { milestone => 1 }; + return {milestone => 1}; } 1; diff --git a/tests/applications/gnome-text-editor/show_help.pm b/tests/applications/gnome-text-editor/show_help.pm index 90eb0c74..a38ee85c 100644 --- a/tests/applications/gnome-text-editor/show_help.pm +++ b/tests/applications/gnome-text-editor/show_help.pm @@ -7,7 +7,7 @@ use utils; sub run { my $self = shift; - + # Open Help. send_key("f1"); assert_screen "gte_help_shown"; @@ -24,7 +24,7 @@ sub run { sub test_flags { - return { always_rollback => 1 }; + return {always_rollback => 1}; } 1; diff --git a/tests/applications/gnome-text-editor/show_shortcuts.pm b/tests/applications/gnome-text-editor/show_shortcuts.pm index de67d028..c346855d 100644 --- a/tests/applications/gnome-text-editor/show_shortcuts.pm +++ b/tests/applications/gnome-text-editor/show_shortcuts.pm @@ -23,7 +23,7 @@ sub run { sub test_flags { - return { always_rollback => 1 }; + return {always_rollback => 1}; } 1; diff --git a/tests/applications/gnome-text-editor/skins.pm b/tests/applications/gnome-text-editor/skins.pm index dc6ac334..c6d80532 100644 --- a/tests/applications/gnome-text-editor/skins.pm +++ b/tests/applications/gnome-text-editor/skins.pm @@ -7,7 +7,7 @@ use utils; sub run { my $self = shift; - + # Check that dark style can be used. assert_and_click("gnome_burger_menu"); assert_and_click("gte_change_to_dark"); @@ -66,7 +66,7 @@ sub run { sub test_flags { - return { always_rollback => 1 }; + return {always_rollback => 1}; } 1; diff --git a/tests/applications/help/help.pm b/tests/applications/help/help.pm index cd1213a1..d9961c37 100644 --- a/tests/applications/help/help.pm +++ b/tests/applications/help/help.pm @@ -8,31 +8,31 @@ use utils; # This subroutine opens a section, checks that its content # is listed and returns to the main page. sub visit_section { - my $section = shift; - send_key_until_needlematch("help_section_$section", "down", 40, 1 ); - click_lastmatch(); - assert_screen("help_section_content_$section"); - assert_and_click("help_breadcrumbs_home"); - assert_screen("help_main_screen"); + my $section = shift; + send_key_until_needlematch("help_section_$section", "down", 40, 1); + click_lastmatch(); + assert_screen("help_section_content_$section"); + assert_and_click("help_breadcrumbs_home"); + assert_screen("help_main_screen"); } sub run { my $self = shift; - # Run the application - menu_launch_type("Help"); - assert_screen("help_main_screen", timeout => 60); + # Run the application + menu_launch_type("Help"); + assert_screen("help_main_screen", timeout => 60); - # Let us click on Section to open it and check that there is content inside. - visit_section("desktop"); - visit_section("networking"); - visit_section("sound"); - visit_section("files"); - visit_section("user"); - visit_section("hardware"); - visit_section("accessibility"); - visit_section("tipstricks"); - visit_section("morehelp"); + # Let us click on Section to open it and check that there is content inside. + visit_section("desktop"); + visit_section("networking"); + visit_section("sound"); + visit_section("files"); + visit_section("user"); + visit_section("hardware"); + visit_section("accessibility"); + visit_section("tipstricks"); + visit_section("morehelp"); } sub test_flags { diff --git a/tests/applications/nautilus/aaa_setup.pm b/tests/applications/nautilus/aaa_setup.pm index bcfa77d5..4bf82fb2 100644 --- a/tests/applications/nautilus/aaa_setup.pm +++ b/tests/applications/nautilus/aaa_setup.pm @@ -3,14 +3,14 @@ use strict; use testapi; use utils; -# This script will download the test files, start Nautilus, +# This script will download the test files, start Nautilus, # stretch it all over the screen and upload the status to # set a milestone as a starting point for the other Nautilus tests. sub run { my $self = shift; # Switch to console - $self->root_console(tty=>3); + $self->root_console(tty => 3); # Perform git test check_and_install_git(); # Download the test data @@ -26,10 +26,10 @@ sub run { # Start the application menu_launch_type("nautilus"); wait_still_screen("2"); - + # Fullsize the Nautilus window. wait_screen_change { send_key("super-up"); }; - + # Check that is started assert_screen 'apps_run_files'; diff --git a/tests/applications/nautilus/about.pm b/tests/applications/nautilus/about.pm index 58f13147..5ccb031e 100644 --- a/tests/applications/nautilus/about.pm +++ b/tests/applications/nautilus/about.pm @@ -7,20 +7,20 @@ use utils; sub run { my $self = shift; - + # Open the menu by clicking on the Burger icon assert_and_click("gnome_burger_menu", button => "left", timeout => 30); wait_still_screen 2; - + # In the menu, click on the About item. assert_and_click("nautilus_menu_about", button => "left", timeout => 30); - + # Check that the About section has been displayed. assert_screen("nautilus_about_show"); - + # Click on Credits button to see the second part of the dialogue. assert_and_click("nautilus_about_credits", button => "left", timeout => 30); - + # Check that Credits are accessible and visible, too. assert_screen("nautilus_credits_shown"); } diff --git a/tests/applications/nautilus/copy_file.pm b/tests/applications/nautilus/copy_file.pm index f0381485..995b69c1 100644 --- a/tests/applications/nautilus/copy_file.pm +++ b/tests/applications/nautilus/copy_file.pm @@ -7,38 +7,38 @@ use utils; sub run { my $self = shift; - - # Enter the Documents directory to get to the test data. + + # Enter the Documents directory to get to the test data. assert_and_click("nautilus_directory_documents"); - + # Click onto a file to select it. assert_and_click("nautilus_test_file"); wait_still_screen(2); - + # Press the keyboard shortcut to copy the file send_key("ctrl-c"); - + # Select a different location to place the file. assert_and_click("nautilus_directory_downloads"); wait_still_screen(2); # Assert that we have entered the correct directory. assert_screen("nautilus_directory_reached_downloads"); - + # Put the file in the new location send_key("ctrl-v"); - + # Check that the file has appeared. assert_screen("nautilus_test_file"); - + # Go into the root console and verify the operation in the background. - $self->root_console(tty=>3); - + $self->root_console(tty => 3); + # Verify that the new file exists in original location. assert_script_run("ls /home/test/Documents/markdown.md", timeout => '60', fail_message => 'The test file was incorrectly removed from the old location.', quiet => '0'); # And also in the new location. assert_script_run("ls /home/test/Downloads/markdown.md", timeout => '60', fail_message => 'The test file has not been found in the new location.', quiet => '0'); - + } sub test_flags { diff --git a/tests/applications/nautilus/create_directory.pm b/tests/applications/nautilus/create_directory.pm index c897cbc9..0e8f3415 100644 --- a/tests/applications/nautilus/create_directory.pm +++ b/tests/applications/nautilus/create_directory.pm @@ -6,30 +6,30 @@ use utils; # Create a new directory. sub run { -my $self = shift; + my $self = shift; - # Enter the Documents directory to get to the test data. + # Enter the Documents directory to get to the test data. assert_and_click("nautilus_directory_documents"); wait_still_screen(2); - + # Click on the Burger menu to open it assert_and_click("gnome_kebab_menu"); wait_still_screen(2); - + # Click on the Create directory icon to create a new directory. assert_and_click("nautilus_menu_new_directory"); wait_still_screen(2); - + # Type in the new name type_safely("new_directory"); send_key("ret"); - + # Confirm that the directory has appeared in the tree assert_screen("nautilus_new_directory_check"); - + # Go into the root console and verify the operation in the background. - $self->root_console(tty=>3); - + $self->root_console(tty => 3); + # Check that the directory can be listed. assert_script_run("ls /home/test/Documents/new_directory", fail_message => "The expected directory does not exist."); # Check that it indeed is a directory and that it is user writable and executable. diff --git a/tests/applications/nautilus/delete_file.pm b/tests/applications/nautilus/delete_file.pm index 7dc75b82..d588f03c 100644 --- a/tests/applications/nautilus/delete_file.pm +++ b/tests/applications/nautilus/delete_file.pm @@ -8,62 +8,62 @@ use utils; sub run { my $self = shift; - # Enter the Documents directory to get to the test data. + # Enter the Documents directory to get to the test data. assert_and_click("nautilus_directory_documents"); - + # Click onto a file to select it. assert_and_click("nautilus_test_file"); - + # Press the keyboard shortcut to delete the file and wait until file disappears send_key("delete"); wait_still_screen(1); - + # Now, find the confirmation and click on Undo to return the operation. assert_and_click("nautilus_delete_undo"); - + # Check that the file is still in its location. assert_and_click("nautilus_test_file"); wait_still_screen(2); - + # Delete the file again and this time, let time pass for the confirmation dialogue # to disappear. send_key("delete"); sleep(10); - + # Select another file and delete it. assert_and_click("nautilus_test_file_another"); wait_still_screen(2); send_key("delete"); sleep(10); - + # Navigate to the Wastebin and check that the file appeared there. assert_and_click("nautilus_select_wastebin"); - + # Confirm that Wastebin is active assert_screen("nautilus_confirm_wastebin"); - + # Check that the files are now located here. assert_screen("nautilus_test_file"); assert_screen("nautilus_test_file_another"); - + # Select the first file and restore it from the Bin. assert_and_click("nautilus_test_file"); wait_still_screen(2); assert_and_click("nautilus_restore_content"); - + # Go to the Documents again and check that the file reappeared there. assert_and_click("nautilus_directory_documents"); wait_still_screen(2); assert_screen("nautilus_test_file"); - + # Go into the root console and verify the operation in the background. - $self->root_console(tty=>3); - + $self->root_console(tty => 3); + # Verify that the first file still exists in the location as it was restored from the bin. assert_script_run("ls /home/test/Documents/markdown.md", timeout => '60', fail_message => 'The file has not been found in the location.', quiet => '0'); - + # Verify that the next file has been deleted from the original location - assert_script_run("! ls /home/test/Documents/konkurz.md"); + assert_script_run("! ls /home/test/Documents/konkurz.md"); } sub test_flags { diff --git a/tests/applications/nautilus/help.pm b/tests/applications/nautilus/help.pm index 86c40a7d..8098c8f1 100644 --- a/tests/applications/nautilus/help.pm +++ b/tests/applications/nautilus/help.pm @@ -7,29 +7,29 @@ use utils; sub run { my $self = shift; - + # Open help. send_key("f1"); wait_still_screen 2; - + # Check that Help has been shown. assert_screen("nautilus_help_shown"); - + # Open one of the topics. assert_and_click("nautilus_help_browse_files"); - + # Check that a correct topic has been opened. assert_screen("nautilus_browse_shown"); - + # Find a subtopic and open it links assert_and_click("nautilus_help_search_file"); - + # Check that it opened assert_screen("nautilus_search_file_shown"); } sub test_flags { - return {always_rollback => 1}; + return {always_rollback => 1}; } 1; diff --git a/tests/applications/nautilus/hidden_files.pm b/tests/applications/nautilus/hidden_files.pm index 0cb15e60..fb979f5a 100644 --- a/tests/applications/nautilus/hidden_files.pm +++ b/tests/applications/nautilus/hidden_files.pm @@ -6,56 +6,56 @@ use utils; # Show and unshow hidden files. sub run { - my $self = shift; - - # Enter the Documents directory. - assert_and_click("nautilus_directory_documents", timeout => '30', button => 'left', mousehide => '1'); - - # Check that we are in the Documents directory. - assert_screen("nautilus_documents_active", timeout => '30', no_wait => '0'); - - # Check if the hidden files are set to shown. If so, let's remember this status quo for further testing. - my $hidden_a = 0; - my $hidden_b = 0; - - # Set the a variable to 1, if the hidden files are shown. - if (check_screen("nautilus_hidden_file_shown")) { - $hidden_a = 1; - } - - # Now toggle the status of the invisible files and check that it is changed now - # using the keyboard shortcut. - send_key("ctrl-h"); - wait_still_screen(2); - - # Now let us check again, if the invisible file is seen. - if (check_screen("nautilus_hidden_file_shown")) { - $hidden_b = 1; - } - - # Compare the results. They should differ from each other. - if ($hidden_a == $hidden_b) { - die("The ctrl-h keyboard shortcut should have changed the status of invisible files, but the status has not been changed which indicates that the shortcut might not have worked correctly."); - } - - # Now use the menu to change the status of the invisible files. - assert_and_click("gnome_burger_menu"); - wait_still_screen(2); - assert_and_click("nautilus_toggle_hidden_files", timeout => '30', button => 'left', mousehide => '1'); - wait_still_screen(2); - - # Check the current status of the invisible files. - if (check_screen("nautilus_hidden_file_shown")) { - $hidden_b = 1; - } - else { - $hidden_b = 0; - } - - # Compare the results. They should be the same if everything up til now has worked correctly. - if ($hidden_a != $hidden_b) { - die("The menu item 'Show hidden files' should have changed the status of the invisible files, but the status has not changed which indicates that the menu item might not have worked correctly."); - } + my $self = shift; + + # Enter the Documents directory. + assert_and_click("nautilus_directory_documents", timeout => '30', button => 'left', mousehide => '1'); + + # Check that we are in the Documents directory. + assert_screen("nautilus_documents_active", timeout => '30', no_wait => '0'); + + # Check if the hidden files are set to shown. If so, let's remember this status quo for further testing. + my $hidden_a = 0; + my $hidden_b = 0; + + # Set the a variable to 1, if the hidden files are shown. + if (check_screen("nautilus_hidden_file_shown")) { + $hidden_a = 1; + } + + # Now toggle the status of the invisible files and check that it is changed now + # using the keyboard shortcut. + send_key("ctrl-h"); + wait_still_screen(2); + + # Now let us check again, if the invisible file is seen. + if (check_screen("nautilus_hidden_file_shown")) { + $hidden_b = 1; + } + + # Compare the results. They should differ from each other. + if ($hidden_a == $hidden_b) { + die("The ctrl-h keyboard shortcut should have changed the status of invisible files, but the status has not been changed which indicates that the shortcut might not have worked correctly."); + } + + # Now use the menu to change the status of the invisible files. + assert_and_click("gnome_burger_menu"); + wait_still_screen(2); + assert_and_click("nautilus_toggle_hidden_files", timeout => '30', button => 'left', mousehide => '1'); + wait_still_screen(2); + + # Check the current status of the invisible files. + if (check_screen("nautilus_hidden_file_shown")) { + $hidden_b = 1; + } + else { + $hidden_b = 0; + } + + # Compare the results. They should be the same if everything up til now has worked correctly. + if ($hidden_a != $hidden_b) { + die("The menu item 'Show hidden files' should have changed the status of the invisible files, but the status has not changed which indicates that the menu item might not have worked correctly."); + } } sub test_flags { diff --git a/tests/applications/nautilus/keyboard_shortcuts.pm b/tests/applications/nautilus/keyboard_shortcuts.pm index a156d642..1fae4a4c 100644 --- a/tests/applications/nautilus/keyboard_shortcuts.pm +++ b/tests/applications/nautilus/keyboard_shortcuts.pm @@ -7,25 +7,25 @@ use utils; sub run { my $self = shift; - + assert_and_click("gnome_burger_menu"); wait_still_screen(2); - + assert_and_click("nautilus_menu_shortcuts"); wait_still_screen(2); - + assert_screen("nautilus_shortcuts_first"); - + send_key("right"); send_key("ret"); wait_still_screen(2); - + assert_screen("nautilus_shortcuts_second"); - + send_key("right"); send_key("ret"); wait_still_screen(2); - + assert_screen("nautilus_shortcuts_third"); } diff --git a/tests/applications/nautilus/move_file.pm b/tests/applications/nautilus/move_file.pm index 87a3bc4b..28525238 100644 --- a/tests/applications/nautilus/move_file.pm +++ b/tests/applications/nautilus/move_file.pm @@ -7,38 +7,38 @@ use utils; sub run { my $self = shift; - - # Enter the Documents directory to get to the test data. + + # Enter the Documents directory to get to the test data. assert_and_click("nautilus_directory_documents"); - + # Click onto a file to select it. assert_and_click("nautilus_test_file"); wait_still_screen(2); - + # Press the keyboard shortcut to cut the file send_key("ctrl-x"); - + # Select a different location to place the file. assert_and_click("nautilus_directory_downloads"); wait_still_screen(2); # Check that we have entered the Downloads directory assert_screen("nautilus_directory_reached_downloads"); - + # Put the file in the new location send_key("ctrl-v"); - + # Check that the file has appeared. assert_screen("nautilus_test_file"); - + # Go into the root console and verify the operation in the background. - $self->root_console(tty=>3); - + $self->root_console(tty => 3); + # Verify that the new file does not exist in the original location. assert_script_run("! ls /home/test/Documents/markdown.md", fail_message => 'The test file still exists in the original location, but it should have been removed.'); # And that it exists in the new location. assert_script_run("ls /home/test/Downloads/markdown.md", fail_message => 'The test file has not been found in the expected location when it should have been copied there.', quiet => '0'); - + } sub test_flags { diff --git a/tests/applications/nautilus/move_file_into.pm b/tests/applications/nautilus/move_file_into.pm index e49d9a8e..2769bcb4 100644 --- a/tests/applications/nautilus/move_file_into.pm +++ b/tests/applications/nautilus/move_file_into.pm @@ -8,7 +8,7 @@ use utils; sub run { my $self = shift; - # Enter the Documents directory to get to the test data. + # Enter the Documents directory to get to the test data. assert_and_click("nautilus_directory_documents"); # Right click onto a file to select it and open the context menu @@ -42,7 +42,7 @@ sub run { assert_and_click("gnome_select_button"); # Go into the root console and verify the operation in the background. - $self->root_console(tty=>3); + $self->root_console(tty => 3); # Verify that the new file does not exist in the original location. assert_script_run("! ls /home/test/Documents/markdown.md", fail_message => 'The test file has not been deleted from its original location.'); diff --git a/tests/applications/nautilus/new_instance.pm b/tests/applications/nautilus/new_instance.pm index a18000d4..40dbc093 100644 --- a/tests/applications/nautilus/new_instance.pm +++ b/tests/applications/nautilus/new_instance.pm @@ -7,25 +7,25 @@ use utils; sub run { my $self = shift; - - # Enter the Documents directory to get to the test data. + + # Enter the Documents directory to get to the test data. assert_and_click("nautilus_directory_documents"); - + # Click on the Burger menu to open it assert_and_click("gnome_burger_menu"); wait_still_screen(2); - + # Click on the new instance icon to create a new instance of Nautilus. assert_and_click("nautilus_menu_new_instance"); wait_still_screen(2); - + # Hit the Meta key to switch to the activities mode for further check. send_key("super"); wait_still_screen(2); - + # Confirm that two Nautilus windows exist in the view. assert_screen("nautilus_instances_check"); - + } sub test_flags { diff --git a/tests/applications/nautilus/open_new_tab.pm b/tests/applications/nautilus/open_new_tab.pm index 63eb0700..36bdf36f 100644 --- a/tests/applications/nautilus/open_new_tab.pm +++ b/tests/applications/nautilus/open_new_tab.pm @@ -7,26 +7,26 @@ use utils; sub run { my $self = shift; - - # Enter the Documents directory to get to the test data. + + # Enter the Documents directory to get to the test data. assert_and_click("nautilus_directory_documents"); - + # Click on the Burger menu to open it assert_and_click("gnome_burger_menu"); wait_still_screen(2); - + # Click on the New tab to start a new tab of Nautilus. assert_and_click("nautilus_menu_new_tab"); wait_still_screen(2); - + # The new tab will open in the same directory, so let us choose # another directory to be able to compare in the needle. assert_and_click("nautilus_directory_videos"); wait_still_screen(2); - + # Confirm that two tabs exists with Documents and Video locations. assert_screen("nautilus_tabs_check"); - + } sub test_flags { diff --git a/tests/applications/nautilus/permissions.pm b/tests/applications/nautilus/permissions.pm index ccf9e50b..2ff0914f 100644 --- a/tests/applications/nautilus/permissions.pm +++ b/tests/applications/nautilus/permissions.pm @@ -7,18 +7,18 @@ use utils; sub run { my $self = shift; - - # Enter the Documents directory to get to the test data. + + # Enter the Documents directory to get to the test data. assert_and_click("nautilus_directory_documents"); - + # Rigth click onto a file to open context menu. assert_and_click("nautilus_test_file", button => "right"); wait_still_screen(2); - + # Click on the Properties menu item assert_and_click("nautilus_context_properties"); wait_still_screen(2); - + # Check that the Properties window has appeared and close it. assert_screen("nautilus_properties_check"); send_key("esc"); @@ -29,31 +29,31 @@ sub run { # Send a key combination to open the Properties again. send_key("ctrl-i"); - + # Check that the Properties window has appeared again. assert_screen("nautilus_properties_check"); - + # Click on the Permissions tab assert_and_click("nautilus_select_permissions"); - + # Check that the owner can read and write the file assert_screen("nautilus_owner_permissions"); - + # Check that others cannot do anything. assert_screen("nautilus_others_permissions"); - + # Set the permission for others to None assert_and_click("nautilus_permissions_read_only"); - + # Click on Read Only to select it. assert_and_click("nautilus_permissions_set_none"); - + # Close the Properties send_key("esc"); - + # Go into the root console and verify the operation in the background. - $self->root_console(tty=>3); - + $self->root_console(tty => 3); + # Check that the permissions have been changed. validate_script_output("ls -l /home/test/Documents/markdown.md", sub { m/-rw-r-----/ }); diff --git a/tests/applications/nautilus/rename_file.pm b/tests/applications/nautilus/rename_file.pm index 33ff1392..3416de03 100644 --- a/tests/applications/nautilus/rename_file.pm +++ b/tests/applications/nautilus/rename_file.pm @@ -7,32 +7,32 @@ use utils; sub run { my $self = shift; - - # Enter the Documents directory to get to the test data. + + # Enter the Documents directory to get to the test data. assert_and_click("nautilus_directory_documents"); - + # Click onto a file to select it. assert_and_click("nautilus_test_file"); - + # Press the keyboard shortcut to rename the file send_key("f2"); - + # Check that a rename dialogue has been displayed. assert_screen("nautilus_rename_dialogue"); - + # Type a new name and confirm it. type_very_safely("renamed"); send_key("ret"); - + # Check that the file has been renamed. assert_screen("nautilus_rename_check"); - + # Go into the root console and verify the operation in the background. - $self->root_console(tty=>3); - + $self->root_console(tty => 3); + # Verify that the new file exists in the location. assert_script_run("ls /home/test/Documents/renamed.md", timeout => '60', fail_message => 'The renamed file has not been found in the location.', quiet => '0'); - + } sub test_flags { diff --git a/tests/applications/nautilus/side_panel.pm b/tests/applications/nautilus/side_panel.pm index 709ccd7a..fe438ea4 100644 --- a/tests/applications/nautilus/side_panel.pm +++ b/tests/applications/nautilus/side_panel.pm @@ -7,49 +7,49 @@ use utils; sub run { my $self = shift; - - # It seems that the following checks run so quickly that the tested + + # It seems that the following checks run so quickly that the tested # virtual machine is unable to properly reload from the previous test # and it keeps failing. # Let's give it some time to settle. sleep(5); - + my $side_panel = 0; if (check_screen("nautilus_side_panel")) { - $side_panel = 1; + $side_panel = 1; } - + # Switch off the side panel send_key("f9"); wait_still_screen(2); - + # Recheck if side panel is visible my $off_panel = 0; if (check_screen("nautilus_side_panel")) { $off_panel = 1; } - + # Compare the results, they should be different. if ($off_panel == $side_panel) { - die("The side panel visibility should have been toggled and it is not. That indicates that the keyboard shortcut to toggle it does not work properly."); + die("The side panel visibility should have been toggled and it is not. That indicates that the keyboard shortcut to toggle it does not work properly."); } - + # Use menu to toggle the side panel back. assert_and_click("gnome_burger_menu"); wait_still_screen(2); assert_and_click("nautilus_show_sidebar"); wait_still_screen(2); - + # Recheck if side panel is visible if (check_screen("nautilus_side_panel")) { $off_panel = 1; } - + # Compare the results. If everything has been ok until now, the values should not be different. if ($off_panel != $side_panel) { - die("The side panel visibility should have been toggled back, but it has not been. That indicates that the menu item to toggle it does not work properly."); + die("The side panel visibility should have been toggled back, but it has not been. That indicates that the menu item to toggle it does not work properly."); } - + } sub test_flags { diff --git a/tests/applications/nautilus/star_file.pm b/tests/applications/nautilus/star_file.pm index 711bc185..8878b185 100644 --- a/tests/applications/nautilus/star_file.pm +++ b/tests/applications/nautilus/star_file.pm @@ -7,28 +7,28 @@ use utils; sub run { my $self = shift; - - # Enter the Documents directory to get to the test data. + + # Enter the Documents directory to get to the test data. assert_and_click("nautilus_directory_documents"); - + # Right click onto a file to select it to see the # context menu. assert_and_click("nautilus_test_file", button => "right"); wait_still_screen(2); - + # Click to Star it. assert_and_click("nautilus_context_star"); - + # Check that a star gets solid on the right part of the selected file assert_screen("nautilus_star_confirm"); - + # Click on Starred to see all the starred files in a new view. assert_and_click("nautilus_directory_starred"); wait_still_screen(2); - + # Check that the view switched to Starred assert_screen("nautilus_starred_selected"); - + # Check that the file has appeared. assert_screen("nautilus_test_file"); } diff --git a/tests/apps_gnome_preset.pm b/tests/apps_gnome_preset.pm index 8767781d..ae6c4d6e 100644 --- a/tests/apps_gnome_preset.pm +++ b/tests/apps_gnome_preset.pm @@ -12,11 +12,11 @@ sub run { solidify_wallpaper; } -# If this test fails, the others will probably start failing too, +# If this test fails, the others will probably start failing too, # so there is no need to continue. # Also, when subsequent tests fail, the suite will revert to this state for further testing. sub test_flags { - return { fatal => 1, milestone => 1 }; + return {fatal => 1, milestone => 1}; } 1; diff --git a/tests/apps_startstop/gnome/abrt.pm b/tests/apps_startstop/gnome/abrt.pm index c795e340..91c34e95 100644 --- a/tests/apps_startstop/gnome/abrt.pm +++ b/tests/apps_startstop/gnome/abrt.pm @@ -7,7 +7,7 @@ use utils; sub run { my $self = shift; - + # Start the application start_with_launcher('apps_menu_abrt', 'apps_menu_utilities'); # Check that it is started diff --git a/tests/apps_startstop/gnome/calculator.pm b/tests/apps_startstop/gnome/calculator.pm index 0d673828..c411c287 100644 --- a/tests/apps_startstop/gnome/calculator.pm +++ b/tests/apps_startstop/gnome/calculator.pm @@ -7,7 +7,7 @@ use utils; sub run { my $self = shift; - + # Start the application start_with_launcher('apps_menu_calculator'); # Check that it is started diff --git a/tests/apps_startstop/gnome/calendar.pm b/tests/apps_startstop/gnome/calendar.pm index 3748453e..77ade6ff 100644 --- a/tests/apps_startstop/gnome/calendar.pm +++ b/tests/apps_startstop/gnome/calendar.pm @@ -7,10 +7,10 @@ use utils; sub run { my $self = shift; - + # Start the application start_with_launcher('apps_menu_calendar'); - + # give access to location if the vm asks for it if (check_screen('apps_run_access', 1)) { assert_and_click 'apps_run_access'; @@ -21,7 +21,7 @@ sub run { register_application("gnome-calendar"); # close the application quit_with_shortcut(); - + } sub test_flags { diff --git a/tests/apps_startstop/gnome/chars.pm b/tests/apps_startstop/gnome/chars.pm index 1c24fee2..a3ca6c29 100644 --- a/tests/apps_startstop/gnome/chars.pm +++ b/tests/apps_startstop/gnome/chars.pm @@ -7,7 +7,7 @@ use utils; sub run { my $self = shift; - + # Start the application start_with_launcher('apps_menu_chars', 'apps_menu_utilities'); # Check that is started @@ -16,7 +16,7 @@ sub run { register_application("gnome-characters"); # Close the application quit_with_shortcut(); - + } sub test_flags { diff --git a/tests/apps_startstop/gnome/cheese.pm b/tests/apps_startstop/gnome/cheese.pm index 9e776785..252d125b 100644 --- a/tests/apps_startstop/gnome/cheese.pm +++ b/tests/apps_startstop/gnome/cheese.pm @@ -7,7 +7,7 @@ use utils; sub run { my $self = shift; - + # Start the application start_with_launcher('apps_menu_cheese'); # Check that is started diff --git a/tests/apps_startstop/gnome/clocks.pm b/tests/apps_startstop/gnome/clocks.pm index e3250332..9d157dd5 100644 --- a/tests/apps_startstop/gnome/clocks.pm +++ b/tests/apps_startstop/gnome/clocks.pm @@ -19,7 +19,7 @@ sub run { register_application("gnome-clocks"); # close the application quit_with_shortcut(); - + } sub test_flags { diff --git a/tests/apps_startstop/gnome/diskusage.pm b/tests/apps_startstop/gnome/diskusage.pm index 27c4aaf0..8c169b98 100644 --- a/tests/apps_startstop/gnome/diskusage.pm +++ b/tests/apps_startstop/gnome/diskusage.pm @@ -7,7 +7,7 @@ use utils; sub run { my $self = shift; - + # Start the application start_with_launcher('apps_menu_diskusage', 'apps_menu_utilities'); # Check that is started diff --git a/tests/apps_startstop/gnome/files.pm b/tests/apps_startstop/gnome/files.pm index 21d04296..8b9d51a3 100644 --- a/tests/apps_startstop/gnome/files.pm +++ b/tests/apps_startstop/gnome/files.pm @@ -3,7 +3,7 @@ use strict; use testapi; use utils; -# This tests if Files starts +# This tests if Files starts sub run { my $self = shift; @@ -15,7 +15,7 @@ sub run { register_application("nautilus"); # Close the application quit_with_shortcut(); - + } sub test_flags { diff --git a/tests/apps_startstop/gnome/fonts.pm b/tests/apps_startstop/gnome/fonts.pm index bb265030..8990a7cd 100644 --- a/tests/apps_startstop/gnome/fonts.pm +++ b/tests/apps_startstop/gnome/fonts.pm @@ -7,7 +7,7 @@ use utils; sub run { my $self = shift; - + # Start the application start_with_launcher('apps_menu_fonts', 'apps_menu_utilities'); # Check that is started diff --git a/tests/apps_startstop/gnome/imageviewer.pm b/tests/apps_startstop/gnome/imageviewer.pm index eda72e6e..b1506961 100644 --- a/tests/apps_startstop/gnome/imageviewer.pm +++ b/tests/apps_startstop/gnome/imageviewer.pm @@ -7,7 +7,7 @@ use utils; sub run { my $self = shift; - + # Start the application start_with_launcher('apps_menu_imageviewer', 'apps_menu_utilities'); # Check that is started diff --git a/tests/apps_startstop/gnome/lcalc.pm b/tests/apps_startstop/gnome/lcalc.pm index 0fd64d7c..9f1b5617 100644 --- a/tests/apps_startstop/gnome/lcalc.pm +++ b/tests/apps_startstop/gnome/lcalc.pm @@ -7,7 +7,7 @@ use utils; sub run { my $self = shift; - + # Start the application start_with_launcher('apps_menu_lcalc'); # Check that is started diff --git a/tests/apps_startstop/gnome/logs.pm b/tests/apps_startstop/gnome/logs.pm index 49745796..f2769854 100644 --- a/tests/apps_startstop/gnome/logs.pm +++ b/tests/apps_startstop/gnome/logs.pm @@ -7,7 +7,7 @@ use utils; sub run { my $self = shift; - + # Start the application start_with_launcher('apps_menu_logs', 'apps_menu_utilities'); # Check that is started diff --git a/tests/apps_startstop/gnome/maps.pm b/tests/apps_startstop/gnome/maps.pm index d751de6e..3bb8c6b7 100644 --- a/tests/apps_startstop/gnome/maps.pm +++ b/tests/apps_startstop/gnome/maps.pm @@ -7,7 +7,7 @@ use utils; sub run { my $self = shift; - + # Start the application start_with_launcher('apps_menu_maps'); # Check that is started @@ -20,7 +20,7 @@ sub run { register_application("gnome-maps"); # Close the application quit_with_shortcut(); - + } sub test_flags { diff --git a/tests/apps_startstop/gnome/monitor.pm b/tests/apps_startstop/gnome/monitor.pm index 73cfa0ab..9cf0ae13 100644 --- a/tests/apps_startstop/gnome/monitor.pm +++ b/tests/apps_startstop/gnome/monitor.pm @@ -7,7 +7,7 @@ use utils; sub run { my $self = shift; - + # Start the application start_with_launcher('apps_menu_monitor'); # Check that is started diff --git a/tests/apps_startstop/gnome/photos.pm b/tests/apps_startstop/gnome/photos.pm index 4a7d4b6b..228a8461 100644 --- a/tests/apps_startstop/gnome/photos.pm +++ b/tests/apps_startstop/gnome/photos.pm @@ -7,7 +7,7 @@ use utils; sub run { my $self = shift; - + # Start the application start_with_launcher('apps_menu_photos'); # Check that is started diff --git a/tests/apps_startstop/gnome/rhythmbox.pm b/tests/apps_startstop/gnome/rhythmbox.pm index 31c7675b..4deec4d7 100644 --- a/tests/apps_startstop/gnome/rhythmbox.pm +++ b/tests/apps_startstop/gnome/rhythmbox.pm @@ -7,12 +7,12 @@ use utils; sub run { my $self = shift; - + # Start the application start_with_launcher('apps_menu_rhythmbox'); # To give the screen a bit of time. wait_still_screen(2); - # On June 15th, 2022, we realized that Rhythmbox tends to + # On June 15th, 2022, we realized that Rhythmbox tends to # crash on fresh installation when run for the first time. # When this happens, softfail and try to start it again. unless (check_screen("apps_run_rhythmbox")) { diff --git a/tests/apps_startstop/gnome/scan.pm b/tests/apps_startstop/gnome/scan.pm index f8b38c0f..2bf17791 100644 --- a/tests/apps_startstop/gnome/scan.pm +++ b/tests/apps_startstop/gnome/scan.pm @@ -7,7 +7,7 @@ use utils; sub run { my $self = shift; - + # Start the application start_with_launcher('apps_menu_scan'); # Check that is started @@ -16,7 +16,7 @@ sub run { register_application("simple-scan"); # Close the application quit_with_shortcut(); - + } sub test_flags { diff --git a/tests/apps_startstop/gnome/settings.pm b/tests/apps_startstop/gnome/settings.pm index f78679b1..e16ab3f2 100644 --- a/tests/apps_startstop/gnome/settings.pm +++ b/tests/apps_startstop/gnome/settings.pm @@ -13,7 +13,7 @@ sub run { # select Background menu item assert_and_click 'apps_settings_menu_background'; wait_still_screen 5; - + # close the application send_key 'alt-f4'; wait_still_screen 5; @@ -22,7 +22,7 @@ sub run { assert_screen 'workspace'; # Register application register_application("gnome-control-center"); - + } sub test_flags { diff --git a/tests/apps_startstop/gnome/software.pm b/tests/apps_startstop/gnome/software.pm index 2e6471b6..73a9b8aa 100644 --- a/tests/apps_startstop/gnome/software.pm +++ b/tests/apps_startstop/gnome/software.pm @@ -7,11 +7,11 @@ use utils; sub run { my $self = shift; - + # Start the application start_with_launcher('apps_menu_software'); - - + + # check if a welcome screen appears, if so, click on it send_key 'ret' if (check_screen('gnome_software_welcome', 10)); assert_screen 'desktop_package_tool_update'; @@ -19,7 +19,7 @@ sub run { register_application("gnome-software"); # Close the application quit_with_shortcut(); - + } sub test_flags { diff --git a/tests/apps_startstop/gnome/terminal.pm b/tests/apps_startstop/gnome/terminal.pm index 328a1cd9..174bffbd 100644 --- a/tests/apps_startstop/gnome/terminal.pm +++ b/tests/apps_startstop/gnome/terminal.pm @@ -18,11 +18,11 @@ sub run { quit_with_shortcut(); } -# If this test fails, the others will probably start failing too, +# If this test fails, the others will probably start failing too, # so there is no need to continue. # Also, when subsequent tests fail, the suite will revert to this state for further testing. sub test_flags { - return { fatal => 1, milestone => 1 }; + return {fatal => 1, milestone => 1}; } 1; diff --git a/tests/apps_startstop/gnome/texteditor.pm b/tests/apps_startstop/gnome/texteditor.pm index 661f695c..40c70f8b 100644 --- a/tests/apps_startstop/gnome/texteditor.pm +++ b/tests/apps_startstop/gnome/texteditor.pm @@ -7,7 +7,7 @@ use utils; sub run { my $self = shift; - + # Start the application start_with_launcher('apps_menu_texteditor'); # Check that is started diff --git a/tests/apps_startstop/gnome/videos.pm b/tests/apps_startstop/gnome/videos.pm index 0f07f634..a1a8d481 100644 --- a/tests/apps_startstop/gnome/videos.pm +++ b/tests/apps_startstop/gnome/videos.pm @@ -7,7 +7,7 @@ use utils; sub run { my $self = shift; - + # Start the application start_with_launcher('apps_menu_videos'); # Check that is started diff --git a/tests/apps_startstop/gnome/weather.pm b/tests/apps_startstop/gnome/weather.pm index c22f7a7e..71f14693 100644 --- a/tests/apps_startstop/gnome/weather.pm +++ b/tests/apps_startstop/gnome/weather.pm @@ -19,7 +19,7 @@ sub run { register_application("gnome-weather"); # close the application quit_with_shortcut(); - + } sub test_flags { diff --git a/tests/apps_startstop/kde/cteditor.pm b/tests/apps_startstop/kde/cteditor.pm index a6b0c7af..52826fc5 100644 --- a/tests/apps_startstop/kde/cteditor.pm +++ b/tests/apps_startstop/kde/cteditor.pm @@ -7,7 +7,7 @@ use utils; sub run { my $self = shift; - + menu_launch_type 'contactthemeeditor'; # Check that it is started assert_screen 'cteditor_runs'; diff --git a/tests/apps_startstop/kde/dbusviewer.pm b/tests/apps_startstop/kde/dbusviewer.pm index f67be00b..a8cf5af7 100644 --- a/tests/apps_startstop/kde/dbusviewer.pm +++ b/tests/apps_startstop/kde/dbusviewer.pm @@ -7,7 +7,7 @@ use utils; sub run { my $self = shift; - + menu_launch_type 'dbusviewer'; # Check that it is started assert_screen 'dbusviewer_runs'; diff --git a/tests/apps_startstop/kde/discover.pm b/tests/apps_startstop/kde/discover.pm index 581fd687..15f3e3a8 100644 --- a/tests/apps_startstop/kde/discover.pm +++ b/tests/apps_startstop/kde/discover.pm @@ -7,7 +7,7 @@ use utils; sub run { my $self = shift; - + # Start the application menu_launch_type 'discover'; # Check that it is started diff --git a/tests/apps_startstop/kde/dnfdragora.pm b/tests/apps_startstop/kde/dnfdragora.pm index 13c6bb38..75a1fe80 100644 --- a/tests/apps_startstop/kde/dnfdragora.pm +++ b/tests/apps_startstop/kde/dnfdragora.pm @@ -7,7 +7,7 @@ use utils; sub run { my $self = shift; - + # Start the application menu_launch_type 'dnfdragora'; # Check that it is started diff --git a/tests/apps_startstop/kde/dolphin.pm b/tests/apps_startstop/kde/dolphin.pm index 9c792931..75df2b79 100644 --- a/tests/apps_startstop/kde/dolphin.pm +++ b/tests/apps_startstop/kde/dolphin.pm @@ -7,7 +7,7 @@ use utils; sub run { my $self = shift; - + # Start the application menu_launch_type 'dolphin'; # Check that it is started diff --git a/tests/apps_startstop/kde/firefox.pm b/tests/apps_startstop/kde/firefox.pm index 12051f9e..62d5145a 100644 --- a/tests/apps_startstop/kde/firefox.pm +++ b/tests/apps_startstop/kde/firefox.pm @@ -7,7 +7,7 @@ use utils; sub run { my $self = shift; - + # Start the application menu_launch_type 'firefox'; # Check that it is started; this needle is from diff --git a/tests/apps_startstop/kde/firewall.pm b/tests/apps_startstop/kde/firewall.pm index 53a50b42..fd92c843 100644 --- a/tests/apps_startstop/kde/firewall.pm +++ b/tests/apps_startstop/kde/firewall.pm @@ -7,14 +7,14 @@ use utils; sub run { my $self = shift; - + # Start the application menu_launch_type 'firewall'; sleep 5; # Firewall requires password to be entered and confirmed to start. # View password assert_screen "auth_required"; - my $password = get_var('ROOT_PASSWORD','weakpassword'); + my $password = get_var('ROOT_PASSWORD', 'weakpassword'); type_very_safely $password; send_key 'ret'; sleep 5; diff --git a/tests/apps_startstop/kde/gwenview.pm b/tests/apps_startstop/kde/gwenview.pm index eb1cb88c..ad8cfa76 100644 --- a/tests/apps_startstop/kde/gwenview.pm +++ b/tests/apps_startstop/kde/gwenview.pm @@ -7,7 +7,7 @@ use utils; sub run { my $self = shift; - + # Start the application menu_launch_type 'gwenview'; # Check that it is started diff --git a/tests/apps_startstop/kde/help.pm b/tests/apps_startstop/kde/help.pm index 5f337c6e..5b2be273 100644 --- a/tests/apps_startstop/kde/help.pm +++ b/tests/apps_startstop/kde/help.pm @@ -7,7 +7,7 @@ use utils; sub run { my $self = shift; - + # Start the application menu_launch_type 'help'; # Check that it is started diff --git a/tests/apps_startstop/kde/infocenter.pm b/tests/apps_startstop/kde/infocenter.pm index a1eebbfb..0b5674b7 100644 --- a/tests/apps_startstop/kde/infocenter.pm +++ b/tests/apps_startstop/kde/infocenter.pm @@ -9,7 +9,7 @@ use utils; sub run { my $self = shift; - + # Start the application menu_launch_type 'info'; # Check that it is started diff --git a/tests/apps_startstop/kde/kaddressbook.pm b/tests/apps_startstop/kde/kaddressbook.pm index 5f5abc68..4a3a21f1 100644 --- a/tests/apps_startstop/kde/kaddressbook.pm +++ b/tests/apps_startstop/kde/kaddressbook.pm @@ -7,7 +7,7 @@ use utils; sub run { my $self = shift; - + # Start the application menu_launch_type 'kaddressbook'; # Check that it is started diff --git a/tests/apps_startstop/kde/kcalc.pm b/tests/apps_startstop/kde/kcalc.pm index 1a8274b1..f9645738 100644 --- a/tests/apps_startstop/kde/kcalc.pm +++ b/tests/apps_startstop/kde/kcalc.pm @@ -7,7 +7,7 @@ use utils; sub run { my $self = shift; - + # Start the application menu_launch_type 'kcalc'; # Check that it is started diff --git a/tests/apps_startstop/kde/kcharselect.pm b/tests/apps_startstop/kde/kcharselect.pm index 69d6b390..578ef855 100644 --- a/tests/apps_startstop/kde/kcharselect.pm +++ b/tests/apps_startstop/kde/kcharselect.pm @@ -7,7 +7,7 @@ use utils; sub run { my $self = shift; - + # Start the application menu_launch_type 'kcharselect'; # Check that it is started diff --git a/tests/apps_startstop/kde/kfind.pm b/tests/apps_startstop/kde/kfind.pm index 9a164c92..f2e3671f 100644 --- a/tests/apps_startstop/kde/kfind.pm +++ b/tests/apps_startstop/kde/kfind.pm @@ -7,7 +7,7 @@ use utils; sub run { my $self = shift; - + # Start the application menu_launch_type 'kfind'; # Check that it is started diff --git a/tests/apps_startstop/kde/kgpg.pm b/tests/apps_startstop/kde/kgpg.pm index 785367c3..43f16389 100644 --- a/tests/apps_startstop/kde/kgpg.pm +++ b/tests/apps_startstop/kde/kgpg.pm @@ -7,7 +7,7 @@ use utils; sub run { my $self = shift; - + # Start the application menu_launch_type 'kgpg'; # Deal with the first wizard screen diff --git a/tests/apps_startstop/kde/kimport.pm b/tests/apps_startstop/kde/kimport.pm index f01a2bcc..fed4f933 100644 --- a/tests/apps_startstop/kde/kimport.pm +++ b/tests/apps_startstop/kde/kimport.pm @@ -7,7 +7,7 @@ use utils; sub run { my $self = shift; - + # Start the application menu_launch_type 'akonadiimportwizard'; # Click ok to go further diff --git a/tests/apps_startstop/kde/kmag.pm b/tests/apps_startstop/kde/kmag.pm index 53ed3d30..5713dd13 100644 --- a/tests/apps_startstop/kde/kmag.pm +++ b/tests/apps_startstop/kde/kmag.pm @@ -7,7 +7,7 @@ use utils; sub run { my $self = shift; - + # Start the application menu_launch_type 'kmag'; # Check that it is started diff --git a/tests/apps_startstop/kde/kmail.pm b/tests/apps_startstop/kde/kmail.pm index 99b50b90..dc808fcd 100644 --- a/tests/apps_startstop/kde/kmail.pm +++ b/tests/apps_startstop/kde/kmail.pm @@ -7,7 +7,7 @@ use utils; sub run { my $self = shift; - + # Start the application menu_launch_type 'kmail'; # Cancel Kmail data wizard diff --git a/tests/apps_startstop/kde/kmail_header.pm b/tests/apps_startstop/kde/kmail_header.pm index fe3c72cb..ad91e78a 100644 --- a/tests/apps_startstop/kde/kmail_header.pm +++ b/tests/apps_startstop/kde/kmail_header.pm @@ -7,7 +7,7 @@ use utils; sub run { my $self = shift; - + # Start the application menu_launch_type 'kmail header'; # Check that the application runs diff --git a/tests/apps_startstop/kde/kmousetool.pm b/tests/apps_startstop/kde/kmousetool.pm index 2a224ea3..bb553eee 100644 --- a/tests/apps_startstop/kde/kmousetool.pm +++ b/tests/apps_startstop/kde/kmousetool.pm @@ -7,7 +7,7 @@ use utils; sub run { my $self = shift; - + # Start the application menu_launch_type 'kmousetool'; # Check that it is started diff --git a/tests/apps_startstop/kde/kmouth.pm b/tests/apps_startstop/kde/kmouth.pm index 415e914e..908fb6e1 100644 --- a/tests/apps_startstop/kde/kmouth.pm +++ b/tests/apps_startstop/kde/kmouth.pm @@ -7,14 +7,14 @@ use utils; sub run { my $self = shift; - + # Start the application menu_launch_type 'kmouth'; sleep 2; # Deal with the welcome screens assert_screen ["kde_next", "kde_finish"]; while (match_has_tag "kde_next") { - assert_and_click "kde_next"; + assert_and_click "kde_next"; sleep 2; assert_screen ["kde_next", "kde_finish"]; } diff --git a/tests/apps_startstop/kde/kolourpaint.pm b/tests/apps_startstop/kde/kolourpaint.pm index 46a1c31c..fd8ec1c4 100644 --- a/tests/apps_startstop/kde/kolourpaint.pm +++ b/tests/apps_startstop/kde/kolourpaint.pm @@ -7,7 +7,7 @@ use utils; sub run { my $self = shift; - + # Start the application menu_launch_type 'kolourpaint'; # Check that it is started diff --git a/tests/apps_startstop/kde/konsole.pm b/tests/apps_startstop/kde/konsole.pm index 66217333..c6c43cd3 100644 --- a/tests/apps_startstop/kde/konsole.pm +++ b/tests/apps_startstop/kde/konsole.pm @@ -7,7 +7,7 @@ use utils; sub run { my $self = shift; - + # Start the application menu_launch_type 'konsole'; # Check that it is started diff --git a/tests/apps_startstop/kde/kontakt.pm b/tests/apps_startstop/kde/kontakt.pm index a012a7e2..5eb63883 100644 --- a/tests/apps_startstop/kde/kontakt.pm +++ b/tests/apps_startstop/kde/kontakt.pm @@ -7,7 +7,7 @@ use utils; sub run { my $self = shift; - + # Start the application menu_launch_type 'kontact'; # Get rid of personal data diff --git a/tests/apps_startstop/kde/konversation.pm b/tests/apps_startstop/kde/konversation.pm index 6c792b7c..86b0757e 100644 --- a/tests/apps_startstop/kde/konversation.pm +++ b/tests/apps_startstop/kde/konversation.pm @@ -7,7 +7,7 @@ use utils; sub run { my $self = shift; - + # Start the application menu_launch_type 'konversation'; # Connect to Freenode diff --git a/tests/apps_startstop/kde/korganizer.pm b/tests/apps_startstop/kde/korganizer.pm index 4b28a94a..00159830 100644 --- a/tests/apps_startstop/kde/korganizer.pm +++ b/tests/apps_startstop/kde/korganizer.pm @@ -7,7 +7,7 @@ use utils; sub run { my $self = shift; - + # Start the application menu_launch_type 'korganizer'; # Check that it is started diff --git a/tests/apps_startstop/kde/kparted.pm b/tests/apps_startstop/kde/kparted.pm index d9f4530a..cacf55fb 100644 --- a/tests/apps_startstop/kde/kparted.pm +++ b/tests/apps_startstop/kde/kparted.pm @@ -7,7 +7,7 @@ use utils; sub run { my $self = shift; - + # Start the application menu_launch_type 'partition editor'; wait_still_screen 2; diff --git a/tests/apps_startstop/kde/krdc.pm b/tests/apps_startstop/kde/krdc.pm index 384e9744..093e987b 100644 --- a/tests/apps_startstop/kde/krdc.pm +++ b/tests/apps_startstop/kde/krdc.pm @@ -7,7 +7,7 @@ use utils; sub run { my $self = shift; - + # Start the application menu_launch_type 'krdc'; # Check that it is started diff --git a/tests/apps_startstop/kde/krfb.pm b/tests/apps_startstop/kde/krfb.pm index 53be8dfb..acc1f7e5 100644 --- a/tests/apps_startstop/kde/krfb.pm +++ b/tests/apps_startstop/kde/krfb.pm @@ -7,7 +7,7 @@ use utils; sub run { my $self = shift; - + # Start the application menu_launch_type 'krfb'; # Check that it is started diff --git a/tests/apps_startstop/kde/ktnef.pm b/tests/apps_startstop/kde/ktnef.pm index 1a4d515e..68509645 100644 --- a/tests/apps_startstop/kde/ktnef.pm +++ b/tests/apps_startstop/kde/ktnef.pm @@ -7,7 +7,7 @@ use utils; sub run { my $self = shift; - + # Start the application menu_launch_type 'ktnef'; # Check that it is started diff --git a/tests/apps_startstop/kde/kwallet.pm b/tests/apps_startstop/kde/kwallet.pm index 077c0e2b..9705427a 100644 --- a/tests/apps_startstop/kde/kwallet.pm +++ b/tests/apps_startstop/kde/kwallet.pm @@ -7,7 +7,7 @@ use utils; sub run { my $self = shift; - + # Start the application menu_launch_type 'kwallet'; # Check that it is started diff --git a/tests/apps_startstop/kde/kwrite.pm b/tests/apps_startstop/kde/kwrite.pm index b3dae688..96930ed2 100644 --- a/tests/apps_startstop/kde/kwrite.pm +++ b/tests/apps_startstop/kde/kwrite.pm @@ -7,7 +7,7 @@ use utils; sub run { my $self = shift; - + # Start the application menu_launch_type 'kwrite'; # Check that it is started diff --git a/tests/apps_startstop/kde/mahjong.pm b/tests/apps_startstop/kde/mahjong.pm index 0911f9fb..bbb7bcbd 100644 --- a/tests/apps_startstop/kde/mahjong.pm +++ b/tests/apps_startstop/kde/mahjong.pm @@ -7,7 +7,7 @@ use utils; sub run { my $self = shift; - + # Start the application menu_launch_type 'kmahjong'; # Check that it is started diff --git a/tests/apps_startstop/kde/mediawriter.pm b/tests/apps_startstop/kde/mediawriter.pm index d00021d5..30849344 100644 --- a/tests/apps_startstop/kde/mediawriter.pm +++ b/tests/apps_startstop/kde/mediawriter.pm @@ -7,7 +7,7 @@ use utils; sub run { my $self = shift; - + # Start the application menu_launch_type 'mediawriter'; # Check that it is started diff --git a/tests/apps_startstop/kde/minesweeper.pm b/tests/apps_startstop/kde/minesweeper.pm index 3c4e6b77..d1614074 100644 --- a/tests/apps_startstop/kde/minesweeper.pm +++ b/tests/apps_startstop/kde/minesweeper.pm @@ -7,7 +7,7 @@ use utils; sub run { my $self = shift; - + # Start the application menu_launch_type 'kmines'; # Check that it is started diff --git a/tests/apps_startstop/kde/patience.pm b/tests/apps_startstop/kde/patience.pm index baa397c7..bd4b2a5d 100644 --- a/tests/apps_startstop/kde/patience.pm +++ b/tests/apps_startstop/kde/patience.pm @@ -7,7 +7,7 @@ use utils; sub run { my $self = shift; - + # Start the application menu_launch_type 'kpatience'; # Check that it is started diff --git a/tests/apps_startstop/kde/pimexporter.pm b/tests/apps_startstop/kde/pimexporter.pm index 46d62682..9fd89d00 100644 --- a/tests/apps_startstop/kde/pimexporter.pm +++ b/tests/apps_startstop/kde/pimexporter.pm @@ -7,7 +7,7 @@ use utils; sub run { my $self = shift; - + # Start the application menu_launch_type 'pim'; # Check that it is started diff --git a/tests/apps_startstop/kde/spectacle.pm b/tests/apps_startstop/kde/spectacle.pm index bbd71c6f..30e6ddc6 100644 --- a/tests/apps_startstop/kde/spectacle.pm +++ b/tests/apps_startstop/kde/spectacle.pm @@ -7,7 +7,7 @@ use utils; sub run { my $self = shift; - + # Start the application menu_launch_type 'spectacle'; # Check that it is started diff --git a/tests/apps_startstop/kde/system_settings.pm b/tests/apps_startstop/kde/system_settings.pm index 3382a556..01850881 100644 --- a/tests/apps_startstop/kde/system_settings.pm +++ b/tests/apps_startstop/kde/system_settings.pm @@ -7,7 +7,7 @@ use utils; sub run { my $self = shift; - + # Start the application menu_launch_type 'system settings'; # Check that it is started diff --git a/tests/apps_startstop/kde/vault.pm b/tests/apps_startstop/kde/vault.pm index 710db390..7fed55e3 100644 --- a/tests/apps_startstop/kde/vault.pm +++ b/tests/apps_startstop/kde/vault.pm @@ -30,7 +30,7 @@ sub run { # Enter the name of the newly created testvault assert_and_click "vault_enter_name"; - + # Then name the vault "testvault" type_very_safely "testvault"; diff --git a/tests/autocloud.pm b/tests/autocloud.pm index 22a90ebf..087c5d2a 100644 --- a/tests/autocloud.pm +++ b/tests/autocloud.pm @@ -23,7 +23,7 @@ sub run { assert_script_run "chmod ugo+w /dev/" . $serialdev; # let's go to another tty and login as regular user send_key "alt-f2"; - console_login(user=>"test", password=>"weakpassword"); + console_login(user => "test", password => "weakpassword"); assert_script_run "curl -O https://fedorapeople.org/groups/qa/tunirtests.tar.gz"; assert_script_run "tar xvf tunirtests.tar.gz"; assert_script_run "sudo python3 -m unittest tunirtests.atomictests.TestAtomic01Status -v"; @@ -45,24 +45,24 @@ sub run { assert_script_run "sudo python3 -m unittest tunirtests.cloudservice.TestServiceDisable -v"; type_string "sudo reboot\n"; boot_to_login_screen(timeout => 180); - console_login(user=>"root", password=>"weakpassword"); + console_login(user => "root", password => "weakpassword"); # we need to use script_run as regular user again assert_script_run "sudo chmod ugo+w /dev/" . $serialdev; # let's go to another tty and login as regular user again send_key "alt-f2"; - console_login(user=>"test", password=>"weakpassword"); + console_login(user => "test", password => "weakpassword"); _soft_fail_run "tunirtests.testreboot.TestReboot"; assert_script_run "sudo python3 -m unittest tunirtests.cloudservice.TestServiceManipulation -v"; # this test only works properly as a regular user _soft_fail_run "tunirtests.cloudtests.TestJournalWrittenAfterReboot", 0; type_string "sudo reboot\n"; boot_to_login_screen(timeout => 180); - console_login(user=>"root", password=>"weakpassword"); + console_login(user => "root", password => "weakpassword"); # we need to use script_run as regular user again assert_script_run "sudo chmod ugo+w /dev/" . $serialdev; # let's go to another tty and login as regular user again send_key "alt-f2"; - console_login(user=>"test", password=>"weakpassword"); + console_login(user => "test", password => "weakpassword"); assert_script_run "sudo python3 -m unittest tunirtests.cloudservice.TestServiceAfter -v"; assert_script_run "sudo python3 -m unittest tunirtests.atomictests.TestDockerInstalled -v"; assert_script_run "sudo python3 -m unittest tunirtests.atomictests.TestDockerStorageSetup -v"; @@ -76,7 +76,7 @@ sub run { sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/base_package_install_remove.pm b/tests/base_package_install_remove.pm index 9b069d5f..a9d5f2f7 100644 --- a/tests/base_package_install_remove.pm +++ b/tests/base_package_install_remove.pm @@ -6,7 +6,7 @@ use utils; sub run { my $self = shift; # switch to TTY3 for both, graphical and console tests - $self->root_console(tty=>3); + $self->root_console(tty => 3); # This test case tests that packages can be correctly installed and removed. # We will test by installing two packages - ftp and mc. @@ -49,7 +49,7 @@ sub run { sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/base_reboot_unmount.pm b/tests/base_reboot_unmount.pm index 47492d47..a8a98997 100644 --- a/tests/base_reboot_unmount.pm +++ b/tests/base_reboot_unmount.pm @@ -19,21 +19,21 @@ sub test_routine { sub run { my $self = shift; # switch to TTY3 for both graphical and console tests - $self->root_console(tty=>3); + $self->root_console(tty => 3); # Run test for the first time test_routine(); # Reboot the system. type_safely "reboot\n"; # This time, we will need to login manually. boot_to_login_screen; - $self->root_console(tty=>3); + $self->root_console(tty => 3); # Run the tests for the second time. test_routine(); } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/base_selinux.pm b/tests/base_selinux.pm index 4364bb13..425dd2be 100644 --- a/tests/base_selinux.pm +++ b/tests/base_selinux.pm @@ -4,15 +4,15 @@ use testapi; use utils; sub run { - my $self=shift; + my $self = shift; # switch to TTY3 for both, graphical and console tests - $self->root_console(tty=>3); + $self->root_console(tty => 3); validate_script_output 'getenforce', sub { $_ =~ m/Enforcing/ }; } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/base_service_manipulation.pm b/tests/base_service_manipulation.pm index d7ca8b06..24d66023 100644 --- a/tests/base_service_manipulation.pm +++ b/tests/base_service_manipulation.pm @@ -6,7 +6,7 @@ use utils; sub run { my $self = shift; # switch to TTY3 for both, graphical and console tests - $self->root_console(tty=>3); + $self->root_console(tty => 3); # we could make this slightly more 'efficient' by assuming chronyd # is always going to be enabled/running at first, but it's safer # to force an expected starting state. @@ -14,7 +14,7 @@ sub run { script_run "systemctl disable chronyd.service"; script_run "reboot", 0; boot_to_login_screen; - $self->root_console(tty=>3); + $self->root_console(tty => 3); # note the use of ! here is a bash-ism, but it sure makes life easier assert_script_run '! systemctl is-enabled chronyd.service'; assert_script_run '! systemctl is-active chronyd.service'; @@ -33,14 +33,14 @@ sub run { assert_script_run '! ps -C chronyd'; script_run "reboot", 0; boot_to_login_screen; - $self->root_console(tty=>3); + $self->root_console(tty => 3); assert_script_run 'systemctl is-enabled chronyd.service'; assert_script_run 'systemctl is-active chronyd.service'; assert_script_run 'ps -C chronyd'; script_run "systemctl disable chronyd.service"; script_run "reboot", 0; boot_to_login_screen; - $self->root_console(tty=>3); + $self->root_console(tty => 3); assert_script_run '! systemctl is-enabled chronyd.service'; assert_script_run '! systemctl is-active chronyd.service'; assert_script_run '! ps -C chronyd'; @@ -48,7 +48,7 @@ sub run { sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/base_services_start.pm b/tests/base_services_start.pm index be192b58..7b81c9d0 100644 --- a/tests/base_services_start.pm +++ b/tests/base_services_start.pm @@ -5,7 +5,7 @@ use testapi; sub run { my $self = shift; # switch to TTY3 for both, graphical and console tests - $self->root_console(tty=>3); + $self->root_console(tty => 3); # "Job foo.service/start deleted to break ordering cycle"-type # message in the log indicates a service got taken out of the boot # process to resolve some kind of dependency loop, see e.g. @@ -42,7 +42,7 @@ sub run { sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/base_system_logging.pm b/tests/base_system_logging.pm index 7912c893..f3f2df69 100644 --- a/tests/base_system_logging.pm +++ b/tests/base_system_logging.pm @@ -3,9 +3,9 @@ use strict; use testapi; sub run { - my $self=shift; + my $self = shift; # switch to TTY3 for both, graphical and console tests - $self->root_console(tty=>3); + $self->root_console(tty => 3); # Check that journalctl DOESN'T output "No entries". This is also the case when journal files are missing. # NOTE: We are quietly assuming that something was logged in journal in last 30 minutes. Should be boot log, # switch to TTY3 etc. @@ -16,7 +16,7 @@ sub run { sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/base_update_cli.pm b/tests/base_update_cli.pm index 66221d08..314dd419 100644 --- a/tests/base_update_cli.pm +++ b/tests/base_update_cli.pm @@ -6,7 +6,7 @@ use packagetest; sub run { my $self = shift; # switch to TTY3 for both, graphical and console tests - $self->root_console(tty=>3); + $self->root_console(tty => 3); # enable test repos and install test packages prepare_test_packages; # check rpm agrees they installed good @@ -24,7 +24,7 @@ sub run { } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/btrfs_preserve_home_check_content.pm b/tests/btrfs_preserve_home_check_content.pm index 72c94334..067a6fa6 100644 --- a/tests/btrfs_preserve_home_check_content.pm +++ b/tests/btrfs_preserve_home_check_content.pm @@ -4,18 +4,18 @@ use testapi; use utils; sub run { - my $self=shift; + my $self = shift; # switch to TTY3 for both, graphical and console tests - $self->root_console(tty=>3); + $self->root_console(tty => 3); # The pre-created image has a special file left in the home - # directory. This checks that the file has been left there + # directory. This checks that the file has been left there # correctly after system reinstall. assert_script_run "ls /home/home_preserved"; } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/check_default_fonts.pm b/tests/check_default_fonts.pm index 964483d6..5fac9a0c 100644 --- a/tests/check_default_fonts.pm +++ b/tests/check_default_fonts.pm @@ -9,7 +9,7 @@ use utils; sub run { my $self = shift; - # On the console, the fonts might differ than in GUI. + # On the console, the fonts might differ than in GUI. # We will perform the tests in the gnome-terminal. # First, open it! desktop_switch_layout 'ascii'; @@ -23,7 +23,7 @@ sub run { menu_launch_type("terminal"); } assert_screen("apps_run_terminal"); - wait_still_screen(stilltime=>5, similarity_level=>42); + wait_still_screen(stilltime => 5, similarity_level => 42); # Run the test commands and record their output in the test file. enter_cmd("fc-match sans > test.txt"); @@ -32,17 +32,17 @@ sub run { sleep(2); enter_cmd("fc-match monospace >> test.txt"); sleep(2); - + # Depending on the selected language (Japanese or Arabic), we # will download a reference file and compare it with the test # file obtained in the previous step. - + my $language = get_var("LANGUAGE"); my @supported = qw(japanese arabic); # If the language is among supported languages if ($language ~~ @supported) { # Go to root console for script assertions. - $self->root_console(tty=>3); + $self->root_console(tty => 3); # Load us keys to be used on console script_run("loadkeys us"); # Navigate to the home directory. @@ -51,12 +51,12 @@ sub run { # Download the language reference file. script_run("wget https://fedorapeople.org/groups/qa/openqa-fonts/$language-reference.txt"); # upload the log for debugging. - upload_logs "test.txt", failok=>1; + upload_logs "test.txt", failok => 1; # Compare the test file and the reference file. assert_script_run("diff -u test.txt $language-reference.txt"); } - # For the rest of languages that are not currently defined, do nothing. + # For the rest of languages that are not currently defined, do nothing. } sub test_flags { diff --git a/tests/database_client.pm b/tests/database_client.pm index 9abc99ae..0f286795 100644 --- a/tests/database_client.pm +++ b/tests/database_client.pm @@ -6,7 +6,7 @@ use tapnet; use utils; sub run { - my $self=shift; + my $self = shift; # use compose repo, disable u-t, etc. repo_setup(); # install postgresql @@ -19,7 +19,7 @@ sub run { } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/desktop_background.pm b/tests/desktop_background.pm index 2257e9b5..118134f4 100644 --- a/tests/desktop_background.pm +++ b/tests/desktop_background.pm @@ -15,7 +15,7 @@ sub run { } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/desktop_browser.pm b/tests/desktop_browser.pm index bff348fa..89bbfba9 100644 --- a/tests/desktop_browser.pm +++ b/tests/desktop_browser.pm @@ -29,55 +29,55 @@ sub run { my $self = shift; check_desktop; # switch to a VT and disable things that can mess with the test - $self->root_console(tty=>3); + $self->root_console(tty => 3); disable_firefox_studies; desktop_vt; send_key 'super'; # wait out animations - wait_still_screen(stilltime=>4, similarity_level=>45); + wait_still_screen(stilltime => 4, similarity_level => 45); assert_and_click 'browser_launcher'; assert_screen 'browser', 45; # firefox is quite grindy on startup, let it settle - wait_still_screen(stilltime=>5, similarity_level=>45); + wait_still_screen(stilltime => 5, similarity_level => 45); # open a new tab so we don't race with the default page load # (also focuses the location bar for us) _open_new_tab; - wait_still_screen(stilltime=>5, similarity_level=>45); + wait_still_screen(stilltime => 5, similarity_level => 45); sleep 3; # check FAS, typing slowly to avoid errors type_very_safely "https://accounts.fedoraproject.org/\n"; assert_screen 'browser_fas_home'; _open_new_tab; - wait_still_screen(stilltime=>2, similarity_level=>45); + wait_still_screen(stilltime => 2, similarity_level => 45); sleep 2; type_very_safely "https://kernel.org\n"; assert_and_click "browser_kernelorg_patch"; - wait_still_screen(stilltime=>2, similarity_level=>45); + wait_still_screen(stilltime => 2, similarity_level => 45); # browsers do...something...when the download completes, and we # expect there's a single click to make it go away and return # browser to a state where we can open a new tab assert_and_click "browser_download_complete"; - wait_still_screen(stilltime=>2, similarity_level=>45); + wait_still_screen(stilltime => 2, similarity_level => 45); # we'll check it actually downloaded later # add-on test: at present all desktops we test (KDE, GNOME) are # using Firefox by default so we do this unconditionally, but we # may need to conditionalize it if we ever test desktops whose # default browser doesn't support add-ons or uses different ones _open_new_tab; - wait_still_screen(stilltime=>2, similarity_level=>45); + wait_still_screen(stilltime => 2, similarity_level => 45); sleep 2; type_very_safely "https://addons.mozilla.org/en-US/firefox/addon/ublock-origin/\n"; assert_and_click "firefox_addon_add"; assert_and_click "firefox_addon_install"; assert_and_click "firefox_addon_success"; # go to a console and check download worked - $self->root_console(tty=>3); + $self->root_console(tty => 3); my $user = get_var("USER_LOGIN", "test"); assert_script_run "test -e /home/$user/Downloads/patch-*.xz"; } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/desktop_fprint.pm b/tests/desktop_fprint.pm index b8ea78c1..69ac5b8f 100644 --- a/tests/desktop_fprint.pm +++ b/tests/desktop_fprint.pm @@ -8,7 +8,7 @@ sub run { # "Login without a (fingerprint) reader" my $self = shift; my $user = get_var("USER_LOGIN", "test"); - $self->root_console(tty=>6); + $self->root_console(tty => 6); script_run 'dnf -y install socat', 180; assert_script_run 'mkdir -p /etc/systemd/system/fprintd.service.d'; # configure fprintd dummy reader, see @@ -24,22 +24,22 @@ sub run { send_key_until_needlematch("graphical_login_input", "ret", 3, 5); type_very_safely "weakpassword"; send_key "ret"; - check_desktop(timeout=>60); + check_desktop(timeout => 60); wait_still_screen 10; - $self->root_console(tty=>5); + $self->root_console(tty => 5); # now we enroll a fingerprint, we run the enrol process on tty5... type_string "fprintd-enroll $user\n"; sleep 2; - $self->root_console(tty=>6); + $self->root_console(tty => 6); # ...and do the scans (we need exactly 5) on tty4. - for my $n (1..5) { + for my $n (1 .. 5) { assert_script_run "echo SCAN $user-finger-1 | socat STDIN UNIX-CONNECT:/run/fprintd-virt"; } # now we will reboot and do step 3: # "Login using fingerprint" type_string "reboot\n"; assert_screen "graphical_login", 180; - $self->root_console(tty=>6); + $self->root_console(tty => 6); # the GDM tty needs to be active when the scan happens, so we will # schedule the scan to happen in 20 seconds then go deal with gdm type_string "sleep 20; echo SCAN $user-finger-1 | socat STDIN UNIX-CONNECT:/run/fprintd-virt\n"; @@ -49,13 +49,13 @@ sub run { # now we check that we see the "or scan fingerprint" message, then # just wait for the scan to happen and login to succeed assert_screen "graphical_login_fprint"; - check_desktop(timeout=>60); - $self->root_console(tty=>6); + check_desktop(timeout => 60); + $self->root_console(tty => 6); # now we will reboot again and do step 4: # "Password login after failed fingerprint login" type_string "reboot\n"; assert_screen "graphical_login", 180; - $self->root_console(tty=>6); + $self->root_console(tty => 6); # we're doing the same as before, but scanning the 'wrong thing' # (note finger-2 not finger-1) type_string "sleep 20; echo SCAN $user-finger-2 | socat STDIN UNIX-CONNECT:/run/fprintd-virt\n"; @@ -71,11 +71,11 @@ sub run { assert_screen "graphical_login_input"; type_very_safely "weakpassword"; send_key "ret"; - check_desktop(timeout=>60); + check_desktop(timeout => 60); } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/desktop_login.pm b/tests/desktop_login.pm index 8fc85cd1..fa0a35dd 100644 --- a/tests/desktop_login.pm +++ b/tests/desktop_login.pm @@ -66,12 +66,12 @@ sub login_user { # but rather a "screensaver" screen for the DM. If this is the # case, hit Escape to bring back the user list. send_key "esc"; - wait_still_screen(stilltime=>5, similarity_level=>45); + wait_still_screen(stilltime => 5, similarity_level => 45); } if ($method ne "unlock") { # When we do not just want to unlock the screen, we need to select a user. assert_and_click "login_$user"; - wait_still_screen(stilltime=>5, similarity_level=>45); + wait_still_screen(stilltime => 5, similarity_level => 45); } if ($method eq "create") { # With users that do not have passwords, we need to make an extra round @@ -79,8 +79,8 @@ sub login_user { type_very_safely "$password\n"; } type_very_safely "$password\n"; - check_desktop(timeout=>60) if ($args{checklogin}); - wait_still_screen(stilltime=>5, similarity_level=>45); + check_desktop(timeout => 60) if ($args{checklogin}); + wait_still_screen(stilltime => 5, similarity_level => 45); } sub check_user_logged_in { @@ -176,7 +176,7 @@ sub run { our $desktop = get_var("DESKTOP"); # replace the wallpaper with a black image, this should work for # all desktops. Takes effect after a logout / login cycle - $self->root_console(tty=>3); + $self->root_console(tty => 3); assert_script_run "dnf -y install GraphicsMagick", 300; assert_script_run "gm convert -size 1024x768 xc:black /usr/share/backgrounds/black.png"; assert_script_run 'for i in /usr/share/backgrounds/f*/default/*.png; do ln -sf /usr/share/backgrounds/black.png $i; done'; @@ -184,7 +184,7 @@ sub run { # use solid blue background for SDDM assert_script_run "sed -i -e 's,image,solid,g' /usr/share/sddm/themes/01-breeze-fedora/theme.conf.user"; } - adduser(name=>"Jack Sparrow", login=>"jack", password=>$jackpass); + adduser(name => "Jack Sparrow", login => "jack", password => $jackpass); if ($desktop eq "gnome") { # suppress the Welcome Tour for new users in GNOME 40+ assert_script_run 'printf "[org.gnome.shell]\nwelcome-dialog-last-shown-version=\'4294967295\'\n" > /usr/share/glib-2.0/schemas/org.gnome.shell.gschema.override'; @@ -195,12 +195,12 @@ sub run { # In Gnome, we can create a passwordless user that can provide his password upon # the first login. So we can create the second user in this way to test this feature # later. - adduser(name=>"Jim Eagle", login=>"jim", password=>"askuser"); + adduser(name => "Jim Eagle", login => "jim", password => "askuser"); } else { # In KDE, we can also create a passwordless user, but we cannot log into the system # later, so we will create the second user the standard way. - adduser(name=>"Jim Eagle", login=>"jim", password=>$jimpass); + adduser(name => "Jim Eagle", login => "jim", password => $jimpass); } # Clean boot the system, and note what accounts are listed on the login screen. @@ -210,7 +210,7 @@ sub run { boot_to_login_screen; # Log in with the first user account. - login_user(user=>"jack", password=>$jackpass); + login_user(user => "jack", password => $jackpass); check_user_logged_in("jack"); # Log out the user. logout_user(); @@ -218,31 +218,31 @@ sub run { # Log in with the second user account. The second account, Jim Eagle, if ($desktop eq "gnome") { # If we are in Gnome, we will this time assign a password on first log-in. - login_user(user=>"jim", password=>$jimpass, method=>"create"); + login_user(user => "jim", password => $jimpass, method => "create"); } else { # If not, we are in KDE and we will log in normally. - login_user(user=>"jim", password=>$jimpass); + login_user(user => "jim", password => $jimpass); } check_user_logged_in("jim"); # And this time reboot the system using the menu. reboot_system(); # Try to log in with either account, intentionally entering the wrong password. - login_user(user=>"jack", password=>"wrongpassword", checklogin=>0); + login_user(user => "jack", password => "wrongpassword", checklogin => 0); # get back to the login screen if necessary (dismiss an error message) send_key 'esc' unless (check_screen "login_jim"); # Now, log into the system again using the correct password. This will # only work if we were correctly denied login with the wrong password, # if we were let in with the wrong password it'll fail - login_user(user=>"jim", password=>$jimpass); + login_user(user => "jim", password => $jimpass); check_user_logged_in("jim"); # Lock the screen and unlock again. lock_screen(); # Use the password to unlock the screen. - login_user(user=>"jim", password=>$jimpass, method=>"unlock"); + login_user(user => "jim", password => $jimpass, method => "unlock"); # Switch user tests if ($desktop eq "gnome") { @@ -257,7 +257,7 @@ sub run { # Initiate switch user switch_user(); # Now, we get a new login screen, so let's do the login into the new session. - login_user(user=>"jack", password=>$jackpass); + login_user(user => "jack", password => $jackpass); # Check that it is a new session, the terminal window should not be visible. if (check_screen "user_confirm_jim") { die "The session was not switched!"; @@ -269,7 +269,7 @@ sub run { logout_user(); # Now, let us log into the original session, this time, the terminal window # should still be visible. - login_user(user=>"jim", password=>$jimpass); + login_user(user => "jim", password => $jimpass); assert_screen "user_confirm_jim"; # We will also test another alternative - switching the user from @@ -277,7 +277,7 @@ sub run { lock_screen(); send_key "ret"; switch_user(); - login_user(user=>"jack", password=>$jackpass); + login_user(user => "jack", password => $jackpass); check_user_logged_in("jack"); } # Power off the machine @@ -285,7 +285,7 @@ sub run { } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/desktop_notifications.pm b/tests/desktop_notifications.pm index 748b904d..d5791df2 100644 --- a/tests/desktop_notifications.pm +++ b/tests/desktop_notifications.pm @@ -15,14 +15,14 @@ sub run { my $desktop = get_var("DESKTOP"); # for the live image case, handle bootloader here if (get_var("BOOTFROM")) { - do_bootloader(postinstall=>1, params=>'3'); + do_bootloader(postinstall => 1, params => '3'); } else { - do_bootloader(postinstall=>0, params=>'3'); + do_bootloader(postinstall => 0, params => '3'); } boot_to_login_screen; # use tty1 to avoid RHBZ #1821499 on F32 Workstation live - $self->root_console(tty=>1); + $self->root_console(tty => 1); # ensure we actually have some package updates available prepare_test_packages; if ($desktop eq 'gnome') { @@ -41,11 +41,11 @@ sub run { # get notifications, see: # https://wiki.gnome.org/Design/Apps/Software/Updates#Tentative_Design my $now = script_output 'date +%s'; - my $yyday = $now - 2*24*60*60; - my $longago = $now - 14*24*60*60; + my $yyday = $now - 2 * 24 * 60 * 60; + my $longago = $now - 14 * 24 * 60 * 60; # have to log in as the user to do this script_run 'exit', 0; - console_login(user=>get_var('USER_LOGIN', 'test'), password=>get_var('USER_PASSWORD', 'weakpassword')); + console_login(user => get_var('USER_LOGIN', 'test'), password => get_var('USER_PASSWORD', 'weakpassword')); script_run "gsettings set org.gnome.software check-timestamp ${yyday}", 0; script_run "gsettings set org.gnome.software update-notification-timestamp ${longago}", 0; script_run "gsettings set org.gnome.software online-updates-timestamp ${longago}", 0; @@ -53,7 +53,7 @@ sub run { script_run "gsettings set org.gnome.software install-timestamp ${longago}", 0; wait_still_screen 5; script_run 'exit', 0; - console_login(user=>'root', password=>get_var('ROOT_PASSWORD', 'weakpassword')); + console_login(user => 'root', password => get_var('ROOT_PASSWORD', 'weakpassword')); } } # can't use assert_script_run here as long as we're on tty1 @@ -74,11 +74,11 @@ sub run { type_very_safely get_var("USER_PASSWORD", "weakpassword"); send_key 'ret'; } - check_desktop(timeout=>90); + check_desktop(timeout => 90); # now, WE WAIT. this is just an unconditional wait - rather than # breaking if we see an update notification appear - so we catch # things that crash a few minutes after startup, etc. - for my $n (1..16) { + for my $n (1 .. 16) { sleep 30; mouse_set 10, 10; send_key "spc"; @@ -131,7 +131,7 @@ sub run { sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/desktop_printing.pm b/tests/desktop_printing.pm index 129112b9..9312ce3b 100644 --- a/tests/desktop_printing.pm +++ b/tests/desktop_printing.pm @@ -9,11 +9,11 @@ sub run { # Prepare the environment for the test. # # Some actions need a root account, so become root. - $self->root_console(tty=>3); + $self->root_console(tty => 3); # Create a text file, put content to it to prepare it for later printing. - script_run "cd /home/test/"; - assert_script_run "echo 'A quick brown fox jumps over a lazy dog.' > testfile.txt"; + script_run "cd /home/test/"; + assert_script_run "echo 'A quick brown fox jumps over a lazy dog.' > testfile.txt"; # Make the file readable and for everybody. script_run "chmod 666 testfile.txt"; @@ -55,20 +55,20 @@ sub run { $term = "konsole"; } - # Let's open the terminal. We will use it to start the applications + # Let's open the terminal. We will use it to start the applications # as well as to check for the name of the printed file. menu_launch_type($term); wait_still_screen(5); # Open the text editor and maximize it. wait_screen_change { type_very_safely "$editor /home/test/testfile.txt &\n"; }; - wait_still_screen(stilltime=>2, similarity_level=>45); + wait_still_screen(stilltime => 2, similarity_level => 45); wait_screen_change { send_key($maximize); }; - wait_still_screen(stilltime=>2, similarity_level=>45); + wait_still_screen(stilltime => 2, similarity_level => 45); # Print the file using one of the available methods send_key "ctrl-p"; - wait_still_screen(stilltime=>3, similarity_level=>45); + wait_still_screen(stilltime => 3, similarity_level => 45); # We will select the printing method # In case of KDE, we will need to select the printer first. if ($desktop eq "kde") { @@ -94,7 +94,7 @@ sub run { # on the selected method. We do this on a VT because there's # no argument to script_output to make it type slowly, and # it often fails typing fast in a desktop terminal - $self->root_console(tty=>3); + $self->root_console(tty => 3); my $directory = $usecups ? "/home/test/Desktop" : "/home/test/Documents"; my $filename = script_output("ls $directory"); my $filepath = "$directory/$filename"; @@ -104,17 +104,17 @@ sub run { # back to the desktop desktop_vt(); - wait_still_screen(stilltime=>3, similarity_level=>45); + wait_still_screen(stilltime => 3, similarity_level => 45); # The CLI might be blocked by some application output. Pressing the # Enter key will dismiss them and return the CLI to the ready status. send_key("ret"); # Open the pdf file in a Document reader and check that it is correctly printed. type_safely("$viewer $filepath &\n"); - wait_still_screen(stilltime=>3, similarity_level=>45); + wait_still_screen(stilltime => 3, similarity_level => 45); # Resize the window, so that the size of the document fits the bigger space # and gets more readable. send_key $maximize; - wait_still_screen(stilltime=>2, similarity_level=>45); + wait_still_screen(stilltime => 2, similarity_level => 45); # in KDE, make sure we're at the start of the document send_key "ctrl-home" if ($desktop eq "kde"); # Check the printed pdf. @@ -123,7 +123,7 @@ sub run { sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/desktop_terminal.pm b/tests/desktop_terminal.pm index c5ddb3f7..79787608 100644 --- a/tests/desktop_terminal.pm +++ b/tests/desktop_terminal.pm @@ -9,15 +9,15 @@ sub run { check_desktop; menu_launch_type('terminal'); assert_screen "apps_run_terminal"; - wait_still_screen(stilltime=>5, similarity_level=>42); + wait_still_screen(stilltime => 5, similarity_level => 42); # need to be root my $rootpass = get_var("ROOT_PASSWORD", "weakpassword"); type_string "su\n", 20; - wait_still_screen(stilltime=>3, similarity_level=>42); + wait_still_screen(stilltime => 3, similarity_level => 42); # can't use type_safely for now as current implementation relies # on screen change checks, and there is no screen change here type_string "$rootpass\n", 1; - wait_still_screen(stilltime=>3, similarity_level=>42); + wait_still_screen(stilltime => 3, similarity_level => 42); # if we can run something successfully, we're at a console; # we're reinventing assert_script_run instead of using it so # we can type safely @@ -26,7 +26,7 @@ sub run { } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/desktop_update_graphical.pm b/tests/desktop_update_graphical.pm index 0dfe5877..df05fde2 100644 --- a/tests/desktop_update_graphical.pm +++ b/tests/desktop_update_graphical.pm @@ -9,7 +9,7 @@ sub run { my $desktop = get_var('DESKTOP'); my $relnum = get_release_number; # use a tty console for repo config and package prep - $self->root_console(tty=>3); + $self->root_console(tty => 3); assert_script_run 'dnf config-manager --set-disabled updates-testing'; prepare_test_packages; # get back to the desktop @@ -38,7 +38,7 @@ sub run { } # go to the 'update' interface. We may be waiting some time at a # 'Software catalog is being loaded' screen. - for my $n (1..5) { + for my $n (1 .. 5) { last if (check_screen 'desktop_package_tool_update', 120); mouse_set 10, 10; mouse_hide; @@ -47,14 +47,14 @@ sub run { # wait for things to settle if e.g. GNOME is refreshing wait_still_screen 5, 90; # we always want to refresh to make sure we get the prepared update - assert_and_click 'desktop_package_tool_update_refresh', timeout=>120; + assert_and_click 'desktop_package_tool_update_refresh', timeout => 120; # for GNOME, the apply/download buttons remain visible for a long # time, annoyingly. So let's actually watch the 'refreshing' state # till it goes away if ($desktop eq 'gnome') { assert_screen 'desktop_package_tool_update_refreshing'; # now wait for it to go away - for my $n (1..30) { + for my $n (1 .. 30) { last unless (check_screen 'desktop_package_tool_update_refreshing', 6); # if we matched, we likely matched *immediately*, so sleep # the other five seconds @@ -108,7 +108,7 @@ sub run { # FIXME: also sometimes the update apply button just doesn't # work, so keep clicking till it does: # https://bugzilla.redhat.com/show_bug.cgi?id=1943943 - for my $n (1..10) { + for my $n (1 .. 10) { sleep 2; assert_screen ['kde_offline_update_reboot', 'desktop_package_tool_update_apply']; # break out if we reached the reboot button @@ -126,12 +126,12 @@ sub run { assert_screen 'desktop_package_tool_update_done', 180; } # back to console to verify updates - $self->root_console(tty=>3); + $self->root_console(tty => 3); verify_updated_packages; } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/disk_custom_blivet_btrfs.pm b/tests/disk_custom_blivet_btrfs.pm index 8e6a570f..1db89df6 100644 --- a/tests/disk_custom_blivet_btrfs.pm +++ b/tests/disk_custom_blivet_btrfs.pm @@ -31,12 +31,12 @@ sub run { assert_and_click "anaconda_part_accept_changes"; # Anaconda hub - assert_screen "anaconda_main_hub", 300; # + assert_screen "anaconda_main_hub", 300; } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/disk_custom_blivet_btrfs_preserve_home.pm b/tests/disk_custom_blivet_btrfs_preserve_home.pm index 243ea134..d777247e 100644 --- a/tests/disk_custom_blivet_btrfs_preserve_home.pm +++ b/tests/disk_custom_blivet_btrfs_preserve_home.pm @@ -14,7 +14,7 @@ sub run { if (get_var("UEFI")) { # if we're running on UEFI, let us reformat the UEFI first # Select the UEFI partition if it is not selected by default - if (not (check_screen "anaconda_blivet_part_efi_selected", 30)) { + if (not(check_screen "anaconda_blivet_part_efi_selected", 30)) { assert_and_click "anaconda_blivet_part_inactive_efi"; wait_still_screen 5; } @@ -23,10 +23,10 @@ sub run { assert_and_click "anaconda_blivet_part_edit"; # Select the Format option assert_and_click "anaconda_blivet_part_format"; - if (not (check_screen "anaconda_blivet_part_fs_efi_filesystem_selected", 30)) { - assert_and_click "anaconda_blivet_part_fs_select"; - assert_and_click "anaconda_blivet_part_fs_efi_filesystem"; - } + if (not(check_screen "anaconda_blivet_part_fs_efi_filesystem_selected", 30)) { + assert_and_click "anaconda_blivet_part_fs_select"; + assert_and_click "anaconda_blivet_part_fs_efi_filesystem"; + } # Select the mountpoint field send_key_until_needlematch("anaconda_blivet_mountpoint_selected", "tab", 3, 5); @@ -50,9 +50,9 @@ sub run { # Select the Format option assert_and_click "anaconda_blivet_part_format"; # Open the filesystem types and select ext4, if not selected - if (not (check_screen "anaconda_blivet_part_fs_ext4_selected",30)) { - assert_and_click "anaconda_blivet_part_fs_select"; - assert_and_click "anaconda_blivet_part_fs_ext4"; + if (not(check_screen "anaconda_blivet_part_fs_ext4_selected", 30)) { + assert_and_click "anaconda_blivet_part_fs_select"; + assert_and_click "anaconda_blivet_part_fs_ext4"; } # Select the mountpoint field send_key_until_needlematch("anaconda_blivet_mountpoint_selected", "tab", 3, 5); @@ -65,7 +65,7 @@ sub run { assert_and_click "anaconda_blivet_volumes_icon"; # Select the home partition - if (not (check_screen "anaconda_blivet_part_home_selected")) { + if (not(check_screen "anaconda_blivet_part_home_selected")) { assert_and_click "anaconda_blivet_part_inactive_home"; } # Go to the partition settings @@ -87,7 +87,7 @@ sub run { assert_and_click "anaconda_blivet_part_root_exists"; assert_and_click "anaconda_blivet_part_delete"; assert_and_click "anaconda_blivet_btn_ok"; - sleep 5; + sleep 5; } # Add new root partition @@ -108,12 +108,12 @@ sub run { assert_and_click "anaconda_part_accept_changes"; # Anaconda hub - assert_screen "anaconda_main_hub", 300; # + assert_screen "anaconda_main_hub", 300; } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/disk_custom_blivet_lvm_ext4.pm b/tests/disk_custom_blivet_lvm_ext4.pm index e16ecc46..ba73b706 100644 --- a/tests/disk_custom_blivet_lvm_ext4.pm +++ b/tests/disk_custom_blivet_lvm_ext4.pm @@ -30,12 +30,12 @@ sub run { assert_and_click "anaconda_part_accept_changes"; # Anaconda hub - assert_screen "anaconda_main_hub", 300; # + assert_screen "anaconda_main_hub", 300; } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/disk_custom_blivet_lvmthin.pm b/tests/disk_custom_blivet_lvmthin.pm index 23b15975..abaaeb46 100644 --- a/tests/disk_custom_blivet_lvmthin.pm +++ b/tests/disk_custom_blivet_lvmthin.pm @@ -33,12 +33,12 @@ sub run { assert_and_click "anaconda_part_accept_changes"; # Anaconda hub - assert_screen "anaconda_main_hub", 300; # + assert_screen "anaconda_main_hub", 300; } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/disk_custom_blivet_resize_lvm.pm b/tests/disk_custom_blivet_resize_lvm.pm index 96c72a8b..ccbfc56a 100644 --- a/tests/disk_custom_blivet_resize_lvm.pm +++ b/tests/disk_custom_blivet_resize_lvm.pm @@ -21,7 +21,7 @@ sub activate { sub run { my $self = shift; - # Navigate to "Installation destionation" and select blivet-gui + # Navigate to "Installation destionation" and select blivet-gui # to manipulate the partitions. This will be automatically # done using the following method, because PARTITIONING starts # with "custom_blivet". @@ -64,7 +64,7 @@ sub run { assert_screen "device_root_resized_thirteen"; # Now format the resized root partition. It seems that the focus returns to the first - # partition in the view, so we need to activate this again before we attempt to do + # partition in the view, so we need to activate this again before we attempt to do # anything to the partition. activate("root"); custom_blivet_format_partition(type => 'ext4', label => 'root', mountpoint => '/'); @@ -86,7 +86,7 @@ sub run { } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/disk_custom_blivet_software_raid.pm b/tests/disk_custom_blivet_software_raid.pm index 278c5119..4b067403 100644 --- a/tests/disk_custom_blivet_software_raid.pm +++ b/tests/disk_custom_blivet_software_raid.pm @@ -7,7 +7,7 @@ sub run { my $self = shift; # Go to INSTALLATION DESTINATION and ensure two disks are selected. # Because PARTITIONING starts with 'custom_blivet', this will select blivet-gui. - select_disks(disks=>2); + select_disks(disks => 2); assert_and_click "anaconda_spoke_done"; if (get_var("UEFI")) { @@ -25,12 +25,12 @@ sub run { assert_and_click "anaconda_part_accept_changes"; # Anaconda hub - assert_screen "anaconda_main_hub", 300; # + assert_screen "anaconda_main_hub", 300; } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/disk_custom_blivet_standard_partition_ext4.pm b/tests/disk_custom_blivet_standard_partition_ext4.pm index 22fec1ff..135cc527 100644 --- a/tests/disk_custom_blivet_standard_partition_ext4.pm +++ b/tests/disk_custom_blivet_standard_partition_ext4.pm @@ -26,12 +26,12 @@ sub run { assert_and_click "anaconda_part_accept_changes"; # Anaconda hub - assert_screen "anaconda_main_hub", 300; # + assert_screen "anaconda_main_hub", 300; } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/disk_custom_blivet_standard_partition_ext4_postinstall.pm b/tests/disk_custom_blivet_standard_partition_ext4_postinstall.pm index 561bbaa9..2509dbe3 100644 --- a/tests/disk_custom_blivet_standard_partition_ext4_postinstall.pm +++ b/tests/disk_custom_blivet_standard_partition_ext4_postinstall.pm @@ -8,21 +8,21 @@ sub run { my $devroot = 'vda2'; my $devboot = 'vda1'; if (get_var('OFW') || get_var('UEFI')) { - $count = 4; # extra boot partition (PreP or ESP) + $count = 4; # extra boot partition (PreP or ESP) $devroot = 'vda3'; $devboot = 'vda2'; } # check number of partitions - script_run 'fdisk -l | grep /dev/vda'; # debug + script_run 'fdisk -l | grep /dev/vda'; # debug validate_script_output 'fdisk -l | grep /dev/vda | wc -l', sub { $_ =~ m/$count/ }; # check mounted partitions are ext4 fs - script_run 'mount | grep /dev/vda'; # debug + script_run 'mount | grep /dev/vda'; # debug validate_script_output "mount | grep /dev/$devboot", sub { $_ =~ m/on \/boot type ext4/ }; validate_script_output "mount | grep /dev/$devroot", sub { $_ =~ m/on \/ type ext4/ }; } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/disk_custom_blivet_with_swap.pm b/tests/disk_custom_blivet_with_swap.pm index 4caf2fb5..039d1d44 100644 --- a/tests/disk_custom_blivet_with_swap.pm +++ b/tests/disk_custom_blivet_with_swap.pm @@ -26,12 +26,12 @@ sub run { assert_and_click "anaconda_part_accept_changes"; # Anaconda hub - assert_screen "anaconda_main_hub", 300; # + assert_screen "anaconda_main_hub", 300; } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/disk_custom_blivet_xfs.pm b/tests/disk_custom_blivet_xfs.pm index ae4831c5..159ef5eb 100644 --- a/tests/disk_custom_blivet_xfs.pm +++ b/tests/disk_custom_blivet_xfs.pm @@ -25,12 +25,12 @@ sub run { assert_and_click "anaconda_part_accept_changes"; # Anaconda hub - assert_screen "anaconda_main_hub", 300; # + assert_screen "anaconda_main_hub", 300; } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/disk_custom_btrfs.pm b/tests/disk_custom_btrfs.pm index 736a6f84..8ad3bb7a 100644 --- a/tests/disk_custom_btrfs.pm +++ b/tests/disk_custom_btrfs.pm @@ -19,12 +19,12 @@ sub run { assert_and_click "anaconda_part_accept_changes"; # Anaconda hub - assert_screen "anaconda_main_hub", 300; # + assert_screen "anaconda_main_hub", 300; } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/disk_custom_btrfs_postinstall.pm b/tests/disk_custom_btrfs_postinstall.pm index a41be641..50de52c5 100644 --- a/tests/disk_custom_btrfs_postinstall.pm +++ b/tests/disk_custom_btrfs_postinstall.pm @@ -9,7 +9,7 @@ sub run { } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/disk_custom_btrfs_preserve_home.pm b/tests/disk_custom_btrfs_preserve_home.pm index 377e7e1e..de8507d9 100644 --- a/tests/disk_custom_btrfs_preserve_home.pm +++ b/tests/disk_custom_btrfs_preserve_home.pm @@ -59,7 +59,7 @@ sub run { assert_and_click "anaconda_part_confirm_delete"; # Add the new root partition to the scheme - assert_and_click("anaconda_add", timeout=>60); + assert_and_click("anaconda_add", timeout => 60); type_very_safely "/\n"; # Confirm changes @@ -67,12 +67,12 @@ sub run { assert_and_click "anaconda_part_accept_changes"; # Anaconda hub - assert_screen "anaconda_main_hub", 300; # + assert_screen "anaconda_main_hub", 300; } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/disk_custom_iscsi.pm b/tests/disk_custom_iscsi.pm index 706aa2c6..d2e48222 100644 --- a/tests/disk_custom_iscsi.pm +++ b/tests/disk_custom_iscsi.pm @@ -11,7 +11,7 @@ sub run { # Anaconda hub # Go to INSTALLATION DESTINATION and ensure one regular disk # and the iscsi target are selected. - select_disks(iscsi=>\%iscsi); + select_disks(iscsi => \%iscsi); assert_and_click "anaconda_spoke_done"; # now we're at custom part. let's use standard partitioning for # simplicity @@ -25,7 +25,7 @@ sub run { } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/disk_custom_iscsi_postinstall.pm b/tests/disk_custom_iscsi_postinstall.pm index 28a5386a..b8d6e9b2 100644 --- a/tests/disk_custom_iscsi_postinstall.pm +++ b/tests/disk_custom_iscsi_postinstall.pm @@ -12,7 +12,7 @@ sub run { } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/disk_custom_lvm_ext4.pm b/tests/disk_custom_lvm_ext4.pm index da08aa0b..281090a8 100644 --- a/tests/disk_custom_lvm_ext4.pm +++ b/tests/disk_custom_lvm_ext4.pm @@ -23,12 +23,12 @@ sub run { assert_and_click "anaconda_part_accept_changes"; # Anaconda hub - assert_screen "anaconda_main_hub", 300; # + assert_screen "anaconda_main_hub", 300; } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/disk_custom_lvm_ext4_postinstall.pm b/tests/disk_custom_lvm_ext4_postinstall.pm index 8f66a443..fc55dba7 100644 --- a/tests/disk_custom_lvm_ext4_postinstall.pm +++ b/tests/disk_custom_lvm_ext4_postinstall.pm @@ -24,7 +24,7 @@ sub run { } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/disk_custom_lvmthin.pm b/tests/disk_custom_lvmthin.pm index 596b9ae3..eaaa23f9 100644 --- a/tests/disk_custom_lvmthin.pm +++ b/tests/disk_custom_lvmthin.pm @@ -19,12 +19,12 @@ sub run { assert_and_click "anaconda_part_accept_changes"; # Anaconda hub - assert_screen "anaconda_main_hub", 300; # + assert_screen "anaconda_main_hub", 300; } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/disk_custom_lvmthin_postinstall.pm b/tests/disk_custom_lvmthin_postinstall.pm index 1f2d4c25..e03cdd57 100644 --- a/tests/disk_custom_lvmthin_postinstall.pm +++ b/tests/disk_custom_lvmthin_postinstall.pm @@ -11,7 +11,7 @@ sub run { } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/disk_custom_resize_lvm.pm b/tests/disk_custom_resize_lvm.pm index 6f355efb..5a07a6e1 100644 --- a/tests/disk_custom_resize_lvm.pm +++ b/tests/disk_custom_resize_lvm.pm @@ -10,7 +10,7 @@ sub goto_mountpoint { sub run { my $self = shift; - # Navigate to "Installation destionation" and select blivet-gui + # Navigate to "Installation destionation" and select blivet-gui # to manipulate the partitions. This will be automatically # done using the following method, because PARTITIONING starts # with "custom_blivet". @@ -21,7 +21,7 @@ sub run { # a previous Linux installation and prepare the disk for new installation # which will be then followed through. - # Custom partitioning shows that an existing installations is there on the disk, + # Custom partitioning shows that an existing installations is there on the disk, # we need to select it to proceed. assert_and_click "anaconda_part_use_current"; @@ -84,7 +84,7 @@ sub run { } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/disk_custom_resize_lvm_postinstall.pm b/tests/disk_custom_resize_lvm_postinstall.pm index c1301124..9aa2006a 100644 --- a/tests/disk_custom_resize_lvm_postinstall.pm +++ b/tests/disk_custom_resize_lvm_postinstall.pm @@ -10,7 +10,7 @@ sub run { } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/disk_custom_software_raid.pm b/tests/disk_custom_software_raid.pm index ae4d6d39..39bf7ef9 100644 --- a/tests/disk_custom_software_raid.pm +++ b/tests/disk_custom_software_raid.pm @@ -7,7 +7,7 @@ sub run { my $self = shift; # Go to INSTALLATION DESTINATION and ensure two disks are selected. # Because PARTITIONING starts with 'custom_', this will select custom. - select_disks(disks=>2); + select_disks(disks => 2); assert_and_click "anaconda_spoke_done"; # Manual partitioning spoke should be displayed @@ -17,12 +17,12 @@ sub run { assert_and_click "anaconda_part_accept_changes"; # Anaconda hub - assert_screen "anaconda_main_hub", 300; # + assert_screen "anaconda_main_hub", 300; } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/disk_custom_software_raid_postinstall.pm b/tests/disk_custom_software_raid_postinstall.pm index 6cff869e..d2b12d9f 100644 --- a/tests/disk_custom_software_raid_postinstall.pm +++ b/tests/disk_custom_software_raid_postinstall.pm @@ -9,7 +9,7 @@ sub run { } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/disk_custom_standard_partition_ext4.pm b/tests/disk_custom_standard_partition_ext4.pm index adde6143..d33b2101 100644 --- a/tests/disk_custom_standard_partition_ext4.pm +++ b/tests/disk_custom_standard_partition_ext4.pm @@ -10,25 +10,25 @@ sub run { select_disks(); assert_and_click "anaconda_spoke_done"; - # Manual partitioning spoke should be displayed. + # Manual partitioning spoke should be displayed. # Select the Standard Partitioning scheme custom_scheme_select("standard"); # Do 'automatic' partition creation assert_and_click "anaconda_part_automatic"; # Select ext4 as filesystems for partitions - custom_change_fs("ext4","root"); - custom_change_fs("ext4","boot"); + custom_change_fs("ext4", "root"); + custom_change_fs("ext4", "boot"); # Finish the settings assert_and_click "anaconda_spoke_done"; assert_and_click "anaconda_part_accept_changes"; # Anaconda hub - assert_screen "anaconda_main_hub", 300; # + assert_screen "anaconda_main_hub", 300; } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/disk_custom_standard_partition_ext4_postinstall.pm b/tests/disk_custom_standard_partition_ext4_postinstall.pm index 4b388531..c7fa7e50 100644 --- a/tests/disk_custom_standard_partition_ext4_postinstall.pm +++ b/tests/disk_custom_standard_partition_ext4_postinstall.pm @@ -8,21 +8,21 @@ sub run { my $devroot = 'vda1'; my $devboot = 'vda2'; if (get_var('OFW') || get_var('UEFI')) { - $count = 4; # extra boot partition (PreP or ESP) + $count = 4; # extra boot partition (PreP or ESP) $devroot = 'vda2'; $devboot = 'vda3'; } # check number of partitions - script_run 'fdisk -l | grep /dev/vda'; # debug + script_run 'fdisk -l | grep /dev/vda'; # debug validate_script_output 'fdisk -l | grep /dev/vda | wc -l', sub { $_ =~ m/$count/ }; # check mounted partitions are ext4 fs - script_run 'mount | grep /dev/vda'; # debug + script_run 'mount | grep /dev/vda'; # debug validate_script_output "mount | grep /dev/$devboot", sub { $_ =~ m/on \/boot type ext4/ }; validate_script_output "mount | grep /dev/$devroot", sub { $_ =~ m/on \/ type ext4/ }; } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/disk_custom_with_swap.pm b/tests/disk_custom_with_swap.pm index 4dfeceb4..5ef8aeae 100644 --- a/tests/disk_custom_with_swap.pm +++ b/tests/disk_custom_with_swap.pm @@ -29,12 +29,12 @@ sub run { assert_and_click "anaconda_part_accept_changes"; # Anaconda hub - assert_screen "anaconda_main_hub", 300; # + assert_screen "anaconda_main_hub", 300; } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/disk_custom_with_swap_postinstall.pm b/tests/disk_custom_with_swap_postinstall.pm index 46994d90..bf81a63f 100644 --- a/tests/disk_custom_with_swap_postinstall.pm +++ b/tests/disk_custom_with_swap_postinstall.pm @@ -11,7 +11,7 @@ sub run { } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/disk_custom_xfs.pm b/tests/disk_custom_xfs.pm index 77bc5868..c3bfdd9b 100644 --- a/tests/disk_custom_xfs.pm +++ b/tests/disk_custom_xfs.pm @@ -21,12 +21,12 @@ sub run { assert_and_click "anaconda_part_accept_changes"; # Anaconda hub - assert_screen "anaconda_main_hub", 300; # + assert_screen "anaconda_main_hub", 300; } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/disk_custom_xfs_postinstall.pm b/tests/disk_custom_xfs_postinstall.pm index 02b73e24..8ea47ec8 100644 --- a/tests/disk_custom_xfs_postinstall.pm +++ b/tests/disk_custom_xfs_postinstall.pm @@ -9,7 +9,7 @@ sub run { } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/disk_guided_delete_all.pm b/tests/disk_guided_delete_all.pm index 025a99ea..6e5e7a2a 100644 --- a/tests/disk_guided_delete_all.pm +++ b/tests/disk_guided_delete_all.pm @@ -18,12 +18,12 @@ sub run { assert_and_click "anaconda_install_destination_reclaim_space_btn"; # Anaconda hub - assert_screen "anaconda_main_hub", 300; # + assert_screen "anaconda_main_hub", 300; } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/disk_guided_delete_partial.pm b/tests/disk_guided_delete_partial.pm index f426c491..b3dc6333 100644 --- a/tests/disk_guided_delete_partial.pm +++ b/tests/disk_guided_delete_partial.pm @@ -21,12 +21,12 @@ sub run { assert_and_click "anaconda_install_destination_reclaim_space_btn"; # Anaconda hub - assert_screen "anaconda_main_hub", 300; # + assert_screen "anaconda_main_hub", 300; } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/disk_guided_delete_partial_postinstall.pm b/tests/disk_guided_delete_partial_postinstall.pm index 0983a1eb..368a50ee 100644 --- a/tests/disk_guided_delete_partial_postinstall.pm +++ b/tests/disk_guided_delete_partial_postinstall.pm @@ -10,7 +10,7 @@ sub run { } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/disk_guided_empty.pm b/tests/disk_guided_empty.pm index 96cc440c..09dd6dcd 100644 --- a/tests/disk_guided_empty.pm +++ b/tests/disk_guided_empty.pm @@ -15,29 +15,30 @@ sub run { # updates.img tests work by changing the appearance of the INSTALLATION # DESTINATION screen, so check that if needed. - if (get_var('TEST_UPDATES')){ + if (get_var('TEST_UPDATES')) { assert_screen "anaconda_install_destination_updates", 30; } - # Here the self identification test code is placed. - my $branched = get_var('VERSION'); - if ($identification eq 'true' or $branched ne "Rawhide") { - check_top_bar(); # See utils.pm + # Here the self identification test code is placed. + my $branched = get_var('VERSION'); + if ($identification eq 'true' or $branched ne "Rawhide") { + # See utils.pm + check_top_bar(); # we don't check version or pre-release because here those # texts appear on the banner which makes the needling # complex and fragile (banner is different between variants, # and has a gradient so for RTL languages the background color # differs; pre-release text is also translated) - } + } assert_and_click "anaconda_spoke_done"; # Anaconda hub - assert_screen "anaconda_main_hub", 300; # + assert_screen "anaconda_main_hub", 300; } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/disk_guided_encrypted.pm b/tests/disk_guided_encrypted.pm index 150c6283..e66ce88d 100644 --- a/tests/disk_guided_encrypted.pm +++ b/tests/disk_guided_encrypted.pm @@ -26,12 +26,12 @@ sub run { assert_and_click "anaconda_install_destination_save_passphrase"; # Anaconda hub - assert_screen "anaconda_main_hub", 300; # + assert_screen "anaconda_main_hub", 300; } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/disk_guided_encrypted_postinstall.pm b/tests/disk_guided_encrypted_postinstall.pm index 00da6cef..5998b269 100644 --- a/tests/disk_guided_encrypted_postinstall.pm +++ b/tests/disk_guided_encrypted_postinstall.pm @@ -14,7 +14,7 @@ sub run { } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/disk_guided_free_space_postinstall.pm b/tests/disk_guided_free_space_postinstall.pm index 54b6cb87..6501b387 100644 --- a/tests/disk_guided_free_space_postinstall.pm +++ b/tests/disk_guided_free_space_postinstall.pm @@ -10,7 +10,7 @@ sub run { } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/disk_guided_multi.pm b/tests/disk_guided_multi.pm index bb068a2e..b39e5545 100644 --- a/tests/disk_guided_multi.pm +++ b/tests/disk_guided_multi.pm @@ -7,16 +7,16 @@ sub run { my $self = shift; # Anaconda hub # Go to INSTALLATION DESTINATION and select only one disk. - select_disks(disks=>1); + select_disks(disks => 1); assert_and_click "anaconda_spoke_done"; # Anaconda hub - assert_screen "anaconda_main_hub", 300; # + assert_screen "anaconda_main_hub", 300; } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/disk_guided_multi_empty_all.pm b/tests/disk_guided_multi_empty_all.pm index bcba059e..c5be72dc 100644 --- a/tests/disk_guided_multi_empty_all.pm +++ b/tests/disk_guided_multi_empty_all.pm @@ -7,16 +7,16 @@ sub run { my $self = shift; # Anaconda hub # Go to INSTALLATION DESTINATION and select two disks. - select_disks(disks=>2); + select_disks(disks => 2); assert_and_click "anaconda_spoke_done"; # Anaconda hub - assert_screen "anaconda_main_hub", 300; # + assert_screen "anaconda_main_hub", 300; } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/disk_guided_multi_empty_all_postinstall.pm b/tests/disk_guided_multi_empty_all_postinstall.pm index ab2026f5..0c08b2f1 100644 --- a/tests/disk_guided_multi_empty_all_postinstall.pm +++ b/tests/disk_guided_multi_empty_all_postinstall.pm @@ -10,7 +10,7 @@ sub run { } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/disk_guided_multi_postinstall.pm b/tests/disk_guided_multi_postinstall.pm index 60fb71ab..a4e9396b 100644 --- a/tests/disk_guided_multi_postinstall.pm +++ b/tests/disk_guided_multi_postinstall.pm @@ -10,7 +10,7 @@ sub run { } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/disk_guided_shrink.pm b/tests/disk_guided_shrink.pm index 779dc244..f3eb0eca 100644 --- a/tests/disk_guided_shrink.pm +++ b/tests/disk_guided_shrink.pm @@ -23,12 +23,12 @@ sub run { assert_and_click "anaconda_install_destination_reclaim_space_btn"; # Anaconda hub - assert_screen "anaconda_main_hub", 300; # + assert_screen "anaconda_main_hub", 300; } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/disk_guided_shrink_postinstall.pm b/tests/disk_guided_shrink_postinstall.pm index 2b5c24cb..3b662814 100644 --- a/tests/disk_guided_shrink_postinstall.pm +++ b/tests/disk_guided_shrink_postinstall.pm @@ -10,7 +10,7 @@ sub run { } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/firewall_configured.pm b/tests/firewall_configured.pm index 6e746c1f..629db369 100644 --- a/tests/firewall_configured.pm +++ b/tests/firewall_configured.pm @@ -3,9 +3,9 @@ use strict; use testapi; sub run { - my $self=shift; - if (not( check_screen "root_console", 0)) { - $self->root_console(tty=>3); + my $self = shift; + if (not(check_screen "root_console", 0)) { + $self->root_console(tty => 3); } # this only succeeds if the firewall is running assert_script_run 'firewall-cmd --state'; @@ -17,7 +17,7 @@ sub run { } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/firewall_disabled.pm b/tests/firewall_disabled.pm index bb01159e..38b686d9 100644 --- a/tests/firewall_disabled.pm +++ b/tests/firewall_disabled.pm @@ -3,9 +3,9 @@ use strict; use testapi; sub run { - my $self=shift; - if (not( check_screen "root_console", 0)) { - $self->root_console(tty=>3); + my $self = shift; + if (not(check_screen "root_console", 0)) { + $self->root_console(tty => 3); } # this asserts that the command fails (which it does when fw is not running) assert_script_run '! firewall-cmd --state'; @@ -14,7 +14,7 @@ sub run { } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/freeipa_client.pm b/tests/freeipa_client.pm index eac5a5fe..3273b529 100644 --- a/tests/freeipa_client.pm +++ b/tests/freeipa_client.pm @@ -4,7 +4,7 @@ use testapi; use utils; sub run { - my $self=shift; + my $self = shift; # switch to tty1 (we're usually there already, but just in case # we're carrying on from a failed freeipa_webui that didn't fail # at tty1) @@ -25,7 +25,7 @@ sub run { # switch to tty2 for login tests send_key "ctrl-alt-f2"; # try and login as test1, should work - console_login(user=>'test1@TEST.OPENQA.FEDORAPROJECT.ORG', password=>'batterystaple'); + console_login(user => 'test1@TEST.OPENQA.FEDORAPROJECT.ORG', password => 'batterystaple'); type_string "exit\n"; # try and login as test2, should fail. we cannot use console_login # as it takes 10 seconds to complete when login fails, and @@ -40,7 +40,7 @@ sub run { sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/freeipa_password_change.pm b/tests/freeipa_password_change.pm index d54d5c8b..4d9d1631 100644 --- a/tests/freeipa_password_change.pm +++ b/tests/freeipa_password_change.pm @@ -6,7 +6,7 @@ use freeipa; sub run { my $self = shift; - console_login(user=>'root'); + console_login(user => 'root'); # check whether test3 exists, i.e. whether freeipa_webui at # least managed to create it. if not, we may as well just # die now, this test cannot work. @@ -51,7 +51,7 @@ sub run { } sub test_flags { - return { 'ignore_failure' => 1 }; + return {'ignore_failure' => 1}; } 1; diff --git a/tests/freeipa_webui.pm b/tests/freeipa_webui.pm index 1727ef3d..71d5e3e6 100644 --- a/tests/freeipa_webui.pm +++ b/tests/freeipa_webui.pm @@ -51,7 +51,7 @@ sub run { # switch to tty4 (boy, the tty jugglin') send_key "ctrl-alt-f4"; # try and login as test3, should work - console_login(user=>'test3@TEST.OPENQA.FEDORAPROJECT.ORG', password=>'batterystaple'); + console_login(user => 'test3@TEST.OPENQA.FEDORAPROJECT.ORG', password => 'batterystaple'); type_string "exit\n"; # try and login as test4, should fail. we cannot use console_login # as it takes 10 seconds to complete when login fails, and @@ -67,7 +67,7 @@ sub run { } sub test_flags { - return { 'ignore_failure' => 1 }; + return {'ignore_failure' => 1}; } 1; diff --git a/tests/install_source_graphical.pm b/tests/install_source_graphical.pm index d606df4e..354f868e 100644 --- a/tests/install_source_graphical.pm +++ b/tests/install_source_graphical.pm @@ -19,7 +19,7 @@ sub main_repo { if (get_var("REPOSITORY_GRAPHICAL") =~ m/^http:/) { $num = 4; } - for (my $i=0; $i<$num; $i++) { + for (my $i = 0; $i < $num; $i++) { send_key "up"; usleep 100; } @@ -61,14 +61,14 @@ sub add_repo { # configure an additional repository assert_and_click "anaconda_add"; # shift-tab seven times gets us to the scheme box - for (my $i=0; $i<7; $i++) { + for (my $i = 0; $i < 7; $i++) { send_key "shift-tab"; usleep 100; } # select appropriate repo type for the URL by pressing 'down' a given # number of times. default - 1 - is https my $num = 1; - for (my $i=0; $i<$num; $i++) { + for (my $i = 0; $i < $num; $i++) { send_key "down"; usleep 100; } @@ -102,7 +102,7 @@ sub run { } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/install_text.pm b/tests/install_text.pm index 4604021a..c1d297f5 100644 --- a/tests/install_text.pm +++ b/tests/install_text.pm @@ -60,45 +60,45 @@ sub run { } # Set timezone - run_with_error_check(sub {console_type_wait($spoke_number{"timezone"} . "\n")}, $error); - console_type_wait("1\n"); # Set timezone - console_type_wait("1\n"); # Europe - console_type_wait("37\n", 7); # Prague + run_with_error_check(sub { console_type_wait($spoke_number{"timezone"} . "\n") }, $error); + console_type_wait("1\n"); # Set timezone + console_type_wait("1\n"); # Europe + console_type_wait("37\n", 7); # Prague # Select disk - run_with_error_check(sub {console_type_wait($spoke_number{"destination"} . "\n")}, $error); - console_type_wait("c\n"); # first disk selected, continue - console_type_wait("c\n"); # use all space selected, continue - console_type_wait("c\n", 7); # LVM selected, continue + run_with_error_check(sub { console_type_wait($spoke_number{"destination"} . "\n") }, $error); + console_type_wait("c\n"); # first disk selected, continue + console_type_wait("c\n"); # use all space selected, continue + console_type_wait("c\n", 7); # LVM selected, continue # Set root password my $rootpwd = get_var("ROOT_PASSWORD", "weakpassword"); - run_with_error_check(sub {console_type_wait($spoke_number{"rootpwd"} . "\n")}, $error); + run_with_error_check(sub { console_type_wait($spoke_number{"rootpwd"} . "\n") }, $error); console_type_wait("$rootpwd\n"); console_type_wait("$rootpwd\n"); # Create user my $userpwd = get_var("USER_PASSWORD", "weakpassword"); my $username = get_var("USER_LOGIN", "test"); - run_with_error_check(sub {console_type_wait($spoke_number{"user"} . "\n")}, $error); - console_type_wait("1\n"); # create new - console_type_wait("3\n"); # set username + run_with_error_check(sub { console_type_wait($spoke_number{"user"} . "\n") }, $error); + console_type_wait("1\n"); # create new + console_type_wait("3\n"); # set username console_type_wait("$username\n"); - console_type_wait("5\n"); # set password + console_type_wait("5\n"); # set password console_type_wait("$userpwd\n"); console_type_wait("$userpwd\n"); - console_type_wait("6\n"); # make him an administrator + console_type_wait("6\n"); # make him an administrator console_type_wait("c\n", 7); my $counter = 0; if (testapi::is_serial_terminal) { - while (wait_serial("[!]", timeout=>5, quiet=>1)) { + while (wait_serial("[!]", timeout => 5, quiet => 1)) { if ($counter > 10) { die "There are unfinished spokes in Anaconda"; } sleep 10; $counter++; - console_type_wait("r\n"); # refresh + console_type_wait("r\n"); # refresh } } else { @@ -108,14 +108,14 @@ sub run { } sleep 10; $counter++; - console_type_wait("r\n"); # refresh + console_type_wait("r\n"); # refresh } } # begin installation console_type_wait("b\n"); - # When simulated crash is planned, then proceed with the crash routines and finish, + # When simulated crash is planned, then proceed with the crash routines and finish, # otherwise proceed normally and do if (get_var("CRASH_REPORT")) { crash_anaconda_text; @@ -131,7 +131,7 @@ sub run { } if (testapi::is_serial_terminal) { - wait_serial("Installation complete", timeout=>$timeout); + wait_serial("Installation complete", timeout => $timeout); if (get_var("SERIAL_CONSOLE") && get_var("OFW")) { # for some reason the check for a prompt times out here, even # though '# ' is clearly in the terminal log; hack it out @@ -155,7 +155,7 @@ sub run { sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/iot_clevis.pm b/tests/iot_clevis.pm index 24a93c6e..1b2b3e9d 100644 --- a/tests/iot_clevis.pm +++ b/tests/iot_clevis.pm @@ -23,7 +23,7 @@ sub run { sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/iot_greenboot.pm b/tests/iot_greenboot.pm index c2022ef1..e9fa6685 100644 --- a/tests/iot_greenboot.pm +++ b/tests/iot_greenboot.pm @@ -6,7 +6,7 @@ use utils; sub run { my $self = shift; # switch to TTY3 for both, graphical and console tests - $self->root_console(tty=>3); + $self->root_console(tty => 3); # Use ssh to log into this machine to see its status. type_string "ssh test\@localhost\n"; @@ -29,7 +29,7 @@ sub run { sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/iot_rpmostree_overlay.pm b/tests/iot_rpmostree_overlay.pm index a8f62d12..fb5c4977 100644 --- a/tests/iot_rpmostree_overlay.pm +++ b/tests/iot_rpmostree_overlay.pm @@ -8,7 +8,7 @@ sub reboot_and_login { my $reboot_time = shift; script_run "systemctl reboot"; boot_to_login_screen(timeout => $reboot_time); - console_login(user=>"root", password=>get_var("ROOT_PASSWORD")); + console_login(user => "root", password => get_var("ROOT_PASSWORD")); sleep 2; } @@ -16,14 +16,14 @@ sub run { my $self = shift; my $reboot_time = 300; # switch to TTY3 for both, graphical and console tests - $self->root_console(tty=>3); + $self->root_console(tty => 3); # Install wget as rpm-ostree overlay. Let's have timeout defined # quite generously, because it loads the package DBs. assert_script_run "rpm-ostree install wget", timeout => 300; # Reboot the machine to boot into the overlayed tree. reboot_and_login "300"; - + # Check that wget rpm is installed assert_script_run "rpm -q wget"; # And that it works @@ -31,7 +31,7 @@ sub run { # Then install the httpd package. assert_script_run "rpm-ostree install httpd", timeout => 300; - + # Reboot the machine to boot into the overlayed tree. reboot_and_login "300"; @@ -46,7 +46,7 @@ sub run { # Check for the functional test page assert_script_run "curl -o page.html http://localhost"; - assert_script_run "grep 'Fedora Project' page.html"; + assert_script_run "grep 'Fedora Project' page.html"; # Enable the httpd service assert_script_run "systemctl enable httpd"; @@ -73,7 +73,7 @@ sub run { } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/iot_rpmostree_rebase.pm b/tests/iot_rpmostree_rebase.pm index 55b47fd5..c34b312a 100644 --- a/tests/iot_rpmostree_rebase.pm +++ b/tests/iot_rpmostree_rebase.pm @@ -6,7 +6,7 @@ use utils; sub run { my $self = shift; - $self->root_console(tty=>3); + $self->root_console(tty => 3); # list available branches assert_script_run "ostree remote refs fedora-iot"; @@ -19,14 +19,14 @@ sub run { # if testing the current release, rebase to devel unless (script_run "rpm-ostree status -b | grep stable") { - $rebase = "devel" + $rebase = "devel"; } # rebase to the appropriate release, arch validate_script_output "rpm-ostree rebase fedora/${rebase}/${arch}/iot", sub { m/systemctl reboot/ }, 300; script_run "systemctl reboot", 0; boot_to_login_screen; - $self->root_console(tty=>3); + $self->root_console(tty => 3); # check booted branch to make sure successful rebase if ($rebase eq "devel") { @@ -41,7 +41,7 @@ sub run { script_run "systemctl reboot", 0; boot_to_login_screen; - $self->root_console(tty=>3); + $self->root_console(tty => 3); # check to make sure rollback successful, also account for branched (devel) if ($rebase eq "devel") { @@ -53,7 +53,7 @@ sub run { } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/iot_zezere_ignition.pm b/tests/iot_zezere_ignition.pm index 399d3d5c..7369f094 100644 --- a/tests/iot_zezere_ignition.pm +++ b/tests/iot_zezere_ignition.pm @@ -11,7 +11,7 @@ sub run { sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/mediakit_fileconflicts.pm b/tests/mediakit_fileconflicts.pm index 6604c112..11679bf9 100644 --- a/tests/mediakit_fileconflicts.pm +++ b/tests/mediakit_fileconflicts.pm @@ -15,7 +15,7 @@ sub run { } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/mediakit_repoclosure.pm b/tests/mediakit_repoclosure.pm index de9f13c4..752b9e4b 100644 --- a/tests/mediakit_repoclosure.pm +++ b/tests/mediakit_repoclosure.pm @@ -13,7 +13,7 @@ sub run { } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/modularity_checkdefaults.pm b/tests/modularity_checkdefaults.pm index 6ebfa013..6675238a 100644 --- a/tests/modularity_checkdefaults.pm +++ b/tests/modularity_checkdefaults.pm @@ -3,9 +3,9 @@ use strict; use testapi; use utils; sub run { - my $self=shift; + my $self = shift; # switch to tty and login as root - $self->root_console(tty=>3); + $self->root_console(tty => 3); # Download the testing script download_modularity_tests('whitelist'); @@ -14,7 +14,7 @@ sub run { assert_script_run('/root/test.py -a checkdefaults -w whitelist'); # Upload modular logs - upload_logs '/root/modular.log', failok=>1; + upload_logs '/root/modular.log', failok => 1; } 1; diff --git a/tests/modularity_enable_disable_module.pm b/tests/modularity_enable_disable_module.pm index f92556bd..8529c2f5 100644 --- a/tests/modularity_enable_disable_module.pm +++ b/tests/modularity_enable_disable_module.pm @@ -5,10 +5,10 @@ use testapi; use utils; sub run { - my $self=shift; + my $self = shift; my $hook_run = 0; # switch to tty and login as root - $self->root_console(tty=>3); + $self->root_console(tty => 3); # Enable the module. my $name = "swig"; @@ -28,7 +28,7 @@ sub run { if (is_listed($name, $stream, \@disabled_modules)) { die "The enabled module is listed in the list of disabled modules but it should not be."; } - + # Disable some other module. my $name_alt = "postgresql"; my $stream_alt = "14"; @@ -50,7 +50,7 @@ sub run { # Reset the first module to its original state and do the list checks. assert_script_run("dnf module reset -y $name"); - + # Check that the module has disappeared from both the lists. $disabled = script_output('dnf module list --disabled'); @disabled_modules = parse_module_list($disabled); diff --git a/tests/modularity_install_module.pm b/tests/modularity_install_module.pm index b16f39ed..5a5c2a9d 100644 --- a/tests/modularity_install_module.pm +++ b/tests/modularity_install_module.pm @@ -5,9 +5,9 @@ use testapi; use utils; sub run { - my $self=shift; + my $self = shift; # switch to tty and login as root - $self->root_console(tty=>3); + $self->root_console(tty => 3); # Install a Ruby module. my $name = "nodejs"; @@ -30,7 +30,7 @@ sub run { unless ($found) { die "The installed module is not listed in the list of enabled modules but it should be."; } - + # Remove the module again. assert_script_run("dnf module remove -y $name:$stream"); diff --git a/tests/modularity_module_list.pm b/tests/modularity_module_list.pm index d3c61b9e..11fd3183 100644 --- a/tests/modularity_module_list.pm +++ b/tests/modularity_module_list.pm @@ -5,9 +5,9 @@ use testapi; use utils; sub run { - my $self=shift; + my $self = shift; # switch to tty and login as root - $self->root_console(tty=>3); + $self->root_console(tty => 3); # The test case will check that dnf has modular functions and that # it is possible to invoke modular commands to work with modularity. diff --git a/tests/modularity_update_norepo.pm b/tests/modularity_update_norepo.pm index d418532e..60b69aac 100644 --- a/tests/modularity_update_norepo.pm +++ b/tests/modularity_update_norepo.pm @@ -5,9 +5,9 @@ use utils; use modularity; sub run { - my $self=shift; + my $self = shift; # switch to tty and login as root - $self->root_console(tty=>3); + $self->root_console(tty => 3); # Update the system assert_script_run('dnf update -y'); diff --git a/tests/os_release.pm b/tests/os_release.pm index 5d53684e..5968164b 100644 --- a/tests/os_release.pm +++ b/tests/os_release.pm @@ -6,188 +6,190 @@ use utils; # This test checks that the descriptions in /etc/os-release file are correct and that they # match the current version. sub strip_marks { - # Remove the quotation marks from the string: - my $string = shift; - $string=~ tr/"//d; - return $string; + # Remove the quotation marks from the string: + my $string = shift; + $string =~ tr/"//d; + return $string; } sub run { - # First, let us define some variables needed to run the program. - my $self = shift; - # The file to be checked - my $filename = '/etc/os-release'; + # First, let us define some variables needed to run the program. + my $self = shift; + # The file to be checked + my $filename = '/etc/os-release'; - # Read the content of the file to compare. Let us parse the file - # and create a hash with those values, so that we can easily access - # them and assert them. - my $infile = script_output "cat /etc/os-release"; - my @infile = split /\n/, $infile; - my %content = (); - foreach (@infile) { - chomp $_; - my ($key, $value) = split /=/, $_; - $content{$key} = $value; + # Read the content of the file to compare. Let us parse the file + # and create a hash with those values, so that we can easily access + # them and assert them. + my $infile = script_output "cat /etc/os-release"; + my @infile = split /\n/, $infile; + my %content = (); + foreach (@infile) { + chomp $_; + my ($key, $value) = split /=/, $_; + $content{$key} = $value; + } + + # Now, we have all the data ready and we can start testing, first let us get + # correct variables to compare the system data with. + # First, we know the basic stuff + # Should be "fedora" + my $id = get_var("DISTRI"); + # extract expected version components from ISO name for canned variants, + # which have their os-release rewritten by rpm-ostree, see: + # https://github.com/projectatomic/rpm-ostree/blob/master/docs/manual/treefile.md + # we use the ISO name because rpm-ostree uses elements from the compose + # ID for nightlies, but from the label for candidate composes; BUILD + # always gives us the compose ID, but the ISO name contains the compose + # ID for nightlies but the label for candidate composes, so it works for + # our purposes here. + my $isovar = get_var("ISO"); + # Split the ISO variable at "-" and read second-to-last (release + # number) and last (compose ID: date and respin, label: major and + # minor) fields. + my ($cannedver, $cannednum) = (split /-/, $isovar)[-2, -1]; + # Get rid of the ".iso" part of the tag. + $cannednum =~ s/\.iso//g; + # Now, we merge the fields into one expression to create the correct canned tag + # that will contain both the version number and the build number. + my $cannedtag = "$cannedver.$cannednum"; + # If this is a CoreOS build, though, throw all that away and + # just use the build version + my $build = get_var("BUILD"); + if ($build =~ /^Fedora-CoreOS/) { + $cannedtag = (split /-/, $build)[-1]; + } + my $name = ucfirst($id); + # from F35 onwards, $NAME is "Fedora Linux" not just "Fedora" + my $relnum = get_release_number; + my $fullname = $relnum > 34 ? $name . " Linux" : $name; + my $rawrel = get_var("RAWREL", ''); + # Should be the version number or Rawhide. + my $version_id = get_var("VERSION"); + # IoT has a branch that acts more or less like Rawhide, but has + # its version as the Rawhide release number, not 'Rawhide'. This + # handles that + $version_id = 'Rawhide' if ($version_id eq $rawrel); + my $varstr = spell_version_number($version_id); + my $target = lc($version_id); + $version_id = $rawrel if ($version_id eq "Rawhide"); + + # the 'generic' os-release in fedora-release has no VARIANT or + # VARIANT_ID and the string used in values like VERSION, that in other + # cases is the VARIANT, is 'Rawhide' for Rawhide and the spelt version + # number for other releases. These are the values we'll see for an + # Everything image. + my $variant_id = ""; + my $variant = "generic"; + + # now replace the values with the correct ones if we are testing a + # subvariant that maps to a known variant + my $subvariant = get_var('SUBVARIANT'); + my %variants = ( + Server => ["server", "Server Edition"], + Workstation => ["workstation", "Workstation Edition"], + AtomicHost => ["atomic.host", "Atomic Host"], + CoreOS => ["coreos", "CoreOS"], + KDE => ["kde", "KDE Plasma"], + Silverblue => ["silverblue", "Silverblue"], + IoT => ["iot", "IoT Edition"], + ); + if (exists($variants{$subvariant})) { + ($variant_id, $variant) = @{$variants{$subvariant}}; + $varstr = $variant; + } + + # If fedora-release-common release starts with a 0, we'll have + # "Prerelease" in varstr + my $reltag = script_output 'rpm -q fedora-release-common --qf "%{RELEASE}\n"'; + if (index($reltag, "0.") == 0) { + $varstr .= " Prerelease"; + # ...however, we shouldn't just wave this through if we're + # an RC candidate or update compose, those should never be + # done with a 0.x fedora-release-common. so let's blow up + # here if so. unless it's IoT, because IoT is weird + my $label = get_var("LABEL"); + if ($label =~ /^(RC|Update)-/ && $subvariant ne "IoT") { + die "RC candidate or update compose should not have 0.x versioned fedora-release!"; } - - # Now, we have all the data ready and we can start testing, first let us get - # correct variables to compare the system data with. - # First, we know the basic stuff - my $id = get_var("DISTRI"); # Should be "fedora" - # extract expected version components from ISO name for canned variants, - # which have their os-release rewritten by rpm-ostree, see: - # https://github.com/projectatomic/rpm-ostree/blob/master/docs/manual/treefile.md - # we use the ISO name because rpm-ostree uses elements from the compose - # ID for nightlies, but from the label for candidate composes; BUILD - # always gives us the compose ID, but the ISO name contains the compose - # ID for nightlies but the label for candidate composes, so it works for - # our purposes here. - my $isovar = get_var("ISO"); - # Split the ISO variable at "-" and read second-to-last (release - # number) and last (compose ID: date and respin, label: major and - # minor) fields. - my ($cannedver, $cannednum) = (split /-/, $isovar)[-2, -1]; - # Get rid of the ".iso" part of the tag. - $cannednum =~ s/\.iso//g; - # Now, we merge the fields into one expression to create the correct canned tag - # that will contain both the version number and the build number. - my $cannedtag = "$cannedver.$cannednum"; - # If this is a CoreOS build, though, throw all that away and - # just use the build version - my $build = get_var("BUILD"); + } + my $version = "$version_id ($varstr)"; + # for canned variants, we need to form a different string here by using + # the above created cannedtag. See earlier comment + if (get_var("CANNED")) { + $version = "$cannedtag ($varstr)"; + } + my $platform_id = "platform:f$version_id"; + my $pretty = "$fullname $version_id ($varstr)"; + # Same problem is when testing the PRETTY_NAME. + if (get_var("CANNED")) { + $pretty = "$fullname $cannedtag ($varstr)"; + # ...and FCOS uses a different format, sigh if ($build =~ /^Fedora-CoreOS/) { - $cannedtag = (split /-/, $build)[-1]; + $pretty = "Fedora CoreOS $cannedtag"; } - my $name = ucfirst($id); - # from F35 onwards, $NAME is "Fedora Linux" not just "Fedora" - my $relnum = get_release_number; - my $fullname = $relnum > 34 ? $name . " Linux" : $name; - my $rawrel = get_var("RAWREL", ''); - my $version_id = get_var("VERSION"); # Should be the version number or Rawhide. - # IoT has a branch that acts more or less like Rawhide, but has - # its version as the Rawhide release number, not 'Rawhide'. This - # handles that - $version_id = 'Rawhide' if ($version_id eq $rawrel); - my $varstr = spell_version_number($version_id); - my $target = lc($version_id); - $version_id = $rawrel if ($version_id eq "Rawhide"); + } - # the 'generic' os-release in fedora-release has no VARIANT or - # VARIANT_ID and the string used in values like VERSION, that in other - # cases is the VARIANT, is 'Rawhide' for Rawhide and the spelt version - # number for other releases. These are the values we'll see for an - # Everything image. - my $variant_id = ""; - my $variant = "generic"; + #Now. we can start testing the real values from the installed system. + my @fails = (); + my $failref = \@fails; - # now replace the values with the correct ones if we are testing a - # subvariant that maps to a known variant - my $subvariant = get_var('SUBVARIANT'); - my %variants = ( - Server => ["server", "Server Edition"], - Workstation => ["workstation", "Workstation Edition"], - AtomicHost => ["atomic.host", "Atomic Host"], - CoreOS => ["coreos", "CoreOS"], - KDE => ["kde", "KDE Plasma"], - Silverblue => ["silverblue", "Silverblue"], - IoT => ["iot", "IoT Edition"], - ); - if (exists($variants{$subvariant})) { - ($variant_id, $variant) = @{$variants{$subvariant}}; - $varstr = $variant; - } + # Test for name + my $strip = strip_marks($content{'NAME'}); + rec_log "NAME should be $fullname and is $strip", $strip eq $fullname, $failref; - # If fedora-release-common release starts with a 0, we'll have - # "Prerelease" in varstr - my $reltag = script_output 'rpm -q fedora-release-common --qf "%{RELEASE}\n"'; - if (index($reltag, "0.") == 0) { - $varstr .= " Prerelease"; - # ...however, we shouldn't just wave this through if we're - # an RC candidate or update compose, those should never be - # done with a 0.x fedora-release-common. so let's blow up - # here if so. unless it's IoT, because IoT is weird - my $label = get_var("LABEL"); - if ($label =~ /^(RC|Update)-/ && $subvariant ne "IoT") { - die "RC candidate or update compose should not have 0.x versioned fedora-release!"; - } - } - my $version = "$version_id ($varstr)"; - # for canned variants, we need to form a different string here by using - # the above created cannedtag. See earlier comment - if (get_var("CANNED")) { - $version = "$cannedtag ($varstr)"; - } - my $platform_id = "platform:f$version_id"; - my $pretty = "$fullname $version_id ($varstr)"; - # Same problem is when testing the PRETTY_NAME. - if (get_var("CANNED")) { - $pretty = "$fullname $cannedtag ($varstr)"; - # ...and FCOS uses a different format, sigh - if ($build =~ /^Fedora-CoreOS/) { - $pretty = "Fedora CoreOS $cannedtag"; - } - } + # Test for version. + $strip = strip_marks($content{'VERSION'}); + rec_log "VERSION should be $version and is $strip", $strip eq $version, $failref; - #Now. we can start testing the real values from the installed system. - my @fails = (); - my $failref =\@fails; + # Test for version_id + rec_log "VERSION_ID should be $version_id and is $content{'VERSION_ID'}", $content{'VERSION_ID'} eq $version_id, $failref; - # Test for name - my $strip = strip_marks($content{'NAME'}); - rec_log "NAME should be $fullname and is $strip", $strip eq $fullname, $failref; + # Test for platform_id + $strip = strip_marks($content{'PLATFORM_ID'}); + rec_log "PLATFORM_ID should be $platform_id and is $strip", $strip eq $platform_id, $failref; - # Test for version. - $strip = strip_marks($content{'VERSION'}); - rec_log "VERSION should be $version and is $strip", $strip eq $version, $failref; + # Test for pretty name + $strip = strip_marks($content{'PRETTY_NAME'}); + rec_log "PRETTY_NAME should be $pretty and is $strip", $strip eq $pretty, $failref; - # Test for version_id - rec_log "VERSION_ID should be $version_id and is $content{'VERSION_ID'}", $content{'VERSION_ID'} eq $version_id, $failref; + # Test for RH Bugzilla Product + $strip = strip_marks($content{'REDHAT_BUGZILLA_PRODUCT'}); + rec_log "REDHAT_BUGZILLA_PRODUCT should be $name and is $strip", $strip eq $name, $failref; - # Test for platform_id - $strip = strip_marks($content{'PLATFORM_ID'}); - rec_log "PLATFORM_ID should be $platform_id and is $strip", $strip eq $platform_id, $failref; + # Test for RH Bugzilla Product Version + rec_log "REDHAT_BUGZILLA_PRODUCT_VERSION should be $target and is $content{'REDHAT_BUGZILLA_PRODUCT_VERSION'}", $content{'REDHAT_BUGZILLA_PRODUCT_VERSION'} eq $target, $failref; - # Test for pretty name - $strip = strip_marks($content{'PRETTY_NAME'}); - rec_log "PRETTY_NAME should be $pretty and is $strip", $strip eq $pretty, $failref; + # Test for RH Support Product + $strip = strip_marks($content{'REDHAT_SUPPORT_PRODUCT'}); + rec_log "REDHAT_SUPPORT_PRODUCT should be $name and is $strip", $strip eq $name, $failref; - # Test for RH Bugzilla Product - $strip = strip_marks($content{'REDHAT_BUGZILLA_PRODUCT'}); - rec_log "REDHAT_BUGZILLA_PRODUCT should be $name and is $strip", $strip eq $name, $failref; + # Test for RH Support Product Version + rec_log "REDHAT_SUPPORT_PRODUCT_VERSION should be $target and is $content{'REDHAT_SUPPORT_PRODUCT_VERSION'}", $content{'REDHAT_SUPPORT_PRODUCT_VERSION'} eq $target, $failref; - # Test for RH Bugzilla Product Version - rec_log "REDHAT_BUGZILLA_PRODUCT_VERSION should be $target and is $content{'REDHAT_BUGZILLA_PRODUCT_VERSION'}", $content{'REDHAT_BUGZILLA_PRODUCT_VERSION'} eq $target, $failref; + # Test for Variant but only in case of Server or Workstation + if ($variant ne "generic") { + $strip = strip_marks($content{'VARIANT'}); + rec_log "VARIANT should be $variant and is $strip", $strip eq $variant, $failref; - # Test for RH Support Product - $strip = strip_marks($content{'REDHAT_SUPPORT_PRODUCT'}); - rec_log "REDHAT_SUPPORT_PRODUCT should be $name and is $strip", $strip eq $name, $failref; + # Test for VARIANT_ID + rec_log "VARIANT_ID should be $variant_id and is $content{'VARIANT_ID'}", $content{'VARIANT_ID'} eq $variant_id, $failref; + } + else { + print "VARIANT was not tested because the compose is not Workstation or Server Edition.\n"; + print "VARIANT_ID was not tested because the compose is not Workstation or Server Edition.\n"; + } - # Test for RH Support Product Version - rec_log "REDHAT_SUPPORT_PRODUCT_VERSION should be $target and is $content{'REDHAT_SUPPORT_PRODUCT_VERSION'}", $content{'REDHAT_SUPPORT_PRODUCT_VERSION'} eq $target, $failref; + # Check for fails, count them, collect their messages and die if something was found. + my $failcount = scalar @fails; + script_run "echo \"There were $failcount failures in total.\" >> /tmp/os-release.log"; + upload_logs "/tmp/os-release.log", failok => 1; - # Test for Variant but only in case of Server or Workstation - if ($variant ne "generic") { - $strip = strip_marks($content{'VARIANT'}); - rec_log "VARIANT should be $variant and is $strip", $strip eq $variant, $failref; - - # Test for VARIANT_ID - rec_log "VARIANT_ID should be $variant_id and is $content{'VARIANT_ID'}", $content{'VARIANT_ID'} eq $variant_id, $failref; - } - else { - print "VARIANT was not tested because the compose is not Workstation or Server Edition.\n"; - print "VARIANT_ID was not tested because the compose is not Workstation or Server Edition.\n"; - } - - # Check for fails, count them, collect their messages and die if something was found. - my $failcount = scalar @fails; - script_run "echo \"There were $failcount failures in total.\" >> /tmp/os-release.log"; - upload_logs "/tmp/os-release.log", failok=>1; - - my $failmessages = ""; - foreach my $fail (@fails) { - $failmessages .= "\n".$fail; - } - die $failmessages if ($failcount > 0); + my $failmessages = ""; + foreach my $fail (@fails) { + $failmessages .= "\n" . $fail; + } + die $failmessages if ($failcount > 0); } sub test_flags { diff --git a/tests/podman.pm b/tests/podman.pm index 5cd44fae..435d2d07 100644 --- a/tests/podman.pm +++ b/tests/podman.pm @@ -8,7 +8,7 @@ use utils; sub run { my $self = shift; - $self->root_console(tty=>3); + $self->root_console(tty => 3); # on non-canned flavors, we need to install podman assert_script_run "dnf -y install podman", 180 unless (get_var("CANNED")); # check podman is installed @@ -44,7 +44,7 @@ sub run { sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/preinstall_iso_in_hd.pm b/tests/preinstall_iso_in_hd.pm index 5b50e954..cd580788 100644 --- a/tests/preinstall_iso_in_hd.pm +++ b/tests/preinstall_iso_in_hd.pm @@ -8,17 +8,17 @@ sub run { # select rescue shell and expect shell prompt type_string "3\n"; send_key "ret"; - assert_screen "root_console", 5; # should be shell prompt + assert_screen "root_console", 5; # should be shell prompt assert_script_run "fdisk -l | head -n20"; assert_script_run "mkdir -p /hd"; assert_script_run "mount /dev/vdb1 /hd"; copy_devcdrom_as_isofile('/hd/fedora_image.iso'); assert_script_run "umount /hd"; - type_string "exit\n"; # leave rescue mode. + type_string "exit\n"; # leave rescue mode. } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/realmd_join_cockpit.pm b/tests/realmd_join_cockpit.pm index 2b6ba948..81b15f04 100644 --- a/tests/realmd_join_cockpit.pm +++ b/tests/realmd_join_cockpit.pm @@ -42,7 +42,7 @@ sub run { # didn't work, try again a few times my $count = 4; while ($count > 0) { - assert_and_click "cockpit_join_domain_button", timeout=>5; + assert_and_click "cockpit_join_domain_button", timeout => 5; last if (check_screen "cockpit_join_domain", 30); } assert_screen "cockpit_join_domain"; @@ -67,7 +67,7 @@ sub run { } sub test_flags { - return { fatal => 1, milestone => 1 }; + return {fatal => 1, milestone => 1}; } 1; diff --git a/tests/realmd_join_sssd.pm b/tests/realmd_join_sssd.pm index e6c6b615..911a03f9 100644 --- a/tests/realmd_join_sssd.pm +++ b/tests/realmd_join_sssd.pm @@ -7,7 +7,7 @@ use tapnet; use utils; sub run { - my $self=shift; + my $self = shift; # use FreeIPA server or replica as DNS server my $server = 'ipa001.test.openqa.fedoraproject.org'; my $server_ip = '172.16.2.100'; @@ -86,7 +86,7 @@ sub run { } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/rescue_mode_encrypted.pm b/tests/rescue_mode_encrypted.pm index 2394c709..c922a32b 100644 --- a/tests/rescue_mode_encrypted.pm +++ b/tests/rescue_mode_encrypted.pm @@ -7,10 +7,10 @@ sub run { select_rescue_mode; # continue type_string "1\n"; - assert_screen "rescue_enter_pass", 60; # it might take time to scan all disks + assert_screen "rescue_enter_pass", 60; # it might take time to scan all disks type_string get_var("ENCRYPT_PASSWORD", "weakpassword"); send_key "ret"; - assert_screen "rescue_mounted", 60; # it also might take time to mount disk + assert_screen "rescue_mounted", 60; # it also might take time to mount disk send_key "ret"; # check whether disk was mounted @@ -24,7 +24,7 @@ sub run { sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/role_deploy_database_server.pm b/tests/role_deploy_database_server.pm index 7d81c3ac..8d4d148d 100644 --- a/tests/role_deploy_database_server.pm +++ b/tests/role_deploy_database_server.pm @@ -7,7 +7,7 @@ use tapnet; use utils; sub run { - my $self=shift; + my $self = shift; # use compose repo, disable u-t, etc. repo_setup(); # deploy postgres directly ourselves. first, install packages... @@ -48,10 +48,10 @@ sub run { # check we can add a row to the table assert_script_run 'su postgres -c "psql openqa -c \'INSERT INTO test VALUES (5);\'"'; # check we can query the table - validate_script_output 'su postgres -c "psql openqa -c \'SELECT * FROM test;\'"', sub {$_ =~ m/^ *testcol.*5.*1 row/s }; + validate_script_output 'su postgres -c "psql openqa -c \'SELECT * FROM test;\'"', sub { $_ =~ m/^ *testcol.*5.*1 row/s }; # check we can modify the row assert_script_run 'su postgres -c "psql openqa -c \'UPDATE test SET testcol = 50 WHERE testcol = 5;\'"'; - validate_script_output 'su postgres -c "psql openqa -c \'SELECT * FROM test;\'"', sub {$_ =~ m/^ *testcol.*50.*1 row/s }; + validate_script_output 'su postgres -c "psql openqa -c \'SELECT * FROM test;\'"', sub { $_ =~ m/^ *testcol.*50.*1 row/s }; # we're all ready for other jobs to run! mutex_create('db_ready'); wait_for_children; @@ -67,7 +67,7 @@ sub run { sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/role_deploy_domain_controller.pm b/tests/role_deploy_domain_controller.pm index 53b3f37b..35ec6a6f 100644 --- a/tests/role_deploy_domain_controller.pm +++ b/tests/role_deploy_domain_controller.pm @@ -77,7 +77,7 @@ sub run { sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/role_deploy_domain_controller_check.pm b/tests/role_deploy_domain_controller_check.pm index 0597edaa..6ba2f0be 100644 --- a/tests/role_deploy_domain_controller_check.pm +++ b/tests/role_deploy_domain_controller_check.pm @@ -43,7 +43,7 @@ sub run { sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/server_cockpit_autoupdate.pm b/tests/server_cockpit_autoupdate.pm index 56e15b21..3a066163 100644 --- a/tests/server_cockpit_autoupdate.pm +++ b/tests/server_cockpit_autoupdate.pm @@ -6,7 +6,7 @@ use packagetest; use cockpit; sub run { - my $self=shift; + my $self = shift; # Start Cockpit start_cockpit(1); @@ -37,11 +37,11 @@ sub run { assert_script_run "systemctl is-active dnf-automatic-install.timer"; # Check that it is scheduled correctly - validate_script_output "systemctl show dnf-automatic-install.timer | grep TimersCalendar", sub {$_ =~ "06:00:00" }; + validate_script_output "systemctl show dnf-automatic-install.timer | grep TimersCalendar", sub { $_ =~ "06:00:00" }; } sub test_flags { - return { always_rolllback => 1 }; + return {always_rolllback => 1}; } 1; diff --git a/tests/server_cockpit_basic.pm b/tests/server_cockpit_basic.pm index f9f79c66..225e0d39 100644 --- a/tests/server_cockpit_basic.pm +++ b/tests/server_cockpit_basic.pm @@ -5,7 +5,7 @@ use utils; use cockpit; sub run { - my $self=shift; + my $self = shift; # run firefox and login to cockpit start_cockpit(1); # go to the logs screen @@ -32,7 +32,7 @@ sub run { assert_screen "cockpit_logs_detail"; # go to the services screen assert_and_click "cockpit_services"; - wait_still_screen(timeout=>90, stilltime=>5); + wait_still_screen(timeout => 90, stilltime => 5); # click on an entry assert_and_click "cockpit_services_entry"; # check we get to the appropriate detail screen...but this click @@ -42,7 +42,7 @@ sub run { } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/server_cockpit_default.pm b/tests/server_cockpit_default.pm index 6a168bc8..1785df14 100644 --- a/tests/server_cockpit_default.pm +++ b/tests/server_cockpit_default.pm @@ -17,7 +17,7 @@ sub run { } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/server_cockpit_updates.pm b/tests/server_cockpit_updates.pm index bbc7abe5..4613e4ae 100644 --- a/tests/server_cockpit_updates.pm +++ b/tests/server_cockpit_updates.pm @@ -6,7 +6,7 @@ use packagetest; use cockpit; sub run { - my $self=shift; + my $self = shift; my $cockdate = "0"; # Remove a package, disable repositories and enable test repositories, install the package @@ -27,11 +27,11 @@ sub run { # restarting the machine to continue. Also, we would have # to deal with much more complicated workflow. # - if (check_screen('cockpit_updates_security_install',1)) { - assert_and_click 'cockpit_updates_security_install'; - sleep 60; # wait until things are installed - assert_and_click 'cockpit_updates_restart_ignore'; - wait_still_screen 2; + if (check_screen('cockpit_updates_security_install', 1)) { + assert_and_click 'cockpit_updates_security_install'; + sleep 60; # wait until things are installed + assert_and_click 'cockpit_updates_restart_ignore'; + wait_still_screen 2; } @@ -74,7 +74,7 @@ sub run { } sub test_flags { - return { always_rollback => 1 }; + return {always_rollback => 1}; } 1; diff --git a/tests/server_filesystem_default.pm b/tests/server_filesystem_default.pm index dd8eb170..ad10ec29 100644 --- a/tests/server_filesystem_default.pm +++ b/tests/server_filesystem_default.pm @@ -10,7 +10,7 @@ sub run { } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/server_firewall_default.pm b/tests/server_firewall_default.pm index 083e8dc7..e67de0c5 100644 --- a/tests/server_firewall_default.pm +++ b/tests/server_firewall_default.pm @@ -3,9 +3,9 @@ use strict; use testapi; sub run { - my $self=shift; - if (not( check_screen "root_console", 0)) { - $self->root_console(tty=>3); + my $self = shift; + if (not(check_screen "root_console", 0)) { + $self->root_console(tty => 3); } # this only succeeds if the firewall is running assert_script_run 'firewall-cmd --state'; @@ -17,7 +17,7 @@ sub run { } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/server_remote_logging_client.pm b/tests/server_remote_logging_client.pm index d0da04c1..77803edb 100644 --- a/tests/server_remote_logging_client.pm +++ b/tests/server_remote_logging_client.pm @@ -4,9 +4,9 @@ use testapi; use lockapi; sub run { - my $self=shift; - if (not (check_screen "root_console", 0)) { - $self->root_console(tty=>3); + my $self = shift; + if (not(check_screen "root_console", 0)) { + $self->root_console(tty => 3); } # ensure rsyslog is installed and enabled script_run "dnf -y install rsyslog", 180; @@ -31,7 +31,7 @@ sub run { } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/server_remote_logging_server.pm b/tests/server_remote_logging_server.pm index a3d15f1d..bc9c22d9 100644 --- a/tests/server_remote_logging_server.pm +++ b/tests/server_remote_logging_server.pm @@ -5,9 +5,9 @@ use lockapi; use mmapi; sub run { - my $self=shift; - if (not (check_screen "root_console", 0)) { - $self->root_console(tty=>3); + my $self = shift; + if (not(check_screen "root_console", 0)) { + $self->root_console(tty => 3); } # ensure rsyslog is installed and enabled script_run "dnf -y install rsyslog", 180; @@ -33,7 +33,7 @@ sub run { } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/text_login_gui.pm b/tests/text_login_gui.pm index 41028578..a7d4ce83 100644 --- a/tests/text_login_gui.pm +++ b/tests/text_login_gui.pm @@ -7,11 +7,11 @@ sub run { my $self = shift; boot_to_login_screen(timeout => 300); - $self->root_console(tty=>3); + $self->root_console(tty => 3); } sub test_flags { - return { fatal => 1, milestone => 1 }; + return {fatal => 1, milestone => 1}; } 1; # vim: set sw=4 et: diff --git a/tests/uefi_postinstall.pm b/tests/uefi_postinstall.pm index f0accb6b..9b458a3c 100644 --- a/tests/uefi_postinstall.pm +++ b/tests/uefi_postinstall.pm @@ -4,9 +4,9 @@ use testapi; use utils; sub run { - my $self=shift; - if (not( check_screen "root_console", 0)) { - $self->root_console(tty=>4); + my $self = shift; + if (not(check_screen "root_console", 0)) { + $self->root_console(tty => 4); } assert_screen "root_console"; # for aarch64 non-english tests @@ -16,7 +16,7 @@ sub run { } sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/unwanted_packages.pm b/tests/unwanted_packages.pm index 2c258798..c9a07122 100644 --- a/tests/unwanted_packages.pm +++ b/tests/unwanted_packages.pm @@ -6,7 +6,7 @@ use utils; sub run { my $self = shift; # switch to TTY3 for both, graphical and console tests - $self->root_console(tty=>3); + $self->root_console(tty => 3); my @unwanteds; my $subv = get_var("SUBVARIANT"); if ($subv eq "Workstation") { @@ -19,7 +19,7 @@ sub run { sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/upgrade_boot.pm b/tests/upgrade_boot.pm index 597dc5ae..1988411c 100644 --- a/tests/upgrade_boot.pm +++ b/tests/upgrade_boot.pm @@ -7,7 +7,7 @@ sub run { my $self = shift; # handle bootloader, if requested if (get_var("GRUB_POSTINSTALL")) { - do_bootloader(postinstall=>1, params=>get_var("GRUB_POSTINSTALL")); + do_bootloader(postinstall => 1, params => get_var("GRUB_POSTINSTALL")); } # decrypt disks during boot if necessary @@ -17,7 +17,7 @@ sub run { boot_to_login_screen; # switch to TTY3 for both, graphical and console tests - $self->root_console(tty=>3); + $self->root_console(tty => 3); # disable screen blanking (update can take a long time) script_run "setterm -blank 0"; # adjust repo files to use mirrorlist not metalink (to avoid @@ -27,7 +27,7 @@ sub run { sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/upgrade_postinstall.pm b/tests/upgrade_postinstall.pm index ed1d3f00..e3c95358 100644 --- a/tests/upgrade_postinstall.pm +++ b/tests/upgrade_postinstall.pm @@ -6,7 +6,7 @@ use utils; sub run { my $self = shift; # try to login, check whether target release is installed - $self->root_console(tty=>3); + $self->root_console(tty => 3); my $version = lc(get_var('VERSION')); my $rawrel = get_var('RAWREL'); # if VERSION is the Rawhide release number (happens for Rawhide @@ -17,7 +17,7 @@ sub run { sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/upgrade_preinstall.pm b/tests/upgrade_preinstall.pm index 47d9e4b2..76ee830f 100644 --- a/tests/upgrade_preinstall.pm +++ b/tests/upgrade_preinstall.pm @@ -19,7 +19,7 @@ sub run { # handle bootloader, if requested if (get_var("GRUB_POSTINSTALL")) { - do_bootloader(postinstall=>1, params=>get_var("GRUB_POSTINSTALL"), timeout=>120); + do_bootloader(postinstall => 1, params => get_var("GRUB_POSTINSTALL"), timeout => 120); } # decrypt if necessary @@ -28,7 +28,7 @@ sub run { } boot_to_login_screen; - $self->root_console(tty=>3); + $self->root_console(tty => 3); my $update_command = 'dnf -y install dnf-plugin-system-upgrade'; assert_script_run $update_command, 600; @@ -36,7 +36,7 @@ sub run { sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/upgrade_run.pm b/tests/upgrade_run.pm index d46b5a34..1a5a9a19 100644 --- a/tests/upgrade_run.pm +++ b/tests/upgrade_run.pm @@ -39,7 +39,7 @@ sub run { # handle bootloader, if requested; set longer timeout as sometimes # reboot here seems to take a long time if (get_var("GRUB_POSTINSTALL")) { - do_bootloader(postinstall=>1, params=>get_var("GRUB_POSTINSTALL"), timeout=>120); + do_bootloader(postinstall => 1, params => get_var("GRUB_POSTINSTALL"), timeout => 120); } # decrypt, if encrypted @@ -54,7 +54,7 @@ sub run { sub test_flags { - return { fatal => 1 }; + return {fatal => 1}; } 1; diff --git a/tests/workstation_core_applications.pm b/tests/workstation_core_applications.pm index cdff0207..29b6a541 100644 --- a/tests/workstation_core_applications.pm +++ b/tests/workstation_core_applications.pm @@ -7,7 +7,7 @@ use utils; sub run { my $self = shift; - $self->root_console(tty=>3); + $self->root_console(tty => 3); # List of applications, that we want to track for their presence. my @core_applications = ("gnome-software", "firefox", "gnome-terminal", "nautilus", "gnome-text-editor", "gnome-boxes"); @@ -17,7 +17,7 @@ sub run { my $failed; foreach my $app (@core_applications) { # @utils::application_list here is the list of registered apps - if (grep {$_ eq $app} @utils::application_list) { + if (grep { $_ eq $app } @utils::application_list) { assert_script_run "echo '$app=passed' >> registered.log"; } else { @@ -25,7 +25,7 @@ sub run { $failed = 1; } } - upload_logs "registered.log", failok=>1; + upload_logs "registered.log", failok => 1; die "Some core applications could not be started. Check logs." if ($failed); } diff --git a/tidy b/tidy new file mode 100755 index 00000000..683aaf20 --- /dev/null +++ b/tidy @@ -0,0 +1,61 @@ +#!/bin/bash + +# +# perltidy rules can be found in ../.perltidyrc +# +usage() { + cat << EOF +Usage: + tidy [-c|--check] [-f|--force] [-o|--only-changed] [-l|--list] [path/to/file] + +Options: + -h, -?, --help display this help + -c, --check Only check for style check differences + -f, --force Force check even if tidy version mismatches + -o --only-changed Only tidy files with uncommitted changes in git. This can + speed up execution a lot. +-l --list List files tidy would touch + path/to/file When passing a file as argument, tidy will run perltidy + wether it is added to the git tree or not + +perltidy rules can be found in .perltidyrc +EOF + exit +} + +set -eo pipefail +dir="$(dirname "$0")" + +args="" +selection='--all' +[[ -e "$dir/perlfiles" ]] && selection=$("$dir"/perlfiles) +opts=$(getopt -o hcfol --long help,check,force,only-changed,list -n "$0" -- "$@") || usage +eval set -- "$opts" +while true; do + case "$1" in + -h | --help ) usage; shift ;; + -c | --check ) args+=' --check-only'; shift ;; + -f | --force ) force=true; shift ;; + -o | --only-changed ) selection='--git'; shift ;; + -l | --list ) args+='--list'; shift ;; + -- ) shift; break ;; + * ) break ;; + esac +done + +shift $((OPTIND - 1)) +filename=${*:-"$selection"} + +if ! command -v perltidy > /dev/null 2>&1; then + echo "No perltidy found, install it first!" + exit 1 +fi + +# go to caller directory +cd "$dir" + +# just to make sure we are at the right location +test -e tidy || exit 1 + +# shellcheck disable=SC2086 +tidyall $args $filename