1
0
mirror of https://pagure.io/fedora-qa/os-autoinst-distri-fedora.git synced 2024-12-23 02:33:08 +00:00
os-autoinst-distri-fedora/tests/applications/gnome-panel/network.pm
Adam Williamson 5f702b0be8 Run update repo setup steps from a serial console
This is a surprisingly large change as we want to go back to
the console we were previously on after doing it. To do that we
need to know what console we were on, and to know *that*, we need
to port everything that currently uses (ctrl-)alt-fX to switch
consoles to use select_console instead.

This is primarily intended to make running setup_repos.py faster
when it has to download a lot of packages (as typing in hundreds
of package names is quite slow). But it actually makes the whole
thing faster, even when only downloading one or two packages.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2024-01-11 12:09:59 -08:00

54 lines
1.3 KiB
Perl

use base "installedtest";
use strict;
use testapi;
use utils;
# This part of the suite Tests that the panel
# can be used to switch network off and on.
sub switch_network {
my $type = shift;
# Click on the controls.
assert_and_click("panel_controls");
# Click on Network button to toggle network
assert_and_click("panel_ctrl_networks");
wait_still_screen(2);
# Get rid of the window to be able to make tests
send_key("esc");
}
sub run {
my $self = shift;
# Toggle network
switch_network();
# Switch to console
$self->root_console(tty => 3);
# If there is no network the script fails which is exactly
# what we need.
assert_script_run("! ping -c 10 8.8.8.8");
# Let's switch back to desktop. Normally, we would use the
# desktop_vt subroutine, but since we do not have networking
# it does not work reliably. Ergo, we will use the old known
# ctrl-alt-f2
select_console "tty2-console";
sleep(3);
# Toggle network
switch_network();
# Switch to console
$self->root_console(tty => 3);
# If there is no network the script fails which is exactly
# what we need.
assert_script_run("ping -c 10 8.8.8.8");
}
sub test_flags {
return {always_rollback => 1};
}
1;
# vim: set sw=4 et: