1
0
mirror of https://pagure.io/fedora-qa/os-autoinst-distri-fedora.git synced 2025-02-16 12:34:32 +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 Exporter;
use testapi; use testapi;
use utils;
our @EXPORT = qw/clone_host_file setup_tap_static get_host_dns/; our @EXPORT = qw/clone_host_file setup_tap_static get_host_dns/;
my $self = shift; my $self = shift;
@ -32,12 +34,15 @@ sub setup_tap_static {
# for the system with a static IP address and possibly a specific # for the system with a static IP address and possibly a specific
# hostname # hostname
# It seems that this counts on being on root console, # It is possible on certain tests that this will be running while
# however, if we are not there, switch first. # 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; my $console = 0;
unless (check_screen("root_console")) { unless (check_screen("root_console")) {
$console = 1; $console = 1;
$self->root_console(tty => 3); send_key("ctrl-alt-f3");
wait_still_screen(5);
console_login(user => "root");
} }
my $ip = shift; my $ip = shift;
my $hostname = shift || ""; my $hostname = shift || "";
@ -63,7 +68,8 @@ sub setup_tap_static {
assert_script_run "nmcli con up '$connection'"; assert_script_run "nmcli con up '$connection'";
# for debugging # for debugging
assert_script_run "nmcli -t con show '$connection'"; 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) { if ($console) {
desktop_vt(); desktop_vt();
} }