diff --git a/lib/utils.pm b/lib/utils.pm index 8ce235f0..8fdd0097 100644 --- a/lib/utils.pm +++ b/lib/utils.pm @@ -6,7 +6,7 @@ use base 'Exporter'; use Exporter; use lockapi; use testapi qw(is_serial_terminal :DEFAULT); -our @EXPORT = qw/run_with_error_check type_safely type_very_safely desktop_vt boot_to_login_screen console_login console_switch_layout desktop_switch_layout console_loadkeys_us do_bootloader boot_decrypt check_release menu_launch_type setup_repos repo_setup get_workarounds disable_updates_repos cleanup_workaround_repo console_initial_setup handle_welcome_screen gnome_initial_setup anaconda_create_user check_desktop quit_firefox advisory_get_installed_packages acnp_handle_output advisory_check_nonmatching_packages start_with_launcher quit_with_shortcut disable_firefox_studies select_rescue_mode copy_devcdrom_as_isofile get_release_number check_left_bar check_top_bar check_prerelease check_version spell_version_number _assert_and_click is_branched rec_log repos_mirrorlist register_application get_registered_applications desktop_launch_terminal solidify_wallpaper check_and_install_git download_testdata make_serial_writable set_update_notification_timestamp kde_doublek_workaround dm_perform_login/; +our @EXPORT = qw/run_with_error_check type_safely type_very_safely desktop_vt boot_to_login_screen console_login console_switch_layout desktop_switch_layout console_loadkeys_us do_bootloader boot_decrypt check_release menu_launch_type setup_repos repo_setup get_workarounds disable_updates_repos cleanup_workaround_repo console_initial_setup handle_welcome_screen gnome_initial_setup anaconda_create_user check_desktop quit_firefox advisory_get_installed_packages acnp_handle_output advisory_check_nonmatching_packages start_with_launcher quit_with_shortcut disable_firefox_studies select_rescue_mode copy_devcdrom_as_isofile get_release_number check_left_bar check_top_bar check_prerelease check_version spell_version_number _assert_and_click is_branched rec_log repos_mirrorlist register_application get_registered_applications desktop_launch_terminal solidify_wallpaper check_and_install_git download_testdata make_serial_writable set_update_notification_timestamp kde_doublek_workaround dm_perform_login check_errors_notifications check_errors_cli/; # We introduce this global variable to hold the list of applications that have @@ -1838,4 +1838,76 @@ sub dm_perform_login { send_key "ret"; } +# This subroutine tests the desktop notifications. +# It opens the notifications, checks the notifications are empty, +# closes them, waits some time and repeats three times. + +sub check_errors_notifications { + my $desktop = shift; + + my @count = (1 .. 3); + foreach (@count) { + # Show notifications, check that there is no problem reported, + # wait a couple seconds, then unshow notifications, wait again + # and repeat times. + if ($desktop eq "kde") { + assert_and_click("kde_show_hidden_icons"); + assert_and_click("kde_open_notifications"); + } + else { + send_key("super-v"); + } + sleep(10); + unless (check_screen("desktop_no_notifications")) { + record_soft_failure("Notifications are not empty!"); + last; + } + if ($desktop eq "kde") { + send_key("esc"); + } + else { + send_key("super-v"); + } + sleep(30); + } +} + +# This subroutine checks +sub check_errors_cli { + my ($desktop, $term) = @_; + my $sudo = get_var("ROOT_PASSWORD", "weakpassword"); + my $term = "terminal"; + if ($desktop eq "kde") { $term = "konsole"; } + + # Start terminal application and check whether something has been reported. + # Clear the terminal between commands to avoid double checking one result. + menu_launch_type($term); + wait_still_screen(5); + + type_very_safely("coredumpctl --all\n"); + assert_screen("coredump_no_coredumps"); + type_very_safely("clear\n"); + + type_very_safely("abrt-cli list\n"); + assert_screen("abrt_no_problems"); + type_very_safely("clear\n"); + + type_very_safely("sudo abrt-cli list\n"); + sleep(2); + type_string("$sudo\n"); + assert_screen("abrt_no_problems"); + type_very_safely("clear\n"); + + type_very_safely("exit\n"); + + # On KDE where SETroubleshoot is still available, + # check its results. + if ($desktop eq "kde") { + menu_launch_type("selinux"); + assert_screen("selinux_no_alerts"); + } +} + + + 1; diff --git a/needles/error_checking/abrt_no_problems-20250127.json b/needles/error_checking/abrt_no_problems-20250127.json new file mode 100644 index 00000000..9269d36f --- /dev/null +++ b/needles/error_checking/abrt_no_problems-20250127.json @@ -0,0 +1,15 @@ +{ + "area": [ + { + "xpos": 188, + "ypos": 220, + "width": 94, + "height": 21, + "type": "match" + } + ], + "properties": [], + "tags": [ + "abrt_no_problems" + ] +} \ No newline at end of file diff --git a/needles/error_checking/abrt_no_problems-20250127.png b/needles/error_checking/abrt_no_problems-20250127.png new file mode 100644 index 00000000..84d8864f Binary files /dev/null and b/needles/error_checking/abrt_no_problems-20250127.png differ diff --git a/needles/error_checking/abrt_no_problems-kde-20250127.json b/needles/error_checking/abrt_no_problems-kde-20250127.json new file mode 100644 index 00000000..e84e69f0 --- /dev/null +++ b/needles/error_checking/abrt_no_problems-kde-20250127.json @@ -0,0 +1,15 @@ +{ + "area": [ + { + "xpos": 58, + "ypos": 163, + "width": 94, + "height": 20, + "type": "match" + } + ], + "properties": [], + "tags": [ + "abrt_no_problems" + ] +} \ No newline at end of file diff --git a/needles/error_checking/abrt_no_problems-kde-20250127.png b/needles/error_checking/abrt_no_problems-kde-20250127.png new file mode 100644 index 00000000..28e3f60d Binary files /dev/null and b/needles/error_checking/abrt_no_problems-kde-20250127.png differ diff --git a/needles/error_checking/coredump_no_coredumps-20250121.json b/needles/error_checking/coredump_no_coredumps-20250121.json new file mode 100644 index 00000000..362eb78b --- /dev/null +++ b/needles/error_checking/coredump_no_coredumps-20250121.json @@ -0,0 +1,15 @@ +{ + "area": [ + { + "xpos": 188, + "ypos": 187, + "width": 154, + "height": 16, + "type": "match" + } + ], + "properties": [], + "tags": [ + "coredump_no_coredumps" + ] +} \ No newline at end of file diff --git a/needles/error_checking/coredump_no_coredumps-20250121.png b/needles/error_checking/coredump_no_coredumps-20250121.png new file mode 100644 index 00000000..80dc72c9 Binary files /dev/null and b/needles/error_checking/coredump_no_coredumps-20250121.png differ diff --git a/needles/error_checking/coredump_no_coredumps-kde.json b/needles/error_checking/coredump_no_coredumps-kde.json new file mode 100644 index 00000000..b6ddaf72 --- /dev/null +++ b/needles/error_checking/coredump_no_coredumps-kde.json @@ -0,0 +1,15 @@ +{ + "area": [ + { + "xpos": 59, + "ypos": 164, + "width": 153, + "height": 18, + "type": "match" + } + ], + "properties": [], + "tags": [ + "coredump_no_coredumps" + ] +} \ No newline at end of file diff --git a/needles/error_checking/coredump_no_coredumps-kde.png b/needles/error_checking/coredump_no_coredumps-kde.png new file mode 100644 index 00000000..28cc1188 Binary files /dev/null and b/needles/error_checking/coredump_no_coredumps-kde.png differ diff --git a/needles/error_checking/desktop_no_notifications-gnome-20250121.json b/needles/error_checking/desktop_no_notifications-gnome-20250121.json new file mode 100644 index 00000000..a77b8a15 --- /dev/null +++ b/needles/error_checking/desktop_no_notifications-gnome-20250121.json @@ -0,0 +1,16 @@ +{ + "area": [ + { + "xpos": 281, + "ypos": 386, + "width": 155, + "height": 30, + "type": "match" + } + ], + "properties": [], + "tags": [ + "DESKTOP-gnome", + "desktop_no_notifications" + ] +} \ No newline at end of file diff --git a/needles/error_checking/desktop_no_notifications-gnome-20250121.png b/needles/error_checking/desktop_no_notifications-gnome-20250121.png new file mode 100644 index 00000000..513c9e86 Binary files /dev/null and b/needles/error_checking/desktop_no_notifications-gnome-20250121.png differ diff --git a/needles/error_checking/desktop_no_notifications-kde-20250127.json b/needles/error_checking/desktop_no_notifications-kde-20250127.json new file mode 100644 index 00000000..fa75e5fa --- /dev/null +++ b/needles/error_checking/desktop_no_notifications-kde-20250127.json @@ -0,0 +1,16 @@ +{ + "area": [ + { + "ypos": 550, + "xpos": 692, + "type": "match", + "height": 17, + "width": 209 + } + ], + "properties": [], + "tags": [ + "DESKTOP-kde", + "desktop_no_notifications" + ] +} \ No newline at end of file diff --git a/needles/error_checking/desktop_no_notifications-kde-20250127.png b/needles/error_checking/desktop_no_notifications-kde-20250127.png new file mode 100644 index 00000000..611e8fe5 Binary files /dev/null and b/needles/error_checking/desktop_no_notifications-kde-20250127.png differ diff --git a/needles/error_checking/kde_open_notifications-20250127.json b/needles/error_checking/kde_open_notifications-20250127.json new file mode 100644 index 00000000..9c305322 --- /dev/null +++ b/needles/error_checking/kde_open_notifications-20250127.json @@ -0,0 +1,15 @@ +{ + "area": [ + { + "xpos": 590, + "ypos": 317, + "width": 111, + "height": 28, + "type": "match" + } + ], + "properties": [], + "tags": [ + "kde_open_notifications" + ] +} \ No newline at end of file diff --git a/needles/error_checking/kde_open_notifications-20250127.png b/needles/error_checking/kde_open_notifications-20250127.png new file mode 100644 index 00000000..c65c2a66 Binary files /dev/null and b/needles/error_checking/kde_open_notifications-20250127.png differ diff --git a/needles/error_checking/kde_open_notifications-bell.json b/needles/error_checking/kde_open_notifications-bell.json new file mode 100644 index 00000000..a9735d25 --- /dev/null +++ b/needles/error_checking/kde_open_notifications-bell.json @@ -0,0 +1,15 @@ +{ + "area": [ + { + "xpos": 728, + "ypos": 724, + "width": 23, + "height": 25, + "type": "match" + } + ], + "properties": [], + "tags": [ + "kde_open_notifications" + ] +} \ No newline at end of file diff --git a/needles/error_checking/kde_open_notifications-bell.png b/needles/error_checking/kde_open_notifications-bell.png new file mode 100644 index 00000000..9cac6924 Binary files /dev/null and b/needles/error_checking/kde_open_notifications-bell.png differ diff --git a/needles/error_checking/kde_open_notifications-selected.json b/needles/error_checking/kde_open_notifications-selected.json new file mode 100644 index 00000000..349257ed --- /dev/null +++ b/needles/error_checking/kde_open_notifications-selected.json @@ -0,0 +1,15 @@ +{ + "area": [ + { + "xpos": 590, + "ypos": 316, + "width": 110, + "height": 28, + "type": "match" + } + ], + "properties": [], + "tags": [ + "kde_open_notifications" + ] +} \ No newline at end of file diff --git a/needles/error_checking/kde_open_notifications-selected.png b/needles/error_checking/kde_open_notifications-selected.png new file mode 100644 index 00000000..c77d16ed Binary files /dev/null and b/needles/error_checking/kde_open_notifications-selected.png differ diff --git a/needles/error_checking/kde_show_hidden_icons-20250127.json b/needles/error_checking/kde_show_hidden_icons-20250127.json new file mode 100644 index 00000000..051ad14c --- /dev/null +++ b/needles/error_checking/kde_show_hidden_icons-20250127.json @@ -0,0 +1,16 @@ +{ + "area": [ + { + "ypos": 726, + "xpos": 876, + "height": 22, + "width": 23, + "type": "match", + "match": 90 + } + ], + "properties": [], + "tags": [ + "kde_show_hidden_icons" + ] +} \ No newline at end of file diff --git a/needles/error_checking/kde_show_hidden_icons-20250127.png b/needles/error_checking/kde_show_hidden_icons-20250127.png new file mode 100644 index 00000000..dcd6e638 Binary files /dev/null and b/needles/error_checking/kde_show_hidden_icons-20250127.png differ diff --git a/needles/error_checking/selinux_no_alerts-20250127.json b/needles/error_checking/selinux_no_alerts-20250127.json new file mode 100644 index 00000000..dd027766 --- /dev/null +++ b/needles/error_checking/selinux_no_alerts-20250127.json @@ -0,0 +1,22 @@ +{ + "area": [ + { + "xpos": 441, + "ypos": 238, + "width": 139, + "height": 20, + "type": "match" + }, + { + "xpos": 146, + "ypos": 271, + "width": 69, + "height": 21, + "type": "match" + } + ], + "properties": [], + "tags": [ + "selinux_no_alerts" + ] +} \ No newline at end of file diff --git a/needles/error_checking/selinux_no_alerts-20250127.png b/needles/error_checking/selinux_no_alerts-20250127.png new file mode 100644 index 00000000..563897d6 Binary files /dev/null and b/needles/error_checking/selinux_no_alerts-20250127.png differ diff --git a/templates.fif.json b/templates.fif.json index 05e3d4c6..fe3c0c4f 100644 --- a/templates.fif.json +++ b/templates.fif.json @@ -1458,6 +1458,24 @@ "START_AFTER_TEST": "%DEPLOY_UPLOAD_TEST%" } }, + "error_checking": { + "profiles": { + "fedora-KDE-live-iso-x86_64-*-64bit": 32, + "fedora-Workstation-live-iso-ppc64le-*-ppc64le": 30, + "fedora-Workstation-live-iso-x86_64-*-64bit": 30, + "fedora-Workstation-live_osbuild-iso-x86_64-*-64bit": 70, + "fedora-Workstation-upgrade-x86_64-*-64bit": 40, + "fedora-Workstation-upgrade-aarch64-*-aarch64": 40, + "fedora-Workstation-raw_xz-raw.xz-aarch64-*-aarch64": 32, + "fedora-Workstation-live-iso-x86_64-*-64bit": 30 + }, + "settings": { + "BOOTFROM": "c", + "HDD_1": "disk_%FLAVOR%_%MACHINE%.qcow2", + "POSTINSTALL": "error_checks", + "START_AFTER_TEST": "%DEPLOY_UPLOAD_TEST%" + } + }, "i3_tiling": { "profiles": { "fedora-i3-live-x86_64-*-64bit": 70 @@ -1785,6 +1803,17 @@ "PARTITIONING": "guided_delete_all" } }, + "install_error_checking": { + "profiles": { + "fedora-KDE-live-iso-x86_64-*-bios": 16, + "fedora-Workstation-live-iso-x86_64-*-bios": 11 + }, + "settings": { + "PACKAGE_SET": "default", + "POSTINSTALL": "_collect_data", + "ERROR_CHECK": "1" + } + }, "install_european_language": { "profiles": { "fedora-Server-dvd-iso-aarch64-*-aarch64": 40, diff --git a/tests/_do_install_and_reboot.pm b/tests/_do_install_and_reboot.pm index 264f1bc2..fa941cc9 100644 --- a/tests/_do_install_and_reboot.pm +++ b/tests/_do_install_and_reboot.pm @@ -108,6 +108,14 @@ sub run { assert_screen "anaconda_install_done"; # wait for transition to complete so we don't click in the sidebar wait_still_screen 3; + # If error checking is ordered, perform the routines to see + # whether any notifications or error reports have been triggered + # during the installation. + if (get_var("ERROR_CHECK")) { + my $desktop = get_var("DESKTOP"); + check_errors_notifications($desktop); + check_errors_cli(get_var($desktop)); + } # if this is a live install, let's go ahead and quit the installer # in all cases, just to make sure quitting doesn't crash etc. # not on web UI, as it immediately reboots diff --git a/tests/error_checks.pm b/tests/error_checks.pm new file mode 100644 index 00000000..fb619b60 --- /dev/null +++ b/tests/error_checks.pm @@ -0,0 +1,32 @@ +use base "installedtest"; +use strict; +use testapi; +use utils; + + +# This test checks that no errors are reported through automated tools after installation. +# Currently, this checks for anything in system notifications, coredumpctl, and abrt-cli. +# The test fails if anything is reported by these tools. +# + +sub clear { + type_very_safely("clear\n"); + sleep(2); +} + +sub run { + my $self = shift; + my $desktop = get_var("DESKTOP", "gnome"); + + check_errors_notifications($desktop); + + check_errors_cli($desktop); +} + +sub test_flags { + return {fatal => 1}; +} + +1; + +# vim: set sw=4 et: