diff --git a/lib/utils.pm b/lib/utils.pm index c3296578..397d253a 100644 --- a/lib/utils.pm +++ b/lib/utils.pm @@ -5,9 +5,10 @@ use strict; use base 'Exporter'; use Exporter; +use feature "switch"; use lockapi; use testapi; -our @EXPORT = qw/run_with_error_check type_safely type_very_safely desktop_vt boot_to_login_screen console_login console_switch_layout desktop_switch_layout console_loadkeys_us do_bootloader boot_decrypt check_release menu_launch_type repo_setup setup_workaround_repo cleanup_workaround_repo console_initial_setup handle_welcome_screen gnome_initial_setup anaconda_create_user check_desktop download_modularity_tests quit_firefox advisory_get_installed_packages advisory_check_nonmatching_packages start_with_launcher quit_with_shortcut lo_dismiss_tip 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 click_unwanted_notifications repos_mirrorlist register_application get_registered_applications solidify_wallpaper/; +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 repo_setup setup_workaround_repo cleanup_workaround_repo console_initial_setup handle_welcome_screen gnome_initial_setup anaconda_create_user check_desktop download_modularity_tests quit_firefox advisory_get_installed_packages advisory_check_nonmatching_packages start_with_launcher quit_with_shortcut lo_dismiss_tip disable_firefox_studies select_rescue_mode copy_devcdrom_as_isofile get_release_number get_code_name check_left_bar check_top_bar check_prerelease check_version spell_version_number _assert_and_click is_branched rec_log click_unwanted_notifications repos_mirrorlist register_application get_registered_applications solidify_wallpaper/; # We introduce this global variable to hold the list of applications that have # registered during the apps_startstop_test when they have sucessfully run. @@ -62,6 +63,22 @@ sub get_release_number { return $version } +sub get_code_name { + my $code_name = 'Green Obsidian'; + my $version = get_var('VERSION'); + my $ver_major = substr($version, 0, index($version, q/./)); + + given($ver_major){ + when ('9') { $code_name = 'Blue Onyx'; } + when ('10') { $code_name = 'Smoky Quartz'; } + when ('11') { $code_name = 'Lavender Calcite'; } + default{ + $code_name = 'Green Obsidian'; + } + } + return $code_name; +} + # Figure out what tty the desktop is on, switch to it. Assumes we're # at a root console sub desktop_vt { @@ -1360,8 +1377,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 diff --git a/needles/anaconda/help/rocky-anaconda_help_create_user-20220627.json b/needles/anaconda/help/rocky-anaconda_help_create_user-20220627.json new file mode 100644 index 00000000..14f5eed1 --- /dev/null +++ b/needles/anaconda/help/rocky-anaconda_help_create_user-20220627.json @@ -0,0 +1,16 @@ +{ + "area": [ + { + "height": 35, + "xpos": 9, + "width": 384, + "type": "match", + "ypos": 126 + } + ], + "properties": [], + "tags": [ + "ENV-DISTRI-rocky", + "anaconda_help_create_user" + ] +} \ No newline at end of file diff --git a/needles/anaconda/help/rocky-anaconda_help_create_user-20220627.png b/needles/anaconda/help/rocky-anaconda_help_create_user-20220627.png new file mode 100644 index 00000000..d3e5ac35 Binary files /dev/null and b/needles/anaconda/help/rocky-anaconda_help_create_user-20220627.png differ diff --git a/needles/anaconda/help/rocky-anaconda_help_language_support-20220627.json b/needles/anaconda/help/rocky-anaconda_help_language_support-20220627.json new file mode 100644 index 00000000..02da282c --- /dev/null +++ b/needles/anaconda/help/rocky-anaconda_help_language_support-20220627.json @@ -0,0 +1,16 @@ +{ + "area": [ + { + "height": 21, + "xpos": 38, + "width": 195, + "type": "match", + "ypos": 102 + } + ], + "properties": [], + "tags": [ + "ENV-DISTRI-rocky", + "anaconda_help_language_support" + ] +} \ No newline at end of file diff --git a/needles/anaconda/help/rocky-anaconda_help_language_support-20220627.png b/needles/anaconda/help/rocky-anaconda_help_language_support-20220627.png new file mode 100644 index 00000000..9923c04e Binary files /dev/null and b/needles/anaconda/help/rocky-anaconda_help_language_support-20220627.png differ diff --git a/needles/anaconda/help/rocky-anaconda_help_localization_link-20220627.json b/needles/anaconda/help/rocky-anaconda_help_localization_link-20220627.json new file mode 100644 index 00000000..5153c303 --- /dev/null +++ b/needles/anaconda/help/rocky-anaconda_help_localization_link-20220627.json @@ -0,0 +1,16 @@ +{ + "area": [ + { + "type": "match", + "ypos": 292, + "xpos": 21, + "width": 400, + "height": 20 + } + ], + "properties": [], + "tags": [ + "ENV-DISTRI-rocky", + "anaconda_help_localization_link" + ] +} \ No newline at end of file diff --git a/needles/anaconda/help/rocky-anaconda_help_localization_link-20220627.png b/needles/anaconda/help/rocky-anaconda_help_localization_link-20220627.png new file mode 100644 index 00000000..029d7a34 Binary files /dev/null and b/needles/anaconda/help/rocky-anaconda_help_localization_link-20220627.png differ diff --git a/needles/anaconda/help/rocky-anaconda_help_root_password-20220627.json b/needles/anaconda/help/rocky-anaconda_help_root_password-20220627.json new file mode 100644 index 00000000..1b1d2c5a --- /dev/null +++ b/needles/anaconda/help/rocky-anaconda_help_root_password-20220627.json @@ -0,0 +1,16 @@ +{ + "area": [ + { + "height": 35, + "width": 454, + "xpos": 8, + "ypos": 125, + "type": "match" + } + ], + "properties": [], + "tags": [ + "ENV-DISTRI-rocky", + "anaconda_help_root_password" + ] +} \ No newline at end of file diff --git a/needles/anaconda/help/rocky-anaconda_help_root_password-20220627.png b/needles/anaconda/help/rocky-anaconda_help_root_password-20220627.png new file mode 100644 index 00000000..efb81542 Binary files /dev/null and b/needles/anaconda/help/rocky-anaconda_help_root_password-20220627.png differ diff --git a/needles/anaconda/help/rocky-anaconda_help_select_packages-20220627.json b/needles/anaconda/help/rocky-anaconda_help_select_packages-20220627.json new file mode 100644 index 00000000..dbd2f7d6 --- /dev/null +++ b/needles/anaconda/help/rocky-anaconda_help_select_packages-20220627.json @@ -0,0 +1,16 @@ +{ + "area": [ + { + "height": 36, + "width": 488, + "xpos": 7, + "ypos": 125, + "type": "match" + } + ], + "properties": [], + "tags": [ + "ENV-DISTRI-rocky", + "anaconda_help_select_packages" + ] +} \ No newline at end of file diff --git a/needles/anaconda/help/rocky-anaconda_help_select_packages-20220627.png b/needles/anaconda/help/rocky-anaconda_help_select_packages-20220627.png new file mode 100644 index 00000000..f4cda54b Binary files /dev/null and b/needles/anaconda/help/rocky-anaconda_help_select_packages-20220627.png differ diff --git a/needles/anaconda/help/rocky-anaconda_help_time_date-20220627.json b/needles/anaconda/help/rocky-anaconda_help_time_date-20220627.json new file mode 100644 index 00000000..1c3bbb96 --- /dev/null +++ b/needles/anaconda/help/rocky-anaconda_help_time_date-20220627.json @@ -0,0 +1,16 @@ +{ + "area": [ + { + "ypos": 263, + "type": "match", + "width": 225, + "xpos": 38, + "height": 20 + } + ], + "properties": [], + "tags": [ + "ENV-DISTRI-rocky", + "anaconda_help_time_date" + ] +} \ No newline at end of file diff --git a/needles/anaconda/help/rocky-anaconda_help_time_date-20220627.png b/needles/anaconda/help/rocky-anaconda_help_time_date-20220627.png new file mode 100644 index 00000000..9923c04e Binary files /dev/null and b/needles/anaconda/help/rocky-anaconda_help_time_date-20220627.png differ diff --git a/needles/anaconda/partitioning/custom-gui/rocky-anaconda_custom_part_add-20220627.json b/needles/anaconda/partitioning/custom-gui/rocky-anaconda_custom_part_add-20220627.json new file mode 100644 index 00000000..72598285 --- /dev/null +++ b/needles/anaconda/partitioning/custom-gui/rocky-anaconda_custom_part_add-20220627.json @@ -0,0 +1,17 @@ +{ + "area": [ + { + "height": 31, + "type": "match", + "ypos": 621, + "xpos": 33, + "width": 35 + } + ], + "properties": [], + "tags": [ + "ENV-DISTRI-rocky", + "LANGUAGE-english", + "anaconda_custom_part_add" + ] +} \ No newline at end of file diff --git a/needles/anaconda/partitioning/custom-gui/rocky-anaconda_custom_part_add-20220627.png b/needles/anaconda/partitioning/custom-gui/rocky-anaconda_custom_part_add-20220627.png new file mode 100644 index 00000000..c45e22c9 Binary files /dev/null and b/needles/anaconda/partitioning/custom-gui/rocky-anaconda_custom_part_add-20220627.png differ diff --git a/needles/disk_custom_gui_xfs-anaconda_custom_part_fs_xfs_selected-20211011.json b/needles/anaconda/partitioning/custom-gui/rocky-disk_custom_gui_xfs-anaconda_custom_part_fs_xfs_selected-20211011.json similarity index 100% rename from needles/disk_custom_gui_xfs-anaconda_custom_part_fs_xfs_selected-20211011.json rename to needles/anaconda/partitioning/custom-gui/rocky-disk_custom_gui_xfs-anaconda_custom_part_fs_xfs_selected-20211011.json diff --git a/needles/disk_custom_gui_xfs-anaconda_custom_part_fs_xfs_selected-20211011.png b/needles/anaconda/partitioning/custom-gui/rocky-disk_custom_gui_xfs-anaconda_custom_part_fs_xfs_selected-20211011.png similarity index 100% rename from needles/disk_custom_gui_xfs-anaconda_custom_part_fs_xfs_selected-20211011.png rename to needles/anaconda/partitioning/custom-gui/rocky-disk_custom_gui_xfs-anaconda_custom_part_fs_xfs_selected-20211011.png diff --git a/needles/anaconda/partitioning/rocky-device_root_resized_twelve-20220627.json b/needles/anaconda/partitioning/rocky-device_root_resized_twelve-20220627.json new file mode 100644 index 00000000..053248f9 --- /dev/null +++ b/needles/anaconda/partitioning/rocky-device_root_resized_twelve-20220627.json @@ -0,0 +1,16 @@ +{ + "area": [ + { + "xpos": 394, + "width": 74, + "type": "match", + "ypos": 147, + "height": 22 + } + ], + "properties": [], + "tags": [ + "ENV-DISTRI-rocky", + "device_root_resized_twelve" + ] +} \ No newline at end of file diff --git a/needles/anaconda/partitioning/rocky-device_root_resized_twelve-20220627.png b/needles/anaconda/partitioning/rocky-device_root_resized_twelve-20220627.png new file mode 100644 index 00000000..e3d8975f Binary files /dev/null and b/needles/anaconda/partitioning/rocky-device_root_resized_twelve-20220627.png differ diff --git a/needles/anaconda/partitioning/rocky-fs_ext4-20220627.json b/needles/anaconda/partitioning/rocky-fs_ext4-20220627.json new file mode 100644 index 00000000..8c3eab53 --- /dev/null +++ b/needles/anaconda/partitioning/rocky-fs_ext4-20220627.json @@ -0,0 +1,16 @@ +{ + "area": [ + { + "width": 45, + "xpos": 775, + "ypos": 472, + "type": "match", + "height": 19 + } + ], + "properties": [], + "tags": [ + "ENV-DISTRI-rocky", + "anaconda_part_fs_ext4" + ] +} \ No newline at end of file diff --git a/needles/anaconda/partitioning/rocky-fs_ext4-20220627.png b/needles/anaconda/partitioning/rocky-fs_ext4-20220627.png new file mode 100644 index 00000000..8c94d133 Binary files /dev/null and b/needles/anaconda/partitioning/rocky-fs_ext4-20220627.png differ diff --git a/needles/anaconda/partitioning/rocky-use_current-20220627.json b/needles/anaconda/partitioning/rocky-use_current-20220627.json new file mode 100644 index 00000000..9e759b77 --- /dev/null +++ b/needles/anaconda/partitioning/rocky-use_current-20220627.json @@ -0,0 +1,16 @@ +{ + "area": [ + { + "type": "match", + "ypos": 381, + "xpos": 39, + "width": 90, + "height": 18 + } + ], + "properties": [], + "tags": [ + "ENV-DISTRI-rocky", + "anaconda_part_use_current" + ] +} \ No newline at end of file diff --git a/needles/anaconda/partitioning/rocky-use_current-20220627.png b/needles/anaconda/partitioning/rocky-use_current-20220627.png new file mode 100644 index 00000000..abf90544 Binary files /dev/null and b/needles/anaconda/partitioning/rocky-use_current-20220627.png differ diff --git a/tests/os_release.pm b/tests/os_release.pm index c4acf034..7bfac861 100644 --- a/tests/os_release.pm +++ b/tests/os_release.pm @@ -39,18 +39,22 @@ sub run { # $NAME is "Rocky Linux" not just "Rocky" my $fullname = $name . " Linux"; - my $version_id = get_var("VERSION"); # Should be the version number. - my ($ver_major, $ver_minor) = split /\./, $version_id; - my $varstr = spell_version_number($version_id); - my $target = lc($ver_major); + my $version_id = get_var("VERSION"); # Should be the version number. + my $ver_major = substr($version_id, 0, index($version_id, q/./)); + my $ver_minor = substr($version_id, index($version_id, q/./), length($version_id)); + my $target = lc($ver_major); + if ( $ver_major = '9' ) { + $target = lc($version_id); + } - my $reltag = script_output 'rpm -q rocky-release --qf "%{RELEASE}\n"'; - my ($relver, $eltag) = split /\./, $reltag; + my $reltag = script_output 'rpm -q rocky-release --qf "%{RELEASE}\n"'; + my $relver = substr($reltag, 0, rindex($reltag, q/./)); + my $eltag = substr($reltag, rindex($reltag, q/./)+1, length($reltag)); - my $code_name = get_var("CODENAME", 'Green Obsidian'); + my $code_name = get_code_name(); my $version = "$version_id ($code_name)"; my $platform_id = "platform:$eltag"; - my $pretty = "$fullname $version_id ($code_name)"; + my $pretty = "$fullname $version_id ($code_name)"; #Now. we can start testing the real values from the installed system. my @fails = (); @@ -65,7 +69,7 @@ sub run { rec_log "VERSION should be $version and is $strip", $strip eq $version, $failref; # Test for version_id - $strip = strip_marks($content{'VERSION_ID'}); + $strip = strip_marks($content{'VERSION_ID'}); rec_log "VERSION_ID should be $version_id and is $strip", $strip eq $version_id, $failref; # Test for platform_id @@ -78,10 +82,14 @@ sub run { # Test for Rocky Support Product $strip = strip_marks($content{'ROCKY_SUPPORT_PRODUCT'}); - rec_log "ROCKY_SUPPORT_PRODUCT should be $name and is $strip", $strip eq $fullname, $failref; + if ( $ver_major = '9' ) { + $fullname = qq/$fullname $ver_major/; + $fullname =~ s/ /-/g; + } + rec_log "ROCKY_SUPPORT_PRODUCT should be $fullname and is $strip", $strip eq $fullname, $failref; # Test for Rocky Support Product Version - $strip = strip_marks($content{ROCKY_SUPPORT_PRODUCT_VERSION}); + $strip = strip_marks($content{ROCKY_SUPPORT_PRODUCT_VERSION}); rec_log "ROCKY_SUPPORT_PRODUCT_VERSION should be $target and is $strip", $strip eq $target, $failref; # VERSION_ID should be 8.4 and is "8.4" @@ -89,10 +97,6 @@ sub run { # ROCKY_SUPPORT_PRODUCT should be Rocky and is Rocky Linux # ROCKY_SUPPORT_PRODUCT_VERSION should be and is 8 at /var/lib/openqa/share/tests/rocky/tests/os_release.pm line 95. - - - - # 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"; diff --git a/tests/rocky_release.pm b/tests/rocky_release.pm index 62ec091d..c365dc62 100644 --- a/tests/rocky_release.pm +++ b/tests/rocky_release.pm @@ -20,7 +20,7 @@ sub run { # Version as defined in the VERSION variable. my $expectver = get_var('VERSION'); # Code Name as defined in the CODENAME variable or default. - my $code_name = get_var('CODENAME', "Green Obsidian"); + my $code_name = get_code_name(); # Create the expected content of the release file # and compare it with its real counterpart. my $expected = "Rocky Linux release $expectver ($code_name)";