handle auth request for unsigned updates on KDE

When a package is unsigned, KDE will prompt for authentication.
Let's handle this. But count it as a soft fail, because
puiterwijk claims that Rawhide packages will be autosigned
from next week, so this *should* not happen and would indicate
an unsigned package in the repos. We make the KDE 'update
complete' needle area smaller because the wider area includes
some transparency and so will only match if the update applet
is open; this area will match whether it's open (no auth case)
or not open (auth case - the applet seems to disappear after
you provide the password in the auth prompt).

Pushing without review as the test is in production so I want
to make sure it works correctly.

(Also, hey, check out that array match for assert_screen and
that match_has_tag! This is gonna make some things so much
easier...thanks upstream)
This commit is contained in:
Adam Williamson 2016-09-23 17:21:54 -07:00
parent a067d0655f
commit e33b635f41
4 changed files with 49 additions and 15 deletions

View File

@ -0,0 +1,16 @@
{
"properties": [],
"area": [
{
"xpos": 254,
"ypos": 167,
"width": 71,
"height": 61,
"type": "match"
}
],
"tags": [
"DESKTOP-kde",
"desktop_package_tool_update_authenticate"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 398 KiB

View File

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

View File

@ -1,6 +1,7 @@
use base "installedtest"; use base "installedtest";
use strict; use strict;
use testapi; use testapi;
use main_common;
use packagetest; use packagetest;
sub run { sub run {
@ -46,6 +47,11 @@ sub run {
mouse_set 10, 10; mouse_set 10, 10;
mouse_hide; mouse_hide;
} }
# KDE annoyingly pops the notification up right over the install
# button, which doesn't help...wait for it to go away
if ($desktop eq 'kde') {
wait_still_screen 5;
}
assert_and_click 'desktop_package_tool_update_apply'; assert_and_click 'desktop_package_tool_update_apply';
# on GNOME, wait for reboots. # on GNOME, wait for reboots.
if ($desktop eq 'gnome') { if ($desktop eq 'gnome') {
@ -58,7 +64,19 @@ sub run {
assert_screen 'graphical_login', 300; assert_screen 'graphical_login', 300;
} }
else { else {
assert_screen 'desktop_package_tool_update_done', 180; # KDE will prompt for authentication if any package is not
# signed. As of 2016-09-23, puiterwijk claims Rawhide packages
# will be autosigned 'by Monday', so if this happens, we're
# going to treat it as a soft fail, indicating the update
# mechanism works, but a package that should have been signed
# was not.
assert_screen ['desktop_package_tool_update_done', 'desktop_package_tool_update_authenticate'], 180;
if (match_has_tag('desktop_package_tool_update_authenticate')) {
record_soft_failure;
type_very_safely get_var('USER_PASSWORD', 'weakpassword');
send_key 'ret';
assert_screen 'desktop_package_tool_update_done', 180;
}
} }
# back to console to verify updates # back to console to verify updates
$self->root_console(tty=>3); $self->root_console(tty=>3);