Add test for QA:Testcase_Anaconda_User_Interface_VNC

This adds a test for QA:Testcase_Anaconda_User_Interface_VNC -
the VNC install test case. It's implemented as a server/client
pair, with the server booting from the Server DVD image with
`inst.vnc` and the client booting from the desktop base disk
image, setting up networking, then running Boxes to connect to
the server and run the install.

There are various little tweaks to test loading and logic to
handle this, mostly pretty clear. We also move the workaround
for 'spurious auth prompt appears on desktop after you switch
away to a VT and back' out of the desktop update test and into
the `desktop_vt` helper function, since now this test can hit
it as well. We enhance _graphical_wait_login to handle the boot
loader if needed (it has never needed to until now).

Signed-off-by: Adam Williamson <awilliam@redhat.com>
This commit is contained in:
Adam Williamson 2019-11-05 12:13:33 -08:00
parent a0e191e097
commit b82a1dec6f
13 changed files with 159 additions and 22 deletions

View File

@ -54,6 +54,21 @@ sub desktop_vt {
$tty = $1; # most recent match is probably best
}
send_key "ctrl-alt-f${tty}";
# work around https://gitlab.gnome.org/GNOME/gnome-software/issues/582
# if it happens. As of 2019-05, seeing something similar on KDE too
my $desktop = get_var('DESKTOP');
if (check_screen "auth_required", 10) {
record_soft_failure "spurious 'auth required' - https://gitlab.gnome.org/GNOME/gnome-software/issues/582";
assert_and_click "auth_required" if ($desktop eq 'kde');
# bit sloppy but correct for both...
type_very_safely "weakpassword\n";
# as of 2019-04 when we hit this bug it seems to ask for
# auth *twice*, so handle that
sleep 3;
if (check_screen "auth_required", 1) {
type_very_safely "weakpassword\n";
}
}
}
# Wait for login screen to appear. Handle the annoying GPU buffer
@ -513,9 +528,12 @@ sub gnome_initial_setup {
}
}
}
# click 'Skip' one time (this is the 'goa' screen)
mouse_set(100,100);
wait_screen_change { assert_and_click "skip_button"; };
unless (get_var("VNC_CLIENT")) {
# click 'Skip' one time (this is the 'goa' screen). We don't
# get it on VNC_CLIENT case as network isn't working (yet)
mouse_set(100,100);
wait_screen_change { assert_and_click "skip_button"; };
}
send_key "ret";
if ($args{prelogin}) {
# create user

View File

@ -140,8 +140,8 @@ sub load_install_tests() {
# boot phase is loaded automatically every time
autotest::loadtest "tests/_boot_to_anaconda.pm";
# if this is a kickstart install, that's all folks
return if (get_var("KICKSTART"));
# if this is a kickstart or VNC install, that's all folks
return if (get_var("KICKSTART") || get_var("VNC_SERVER"));
# Root password and user creation spokes are suppressed on
# Workstation live install and Silverblue DVD install, so we do
@ -256,6 +256,10 @@ sub load_postinstall_tests() {
autotest::loadtest "tests/_memcheck.pm";
return;
}
# VNC client test's work is done once install is complete
if (get_var("VNC_CLIENT")) {
return;
}
# load the early tests
_load_early_postinstall_tests();

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 615,
"ypos": 437,
"width": 43,
"height": 14,
"type": "match"
}
],
"properties": [],
"tags": [
"boxes_allow_inhibit"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 17,
"ypos": 42,
"width": 16,
"height": 16,
"type": "match"
}
],
"properties": [],
"tags": [
"boxes_new_connection"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 115,
"ypos": 130,
"width": 50,
"height": 15,
"type": "match"
}
],
"properties": [],
"tags": [
"boxes_remote"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

View File

@ -799,6 +799,28 @@
},
test_suite => { name => "install_repository_hd_variation" },
},
{
machine => { name => "64bit" },
prio => 40,
product => {
arch => "x86_64",
distri => "fedora",
flavor => "Server-dvd-iso",
version => "*",
},
test_suite => { name => "install_vnc_server" },
},
{
machine => { name => "64bit" },
prio => 40,
product => {
arch => "x86_64",
distri => "fedora",
flavor => "Server-dvd-iso",
version => "*",
},
test_suite => { name => "install_vnc_client" },
},
{
machine => { name => "64bit" },
prio => 20,
@ -5116,6 +5138,30 @@
{ key => "REPOSITORY_VARIATION", value => "%LOCATION%" },
],
},
{
name => "install_vnc_server",
settings => [
{ key => "VNC_SERVER", value => "1" },
{ key => "GRUB", value => "inst.vnc net.ifnames=0 biosdevname=0 ip=10.0.2.114::10.0.2.2:255.255.255.0:vnc001.domain.local:eth0:off" },
{ key => "NICTYPE", value => "tap" },
{ key => "WORKER_CLASS", value => "tap" },
],
},
{
name => "install_vnc_client",
settings => [
{ key => "VNC_CLIENT", value => "1" },
{ key => "BOOTFROM", value => "c" },
{ key => "INSTALL", value => "1" },
{ key => "DESKTOP", value => "gnome" },
{ key => "HDD_1", value => "disk_f%CURRREL%_desktop_4_x86_64.img" },
{ key => "PARALLEL_WITH", value => "install_vnc_server" },
{ key => "PREINSTALL", value => "_graphical_wait_login _vnc_client_connect" },
{ key => "GRUB_POSTINSTALL", value => "net.ifnames=0 biosdevname=0" },
{ key => "NICTYPE", value => "tap" },
{ key => "WORKER_CLASS", value => "tap" },
],
},
{
name => "base_selinux",
settings => [

View File

@ -3,6 +3,7 @@ use strict;
use lockapi;
use testapi;
use utils;
use tapnet;
use anaconda;
sub run {
@ -51,13 +52,16 @@ sub run {
my $timeout = 30;
$timeout = 120 if (get_var("PXEBOOT"));
# call do_bootloader with postinstall=0, the params, and the mutex
do_bootloader(postinstall=>0, params=>$params, mutex=>$mutex, timeout=>$timeout);
# call do_bootloader with postinstall=0, the params, and the mutex,
# unless we're a VNC install client (no bootloader there)
unless (get_var("VNC_CLIENT")) {
do_bootloader(postinstall=>0, params=>$params, mutex=>$mutex, timeout=>$timeout);
}
# Read variables for identification tests (see further).
my $identification = get_var('IDENTIFICATION');
# proceed to installer
if (get_var("KICKSTART")) {
if (get_var("KICKSTART") || get_var("VNC_SERVER")) {
# wait for the bootloader *here* - in a test that inherits from
# anacondatest - so that if something goes wrong during install,
# we get anaconda logs. sleep a bit first so we don't get a

View File

@ -14,6 +14,12 @@ sub run {
$wait_time = 1800 if (get_var("KICKSTART"));
$wait_time = 6000 if (get_var("UPGRADE") && !get_var("ENCRYPT_PASSWORD"));
# handle bootloader, if requested
if (get_var("GRUB_POSTINSTALL")) {
do_bootloader(postinstall=>1, params=>get_var("GRUB_POSTINSTALL"), timeout=>$wait_time);
$wait_time = 300;
}
# Handle pre-login initial setup if we're doing INSTALL_NO_USER
if (get_var("INSTALL_NO_USER") && !get_var("_setup_done")) {
if (get_var("DESKTOP") eq 'gnome') {

View File

@ -0,0 +1,28 @@
use base "installedtest";
use strict;
use tapnet;
use testapi;
use utils;
sub run {
my $self = shift;
$self->root_console(tty=>3);
setup_tap_static('10.0.2.115', 'vnc002.domain.local');
# test test: check if we can see the server
assert_script_run "ping -c 2 10.0.2.114";
desktop_vt;
menu_launch_type('boxes');
assert_and_click('boxes_new_connection');
assert_and_click('boxes_remote');
type_safely("vnc://10.0.2.114:5901\n");
assert_and_click('boxes_allow_inhibit');
assert_and_click('boxes_fullscreen');
}
sub test_flags {
return { fatal => 1 };
}
1;
# vim: set sw=4 et:

View File

@ -13,20 +13,6 @@ sub run {
prepare_test_packages;
# get back to the desktop
desktop_vt;
# work around https://gitlab.gnome.org/GNOME/gnome-software/issues/582
# if it happens. As of 2019-05, seeing something similar on KDE too
if (check_screen "auth_required", 10) {
record_soft_failure "spurious 'auth required' - https://gitlab.gnome.org/GNOME/gnome-software/issues/582";
assert_and_click "auth_required" if ($desktop eq 'kde');
# bit sloppy but correct for both...
type_very_safely "weakpassword\n";
# as of 2019-04 when we hit this bug it seems to ask for
# auth *twice*, so handle that
sleep 3;
if (check_screen "auth_required", 1) {
type_very_safely "weakpassword\n";
}
}
# run the updater
if ($desktop eq 'kde') {