Compare commits

...

4 Commits

Author SHA1 Message Date
Lukas Ruzicka ef80bb434e Add a 'navigation' test for GNOME.
This PR partly solves the issue #301 when it adds the navigation
testing for Gnome. It uses the keyboard combinations to cycle through
running applications and checks that applications could be switched
accordingly. It also tests that you can switch between workspaces
and that you can move an applications to another workspace.
2024-04-09 20:30:26 -07:00
Adam Williamson e407c25c16 Apply some debugging hacks for the periodic failure bug
This is all in aid of trying to figure out what's going on in
https://pagure.io/fedora-qa/os-autoinst-distri-fedora/pull-request/312#comment-199540
 - sometimes the upgrade process just does not work, it seems
like the prepared update file gets wiped for some reason. This
is all trying to figure out exactly when that happens and
whether it's because we're running out of disk space.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2024-04-09 20:30:26 -07:00
Lukas Ruzicka 6773d22aff Add the graphical upgrade tests.
This PR builds on some elements of the current upgrade process,
such as upgrade_boot, upgrade_preinstall, upgrade_postinstall, but
replaces the upgrade_run with graphical_upgrade_run to use graphical
methods to upgrade the system.
This would not be possible without necessary settings, that are
performed by graphical_upgrade_prerequisites.
Works for both Gnome and KDE.
2024-04-09 20:30:26 -07:00
Adam Williamson 5bd224687f Bump base version in ostree-parse-pungi.py
The flatpaks have been updated to the F40 runtime, so we need to
keep pace here.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2024-04-09 20:28:13 -07:00
47 changed files with 873 additions and 12 deletions

View File

@ -218,7 +218,10 @@ testtags.extend(f"anaconda_help_{fsys}" for fsys in ('install_destination',
'installation_progress', 'keyboard_layout', 'language_support', 'network_host_name',
'root_password', 'select_packages', 'installation_source', 'time_date', 'user_creation',
'language_selection', 'language', 'summary_link'))
# for Gnome navigation test
for app in ("clocks", "firefox", "fonts", "terminal", "editor"):
testtags.append(f"navigation_navibar_{app}")
testtags.append("navigation_terminal_fullscreen")
testtags.extend(f"anaconda_main_hub_{fsys}" for fsys in ('language_support', 'selec_packages',
'time_date', 'create_user','keyboard_layout'))

View File

@ -168,6 +168,17 @@ sub post_fail_hook {
}
}
# TEST TEST FOR DEBUGGING ONLY
if (get_var("GUI_UPGRADE")) {
script_run "df -h";
script_run "ls -l /var/lib/PackageKit";
script_run "ls -l /var/lib/PackageKit/prepared-upgrade";
$self->root_console(tty => 4);
send_key "ctrl-c";
upload_logs "/tmp/pk.log", failok => 1;
}
# END DEBUGGING
}
1;

View File

@ -1709,4 +1709,23 @@ sub set_update_notification_timestamp {
type_very_safely("gsettings set org.gnome.software update-notification-timestamp $ep_time\n");
}
# This routine takes a list of applications. It will then use the terminal
# to start all these applications in the background and then it will exit the
# terminal. This is useful when we want to start multiple applications quickly.
sub start_applications {
my @applications = @_;
# Open the terminal
menu_launch_type("terminal");
wait_still_screen(2);
# Iterate over the application list
# and start each application from it.
foreach (@applications) {
assert_script_run("$_ &");
# Take some time for things to settle.
wait_still_screen(1);
}
# Exit the terminal.
enter_cmd("exit");
}
1;

11
main.pm
View File

@ -122,7 +122,16 @@ sub load_upgrade_tests() {
autotest::loadtest "tests/${pu}.pm";
}
}
autotest::loadtest "tests/upgrade_run.pm";
# If we want the upgrade run with GUI tools, we need
# to load a GUI set of tests
if (get_var("GUI_UPGRADE")) {
autotest::loadtest("tests/graphical_upgrade_prerequisites.pm");
autotest::loadtest("tests/graphical_upgrade_run.pm");
}
# otherwise go with the CLI variant
else {
autotest::loadtest "tests/upgrade_run.pm";
}
# handle additional postinstall tests
if (get_var("POSTINSTALL")) {
set_var('POSTINSTALL', "upgrade_postinstall " . get_var("POSTINSTALL"));

View File

@ -25,6 +25,7 @@
"properties": [],
"tags": [
"firefox",
"browser"
"browser",
"apps_run_firefox"
]
}
}

View File

@ -12,4 +12,4 @@
"tags": [
"apps_run_clocks"
]
}
}

View File

@ -10,6 +10,7 @@
],
"properties": [],
"tags": [
"apps_run_texteditor"
"apps_run_texteditor",
"apps_run_editor"
]
}
}

View File

@ -10,6 +10,7 @@
],
"properties": [],
"tags": [
"apps_run_texteditor"
"apps_run_texteditor",
"apps_run_editor"
]
}
}

View File

@ -12,4 +12,4 @@
"tags": [
"panel_ctrl_networks"
]
}
}

View File

@ -0,0 +1,22 @@
{
"area": [
{
"type": "match",
"height": 27,
"xpos": 515,
"ypos": 537,
"width": 103
},
{
"type": "match",
"xpos": 561,
"ypos": 424,
"height": 34,
"width": 40
}
],
"properties": [],
"tags": [
"navigation_details_shown"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"ypos": 1,
"type": "match",
"xpos": 6,
"height": 67,
"width": 82
}
],
"properties": [],
"tags": [
"navigation_editor_fullscreen"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 4,
"ypos": 4,
"width": 124,
"height": 65,
"type": "match"
}
],
"properties": [],
"tags": [
"navigation_files_fullscreen"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 316,
"ypos": 355,
"width": 111,
"height": 52,
"type": "match"
}
],
"properties": [],
"tags": [
"navigation_navibar_calculator"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"width": 125,
"height": 32,
"ypos": 352,
"xpos": 449,
"type": "match"
}
],
"properties": [],
"tags": [
"navigation_navibar_clocks"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"width": 121,
"type": "match",
"height": 50,
"xpos": 728,
"ypos": 353
}
],
"properties": [],
"tags": [
"navigation_navibar_editor"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 733,
"ypos": 356,
"width": 117,
"height": 30,
"type": "match"
}
],
"properties": [],
"tags": [
"navigation_navibar_files"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"width": 122,
"height": 34,
"xpos": 590,
"ypos": 341,
"type": "match"
}
],
"properties": [],
"tags": [
"navigation_navibar_terminal"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"width": 77,
"ypos": 0,
"height": 22,
"xpos": 36,
"type": "match"
}
],
"properties": [],
"tags": [
"navigation_terminal_fullscreen"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"width": 127,
"height": 38,
"xpos": 448,
"ypos": 99,
"type": "match"
}
],
"properties": [],
"tags": [
"navigation_three_workspaces"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 438,
"ypos": 277,
"width": 143,
"height": 20,
"type": "match"
}
],
"properties": [],
"tags": [
"desktop_package_tool_restart_upgrade"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

View File

@ -0,0 +1,26 @@
{
"area": [
{
"height": 56,
"type": "match",
"click_point": {
"xpos": 50,
"ypos": 10
},
"width": 154,
"xpos": 435,
"ypos": 277
},
{
"height": 30,
"type": "match",
"width": 133,
"xpos": 558,
"ypos": 162
}
],
"properties": [],
"tags": [
"desktop_package_tool_upgrade_system"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

View File

@ -0,0 +1,16 @@
{
"area": [
{
"xpos": 334,
"ypos": 271,
"width": 212,
"height": 20,
"type": "match"
}
],
"properties": [],
"tags": [
"auth_required",
"auth_required_password"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 277 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 322,
"ypos": 684,
"width": 136,
"height": 25,
"type": "match"
}
],
"properties": [],
"tags": [
"desktop_package_tool_restart_automatically"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 198 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"height": 20,
"type": "match",
"width": 59,
"xpos": 785,
"ypos": 90
}
],
"properties": [],
"tags": [
"desktop_package_tool_upgrade_system"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 188 KiB

View File

@ -5,7 +5,7 @@ import sys
# the "current" base platform version, i.e. the one that the GNOME
# app builds currently tagged "stable" need
BASEVER = "39"
BASEVER = "40"
# a regex to find where we replace that
BASEPATT = re.compile(r"(runtime/org.fedoraproject.Platform/.*?/f)(\d+)")

View File

@ -1257,6 +1257,23 @@
"START_AFTER_TEST": "%DEPLOY_UPLOAD_TEST%"
}
},
"navigation": {
"profiles": {
"fedora-Silverblue-dvd_ostree-iso-ppc64le-*-ppc64le": 50,
"fedora-Silverblue-dvd_ostree-iso-x86_64-*-64bit": 50,
"fedora-Workstation-live-iso-ppc64le-*-ppc64le": 20,
"fedora-Workstation-live-iso-x86_64-*-64bit": 20,
"fedora-Workstation-upgrade-x86_64-*-64bit": 40,
"fedora-Workstation-upgrade-aarch64-*-aarch64": 40,
"fedora-Workstation-raw_xz-raw.xz-aarch64-*-aarch64": 22
},
"settings": {
"BOOTFROM": "c",
"HDD_1": "disk_%FLAVOR%_%MACHINE%.qcow2",
"POSTINSTALL_PATH": "tests/applications/navigation",
"START_AFTER_TEST": "%DEPLOY_UPLOAD_TEST%"
}
},
"gnome_text_editor": {
"profiles": {
"fedora-Silverblue-dvd_ostree-iso-ppc64le-*-ppc64le": 50,
@ -3051,7 +3068,6 @@
"ROOT_PASSWORD": "weakpassword",
"TEST_TARGET": "COMPOSE",
"UPGRADE": "1",
"GUI_UPGRADE": "1",
"USER_LOGIN": "test",
"USER_PASSWORD": "weakpassword"
}
@ -3074,6 +3090,40 @@
"USER_PASSWORD": "weakpassword"
}
},
"upgrade_desktop_graphical": {
"profiles": {
"fedora-universal-x86_64-*-64bit": 30,
"fedora-universal-aarch64-*-aarch64": 40
},
"settings": {
"BOOTFROM": "c",
"DESKTOP": "gnome",
"HDD_1": "disk_f%UP1REL%_desktop_5_%ARCH%.qcow2",
"ROOT_PASSWORD": "weakpassword",
"TEST_TARGET": "COMPOSE",
"UPGRADE": "1",
"GUI_UPGRADE": "1",
"USER_LOGIN": "test",
"USER_PASSWORD": "weakpassword"
}
},
"upgrade_2_desktop_graphical": {
"profiles": {
"fedora-universal-x86_64-*-64bit": 30,
"fedora-universal-aarch64-*-aarch64": 40
},
"settings": {
"BOOTFROM": "c",
"DESKTOP": "gnome",
"HDD_1": "disk_f%UP2REL%_desktop_5_%ARCH%.qcow2",
"ROOT_PASSWORD": "weakpassword",
"TEST_TARGET": "COMPOSE",
"UPGRADE": "1",
"GUI_UPGRADE": "1",
"USER_LOGIN": "test",
"USER_PASSWORD": "weakpassword"
}
},
"upgrade_kde": {
"profiles": {
"fedora-universal-x86_64-*-64bit": 30
@ -3089,6 +3139,22 @@
"USER_PASSWORD": "weakpassword"
}
},
"upgrade_kde_graphical": {
"profiles": {
"fedora-universal-x86_64-*-64bit": 30
},
"settings": {
"+HDD_1": "disk_f%UP1REL%_kde_5_x86_64.qcow2",
"BOOTFROM": "c",
"DESKTOP": "kde",
"ROOT_PASSWORD": "weakpassword",
"TEST_TARGET": "COMPOSE",
"UPGRADE": "1",
"GUI_UPGRADE": "1",
"USER_LOGIN": "test",
"USER_PASSWORD": "weakpassword"
}
},
"upgrade_minimal": {
"profiles": {
"fedora-universal-aarch64-*-aarch64": 30,

View File

@ -0,0 +1,38 @@
use base "installedtest";
use strict;
use testapi;
use utils;
# We will start two applications and save the progress.
sub run {
my $self = shift;
# Let us wait here for a couple of seconds to give the VM time to settle.
# Starting right over might result in erroneous behavior.
sleep(5);
# Start Firefox
menu_launch_type("nautilus");
assert_screen "apps_run_files", 45;
# let it settle a bit
wait_still_screen(stilltime => 5, similarity_level => 45);
send_key("super-up");
assert_screen("navigation_files_fullscreen");
# Start Gnome Text Editor
menu_launch_type("text-editor");
assert_screen("apps_run_editor");
wait_still_screen(2);
send_key("super-up");
assert_screen("navigation_editor_fullscreen");
}
sub test_flags {
return {fatal => 1, milestone => 1};
}
1;
# vim: set sw=4 et:

View File

@ -0,0 +1,40 @@
use base "installedtest";
use strict;
use testapi;
use utils;
# This will test that user can trigger a detailed view of the
# navigation icons using the ~ key.
sub run {
my $self = shift;
# Let us wait here for a couple of seconds to give the VM time to settle.
# Starting right over might result in erroneous behavior.
sleep(5);
# If we are at Nautilus switch to editor
if (check_screen("apps_run_files")) {
send_key("alt-tab");
assert_screen "apps_run_editor";
}
# Use alt-tab to navigate to the other
# application, but trigger the overview
# page as well and make sure it is shown.
hold_key("alt");
send_key("tab");
send_key("~");
assert_screen("navigation_details_shown");
release_key("alt");
}
sub test_flags {
return {always_rollback => 1};
}
1;
# vim: set sw=4 et:

View File

@ -0,0 +1,136 @@
use base "installedtest";
use strict;
use testapi;
use utils;
# This will test that user can switch between two applications
# using the navigation combo Alt-tab.
sub start_maxed {
my $app = shift;
menu_launch_type($app);
assert_screen ["apps_run_$app", "grant_access"];
# give access rights if asked
if (match_has_tag "grant_access") {
click_lastmatch;
assert_screen "apps_run_$app";
}
wait_still_screen(3);
wait_screen_change { send_key("super-up"); };
wait_still_screen(2);
}
sub switch_to_app {
# This will use Alt-tab to switch to the desired application.
# Use the name of the application and the direction in which
# the search should be performed, either forward or backward.
my ($application, $dir, $fullscreen) = @_;
# If we want to search backwards, we will hold the shift key.
if ($dir eq "backward") {
hold_key("shift");
}
# Then we hold the alt key to either form shift-alt or just alt
# key combo.
hold_key("alt");
# We will send tab, until we have arrived at the correct icon
send_key_until_needlematch("navigation_navibar_$application", "tab", 10);
# We will release the alt key.
release_key("alt");
#
if ($dir eq "backward") {
release_key("shift");
}
my $needle = $fullscreen ? "navigation_${application}_fullscreen" : "apps_run_${application}";
assert_screen($needle);
if ($fullscreen) {
die "Not fullscreen!" if (check_screen("apps_menu_button"));
}
}
sub check_hidden {
# This function checks that the application
# is no longer fully displayed on the screen,
# because it has been hidden (minimized).
my $app = shift;
# First, let us wait until the screen settles.
wait_still_screen(3);
# If the application is still shown, let's die.
die("The application seems not to have been minimized.") if (check_screen("apps_run_$app"));
}
sub run {
my $self = shift;
### Switch between two applications
# From the setup script, we should be seeing the editor
# window.
# Switch to the other application.
send_key("alt-tab");
assert_screen("apps_run_files");
# Switch back
send_key("alt-tab");
assert_screen("apps_run_editor");
### Switch between more applications
# Start more applications.
start_maxed("clocks");
start_maxed("calculator");
start_maxed("terminal");
## Going forwards
# Switch to Calculator using alt-tab
switch_to_app("calculator", "forward");
# Switch to Clocks using alt-tab
switch_to_app("clocks", "forward");
## Going backwards
# Switch to Nautilus using shift-alt-tab
switch_to_app("files", "backward");
# Switch to Terminal using shift-alt-tab
switch_to_app("terminal", "backward");
### Switch to and from a full screen application
# We will make Terminal to full screen
send_key("f11");
# Switch to Editor
switch_to_app("editor", "forward");
# Switch to Terminal (fullscreen)
switch_to_app("terminal", "backward", 1);
# Switch to Editor
switch_to_app("editor", "forward");
### Switch between minimised apps.
# Minimise Editor
send_key("super-h");
# Check that the application has minimised.
check_hidden("editor");
# Switch to Clocks
switch_to_app("clocks", "forward");
# Minimise Clocks
send_key("super-h");
# Check that the application has minimised.
check_hidden("clocks");
# Switch to Editor
switch_to_app("editor", "forward");
# Switch to Clocks
switch_to_app("clocks", "forward");
}
sub test_flags {
return {always_rollback => 1};
}
1;
# vim: set sw=4 et:

View File

@ -0,0 +1,65 @@
use base "installedtest";
use strict;
use testapi;
use utils;
# This will test that user can switch between two workspaces,
# that we can move an application to another workspace.
sub move_to_workspace {
# This will use Shift-Ctrl-Alt to move the focused app to
# the $direction (left or right).
my $direction = shift;
wait_screen_change { send_key("shift-ctrl-alt-$direction"); };
wait_still_screen 5;
}
sub switch_to_workspace {
# This will use Ctrl-Alt to switch to another workspace
# using the $direction (left, right)
my $direction = shift;
wait_screen_change { send_key("ctrl-alt-$direction"); };
wait_still_screen 5;
}
sub run {
my $self = shift;
# Let us wait here for a couple of seconds to give the VM time to settle.
# Starting right over might result in erroneous behavior.
sleep(5);
# The focused application should be the Editor, so let's check it is
# visible on the beginning screen. Then switch to another workplace.
# This one should be empty, therefore checking for the Editor should fail.
# The opposite will be true, when we switch back
assert_screen("apps_run_editor");
switch_to_workspace("right");
die("The workspaces were not switched!") if (check_screen("apps_run_editor"));
switch_to_workspace("left");
die("The workspaces were not switched") unless (check_screen("apps_run_editor"));
# Now, we will move the focused application (Editor) to the second workspace.
# The application will be still visible there. When we switch back, the application
# will no longer be visible on the first workspace and will uncover Nautilus and
# we check that it is there. We will also enter the Activitities mode and will check
# that currently three workspaces can be used (top bar of the screen).
move_to_workspace("right");
die("The application was not moved!") unless (check_screen("apps_run_editor"));
switch_to_workspace("left");
die("The workspaces were not switched") unless (check_screen("apps_run_files"));
send_key("super");
wait_still_screen(2);
assert_screen("navigation_three_workspaces");
}
sub test_flags {
return {always_rollback => 1};
}
1;
# vim: set sw=4 et:

View File

@ -0,0 +1,125 @@
use base "installedtest";
use strict;
use testapi;
use utils;
sub run {
my $self = shift;
my $release = get_release_number;
my $rawrel = get_var("RAWREL");
my $curr = get_var("TEST") =~ "upgrade_2" ? get_var("UP2REL") : get_var("UP1REL");
my $desktop = get_var("DESKTOP");
my $user = get_var("USER_LOGIN", "test");
my $pword = get_var("USER_PASSWORD", "weakpassword");
# As this is designed, the 'upgrade_preinstall' test script
# runs before this one and ends on the root console. Therefore,
# we can assume that we are still on that root console, so
# we can safely use script assertions.
# Make serial console writable for everyone, so that we
# can use script assertions for further commands as well.
assert_script_run("chmod 666 /dev/${serialdev}");
if ($desktop eq "gnome") {
# Install Gnome specific packages
assert_script_run("dnf install -y jq dbus-x11");
# Leave the CLI and come back to the login screen.
desktop_vt();
# Log onto the graphical session
send_key("ret");
wait_still_screen(1);
type_very_safely("$pword\n");
handle_welcome_screen();
check_desktop();
# After the login, let us wait that everything settles
# and that we are not too quick on the system.
wait_still_screen(5);
# According to the ticket, the 'fedora.json' file
# which lists the available versions will be created
# after the Software starts. Let's start it then on Gnome.
menu_launch_type("software");
# When Software is started for the first time, it asks whether
# a user wants to use Third Party software. We want to Ignore
# this and proceed, so if we see that we click on Ignore.
if (check_screen("gnome_software_ignore", timeout => 60)) {
click_lastmatch();
}
# Wait a couple of second, just in case the file needs a little
# longer to be created.
sleep(10);
# Close Software
send_key("alt-f4");
}
# Switch back to the CLI for further settings.
$self->root_console(tty => 3);
# For Gnome desktop only.
if ($desktop eq "gnome") {
# FIXME workaround for https://bugzilla.redhat.com/show_bug.cgi?id=2268590
# upgrade fails if modular repo definitions are present
# remove when that is fixed
unless (script_run "ls /etc/yum.repos.d/*modul*") {
record_soft_failure "Modular repos present! Upgrade will fail, so removing";
assert_script_run "rm -f /etc/yum.repos.d/*modul*";
}
# TEST TEST FOR DEBUGGING ONLY
assert_script_run 'sed -i -e "s,libexec/packagekitd,libexec/packagekitd --verbose,g" /usr/lib/systemd/system/packagekit.service';
# END DEBUGGING
# Switch to a user account
enter_cmd("su -l $user");
# Navigate to the version file directory
assert_script_run("cd ~/.cache/gnome-software/fedora-pkgdb-collections");
# Replace the word 'devel' with the Rawhide version number
# so Rawhide behaves like other releases, if we're upgrading
# to Rawhide
if ($release eq $rawrel) {
assert_script_run("jq '(.collections |= map(if .version == \"devel\" then .koji_name = \"f$rawrel\" | .version = \"$rawrel\" else . end))' fedora.json > fedora-updated.json");
assert_script_run("mv fedora-updated.json fedora.json");
}
# Now make sure the versions we're trying to upgrade from and to
# are both 'active'
assert_script_run("jq '(.collections |= map(if .version == \"$release\" or .version == \"$curr\" then .status = \"Active\" else . end))' fedora.json > fedora-updated.json");
assert_script_run("mv fedora-updated.json fedora.json");
# upload the modified file for debugging
upload_logs("fedora.json", failok => 1);
# Disable blanking the screen on inactivity, because if the screen gets switched off
# we will have no way to make it active again.
assert_script_run("dbus-launch --exit-with-session gsettings set org.gnome.desktop.screensaver idle-activation-enabled false");
assert_script_run("dbus-launch --exit-with-session gsettings set org.gnome.desktop.screensaver lock-enabled false");
assert_script_run("dbus-launch --exit-with-session gsettings set org.gnome.desktop.lockdown disable-lock-screen true");
# Logout the regular user
enter_cmd("exit");
}
# For KDE desktop only.
elsif ($desktop eq "kde") {
# Replace "rawhide" with the Rawhide version number if we're
# upgrading to Rawhide
assert_script_run("sed -i 's,rawhide,$rawrel,g' /usr/share/metainfo/org.fedoraproject.fedora.metainfo.xml") if ($release eq $rawrel);
# Now mark the release we want to upgrade to as stable
assert_script_run("sed -i 's,version=\"$release\" type=\".*\" date=,version=\"$release\" type=\"stable\" date=,g' /usr/share/metainfo/org.fedoraproject.fedora.metainfo.xml");
# Upload the modified file for debugging
upload_logs("/usr/share/metainfo/org.fedoraproject.fedora.metainfo.xml", failok => 1);
# Switch to the regular user
enter_cmd("su -l $user");
# Wipe last update notification time
assert_script_run("kwriteconfig5 --file PlasmaDiscoverUpdates --group Global --key LastNotificationTime --delete");
# Disable the screen locker
assert_script_run("kwriteconfig5 --file kscreenlockerrc --group Daemon --key Autolock false qdbus org.freedesktop.ScreenSaver /ScreenSaver configure");
# Exit regular user
enter_cmd("exit");
}
# Reboot system to load changes
enter_cmd("reboot");
}
sub test_flags {
return {fatal => 1};
}
1;
# vim: set sw=4 et:

View File

@ -0,0 +1,102 @@
use base "installedtest";
use strict;
use testapi;
use utils;
# This method does the basic login to a DE,
# it can distinguish between Gnome and KDE.
# We are using it to make the code a little
# lighter.
sub session_login {
my $desktop = shift;
my $pword = get_var("USER_PASSWORD") // "weakpassword";
if ($desktop eq "gnome") {
# For Gnome, we need to press Enter first
# to show the password field, then we type
# in the password.
send_key("ret");
wait_still_screen(1);
}
# For both DEs
type_very_safely("$pword\n");
}
sub run {
my $self = shift;
my $rawrel = get_var("RAWREL");
my $user = get_var("USER_LOGIN") // "test";
my $pword = get_var("USER_PASSWORD") // "weakpassword";
my $desktop = get_var("DESKTOP");
# The previous test, 'graphical_upgrade_prerequsites' reset
# the machine, so we will deal with booting it and
# login to the $desktop.
boot_to_login_screen();
session_login($desktop);
# If we are on Gnome, we have seen the welcome screen already
# in the previous step, so we do not want to repeat this.
# However, for KDE we will deal with it.
if ($desktop eq "kde") {
handle_welcome_screen();
}
# Let's check, that the desktop is shown.
check_desktop();
# TEST TEST FOR DEBUGGING ONLY
$self->root_console(tty => 4);
type_string "while true; do date -u >> /tmp/pk.log; df -h >> /tmp/pk.log; ls -l /var/lib/PackageKit >> /tmp/pk.log 2>&1; sleep 1; done\n";
$self->root_console(tty => 3);
desktop_vt;
# END DEBUGGING
# Start the package manager application depending
# on which DE we are on.
my $pkgmgr = "software";
$pkgmgr = "discover" if ($desktop eq "kde");
menu_launch_type($pkgmgr);
# On Gnome, the upgrade is safely visible when
# we visit the Update page by clicking on the
# Update icon. Let's click on that icon on
# both DEs, just to make sure.
assert_and_click("desktop_package_tool_update");
# Click the appropriate button to download the upgrade.
assert_and_click("desktop_package_tool_upgrade_system", timeout => 180);
if ($desktop eq "gnome") {
# Restart the computer to apply upgrades, when the download is complete.
# Downloading the upgrade packages may take a long time
# so let's check until we find it.
assert_and_click("desktop_package_tool_restart_upgrade", timeout => 1200);
assert_screen("auth_required");
# Type the password to confirm.
type_very_safely("$pword\n");
# Click on the 'restart and install' button
# to restart into the upgrade session.
assert_and_click("gnome_reboot_confirm");
}
elsif ($desktop eq "kde") {
# Click on Update all
assert_and_click("desktop_package_tool_update_apply", timeout => 1200);
# Once we click that button, we can check the checkbutton
# for restarting the computer automatically.
assert_and_click("desktop_package_tool_restart_automatically");
# When we see auth_required, it means the restart has been triggered
# and we need to authorize it
while (!check_screen("auth_required")) {
sleep 15;
}
type_very_safely("$pword\n");
}
}
sub test_flags {
return {fatal => 1};
}
1;
# vim: set sw=4 et: