1
0
mirror of https://pagure.io/fedora-qa/os-autoinst-distri-fedora.git synced 2024-11-21 21:43:08 +00:00

Update tapnet.pm

This commit is contained in:
Lukáš Růžička 2024-11-20 15:55:42 +01:00
parent 0eedaef150
commit c506cfb7c0

View File

@ -6,6 +6,8 @@ use base 'Exporter';
use Exporter;
use testapi;
use utils;
our @EXPORT = qw/clone_host_file setup_tap_static get_host_dns/;
my $self = shift;
@ -32,12 +34,15 @@ sub setup_tap_static {
# for the system with a static IP address and possibly a specific
# hostname
# It seems that this counts on being on root console,
# however, if we are not there, switch first.
# It is possible on certain tests that this will be running while
# we are inside a graphical session. In this case we need to switch
# to the console before we proceed with the network settings.
my $console = 0;
unless (check_screen("root_console")) {
$console = 1;
$self->root_console(tty => 3);
send_key("ctrl-alt-f3");
wait_still_screen(5);
console_login(user => "root");
}
my $ip = shift;
my $hostname = shift || "";
@ -63,7 +68,8 @@ sub setup_tap_static {
assert_script_run "nmcli con up '$connection'";
# for debugging
assert_script_run "nmcli -t con show '$connection'";
# If we have switched here from graphics, go back there.
# If we have switched to console from a graphical
# environment, here we come back to it.
if ($console) {
desktop_vt();
}