add a desktop_update_graphical test

Summary:
Very similar to the CLI update test, but using the desktops'
update applications. This is based off the CLI update test
branch as it uses the shared functions that branch introduced.
We do not use the fake update packages, as they don't really
do anything useful for these tests; for dnf they can help us
distinguish between issues with the dnf mechanism and issues
with the repos, but we can't really tell that in the graphical
case. So we only use the python3-kickstart package here.

Test Plan:
Run the test on both KDE and GNOME and ensure it
performs as intended. I've been testing it on staging, so you
can see it there.

Reviewers: jskladan, garretraziel

Reviewed By: garretraziel

Subscribers: tflink

Differential Revision: https://phab.qadevel.cloud.fedoraproject.org/D1010
This commit is contained in:
Adam Williamson 2016-09-20 15:32:44 -07:00
parent 44ec3d84c3
commit e8b20ec73f
23 changed files with 279 additions and 0 deletions

View File

@ -101,6 +101,16 @@ sub repo_setup {
script_run "cat /etc/yum.repos.d/{fedora,fedora-rawhide}.repo"; script_run "cat /etc/yum.repos.d/{fedora,fedora-rawhide}.repo";
} }
# switch to the desktop where the VT is
sub desktop_vt {
if (get_var("DESKTOP") eq 'gnome') {
send_key 'ctrl-alt-f2';
}
else {
send_key 'ctrl-alt-f1';
}
}
1; 1;
# vim: set sw=4 et: # vim: set sw=4 et:

View File

@ -0,0 +1,16 @@
{
"properties": [],
"tags": [
"desktop_package_tool_update",
"DESKTOP-gnome"
],
"area": [
{
"xpos": 600,
"ypos": 40,
"width": 54,
"height": 21,
"type": "match"
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 148 KiB

View File

@ -0,0 +1,16 @@
{
"tags": [
"DESKTOP-gnome",
"desktop_package_tool_update_apply"
],
"area": [
{
"xpos": 849,
"ypos": 44,
"width": 106,
"height": 13,
"type": "match"
}
],
"properties": []
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

View File

@ -0,0 +1,16 @@
{
"area": [
{
"xpos": 12,
"ypos": 39,
"width": 20,
"height": 21,
"type": "match"
}
],
"tags": [
"DESKTOP-gnome",
"desktop_package_tool_update_refresh"
],
"properties": []
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View File

@ -0,0 +1,16 @@
{
"properties": [],
"tags": [
"DESKTOP-gnome",
"gnome_reboot_confirm"
],
"area": [
{
"xpos": 588,
"ypos": 517,
"width": 110,
"height": 18,
"type": "match"
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

View File

@ -0,0 +1,16 @@
{
"area": [
{
"xpos": 509,
"ypos": 561,
"width": 62,
"height": 18,
"type": "match"
}
],
"tags": [
"DESKTOP-gnome",
"gnome_software_welcome"
],
"properties": []
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

View File

@ -0,0 +1,16 @@
{
"area": [
{
"xpos": 846,
"ypos": 743,
"width": 17,
"height": 18,
"type": "match"
}
],
"tags": [
"DESKTOP-kde",
"desktop_expand_notifications"
],
"properties": []
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 499 KiB

View File

@ -0,0 +1,16 @@
{
"area": [
{
"xpos": 613,
"ypos": 509,
"width": 19,
"height": 18,
"type": "match"
}
],
"tags": [
"DESKTOP-kde",
"desktop_package_tool_update"
],
"properties": []
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 469 KiB

View File

@ -0,0 +1,16 @@
{
"area": [
{
"xpos": 749,
"ypos": 705,
"width": 100,
"height": 15,
"type": "match"
}
],
"tags": [
"DESKTOP-kde",
"desktop_package_tool_update_apply"
],
"properties": []
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 488 KiB

View File

@ -0,0 +1,16 @@
{
"properties": [],
"area": [
{
"xpos": 634,
"ypos": 665,
"width": 41,
"height": 44,
"type": "match"
}
],
"tags": [
"DESKTOP-kde",
"desktop_package_tool_update_done"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 481 KiB

View File

@ -0,0 +1,16 @@
{
"tags": [
"DESKTOP-kde",
"desktop_package_tool_update_refresh"
],
"area": [
{
"xpos": 760,
"ypos": 704,
"width": 124,
"height": 17,
"type": "match"
}
],
"properties": []
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 475 KiB

View File

@ -303,6 +303,28 @@
}, },
test_suite => { name => "base_update_cli" }, test_suite => { name => "base_update_cli" },
}, },
{
machine => { name => "64bit" },
prio => 30,
product => {
arch => "x86_64",
distri => "fedora",
flavor => "Workstation-live-iso",
version => "*",
},
test_suite => { name => "desktop_update_graphical" },
},
{
machine => { name => "64bit" },
prio => 32,
product => {
arch => "x86_64",
distri => "fedora",
flavor => "KDE-live-iso",
version => "*",
},
test_suite => { name => "desktop_update_graphical" },
},
{ {
machine => { name => "64bit" }, machine => { name => "64bit" },
prio => 30, prio => 30,
@ -2078,6 +2100,15 @@
{ key => "WORKER_CLASS", value => "tap" }, { key => "WORKER_CLASS", value => "tap" },
], ],
}, },
{
name => "desktop_update_graphical",
settings => [
{ key => "POSTINSTALL", value => "desktop_update_graphical" },
{ key => "START_AFTER_TEST", value => "install_default_upload" },
{ key => "BOOTFROM", value => "c" },
{ key => "HDD_1", value => "disk_%FLAVOR%_%MACHINE%.qcow2" },
],
},
{ {
name => "desktop_terminal", name => "desktop_terminal",
settings => [ settings => [

View File

@ -0,0 +1,78 @@
use base "installedtest";
use strict;
use testapi;
use packagetest;
sub run {
my $self = shift;
my $desktop = get_var('DESKTOP');
# use a tty console for repo config and package prep
$self->root_console(tty=>3);
assert_script_run 'dnf config-manager --set-disabled updates-testing';
prepare_test_packages;
# get back to the desktop
$self->desktop_vt();
# run the updater
if ($desktop eq 'kde') {
# KDE team tells me the 'preferred' update method is the
# systray applet
assert_and_click 'desktop_expand_notifications';
}
else {
# this launches GNOME Software on GNOME, dunno for any other
# desktop yet
$self->menu_launch_type('update');
}
# GNOME Software has a welcome screen, get rid of it if it shows
# up (but don't fail if it doesn't, we're not testing that)
if ($desktop eq 'gnome' && check_screen 'gnome_software_welcome', 10) {
send_key 'ret';
}
# go to the 'update' interface. For GNOME, we may be waiting
# some time at a 'Software catalog is being loaded' screen.
if ($desktop eq 'gnome') {
for my $n (1..5) {
last if (check_screen 'desktop_package_tool_update', 120);
mouse_set 10, 10;
mouse_hide;
}
}
assert_and_click 'desktop_package_tool_update';
# refresh updates
assert_and_click 'desktop_package_tool_update_refresh';
# wait for refresh, then apply updates
for my $n (1..5) {
last if (check_screen 'desktop_package_tool_update_apply', 120);
mouse_set 10, 10;
mouse_hide;
}
assert_and_click 'desktop_package_tool_update_apply';
# on GNOME, wait for reboots.
if ($desktop eq 'gnome') {
# handle reboot confirm screen which pops up when user is
# logged in (but don't fail if it doesn't as we're not testing
# that)
if (check_screen 'gnome_reboot_confirm', 15) {
send_key 'ret';
}
assert_screen 'graphical_login', 300;
}
else {
assert_screen 'desktop_package_tool_update_done', 180;
}
# back to console to verify updates
$self->root_console(tty=>3);
verify_updated_packages;
}
sub test_flags {
# without anything - rollback to 'lastgood' snapshot if failed
# 'fatal' - whole test suite is in danger if this fails
# 'milestone' - after this test succeeds, update 'lastgood'
# 'important' - if this fails, set the overall state to 'fail'
return { fatal => 1 };
}
1;
# vim: set sw=4 et: