From 92d52c6ac687c88cc80ee95eb788b515e1f698eb Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Fri, 30 Oct 2020 11:27:45 -0700 Subject: [PATCH] Split VNC client steps in two for aarch64 timing issue So, there's a problem with how we figure out the NetworkManager connection to use in setup_tap_static: it expects the first connection in the list to be the right one, but this is only actually true so long as it's *active*. When we're in the tap case, it's usually not going to actually *work* out of the box on boot (or else we wouldn't need setup_tap_static at all...), so some time after boot, NetworkManager gives up on it and marks it as inactive. And after that, setup_tap_static won't work any more. I never noticed this as a problem before because usually we do setup_tap_static before that point. But it seems in the vnc client tests, on aarch64, desktop boot and login is slow enough that by the time we switch to a VT and try to setup the network, we're very close to that cutoff, and sometimes miss it. This, I hope, avoids the problem by doing the network setup in that test before we deal with the desktop login, then doing the desktop login, then doing the actual VNC bits. The alternative here would be to figure out a better way to do setup_tap_static, but I can't. Signed-off-by: Adam Williamson --- templates.fif.json | 4 ++-- tests/_vnc_client_connect.pm | 7 ------- tests/_vnc_client_connect_pre.pm | 23 +++++++++++++++++++++++ tests/_vncconnect_client_setup.pm | 8 -------- tests/_vncconnect_client_setup_pre.pm | 25 +++++++++++++++++++++++++ 5 files changed, 50 insertions(+), 17 deletions(-) create mode 100644 tests/_vnc_client_connect_pre.pm create mode 100644 tests/_vncconnect_client_setup_pre.pm diff --git a/templates.fif.json b/templates.fif.json index 6b3c910c..7d1029c4 100644 --- a/templates.fif.json +++ b/templates.fif.json @@ -1559,7 +1559,7 @@ "INSTALL": "1", "NICTYPE": "tap", "PARALLEL_WITH": "install_vnc_server", - "PREINSTALL": "_graphical_wait_login _vnc_client_connect", + "PREINSTALL": "_vnc_client_connect_pre _graphical_wait_login _vnc_client_connect", "VNC_CLIENT": "1", "WORKER_CLASS": "tap" } @@ -1589,7 +1589,7 @@ "HDD_1": "disk_f%CURRREL%_desktop_4_%ARCH%.img", "INSTALL": "1", "NICTYPE": "tap", - "PREINSTALL": "_graphical_wait_login _vncconnect_client_setup", + "PREINSTALL": "_vncconnect_client_setup_pre _graphical_wait_login _vncconnect_client_setup", "VNC_CLIENT": "1", "WORKER_CLASS": "tap" } diff --git a/tests/_vnc_client_connect.pm b/tests/_vnc_client_connect.pm index c6611162..4a674b56 100644 --- a/tests/_vnc_client_connect.pm +++ b/tests/_vnc_client_connect.pm @@ -1,16 +1,9 @@ use base "installedtest"; use strict; -use tapnet; use testapi; use utils; sub run { - my $self = shift; - $self->root_console(tty=>3); - setup_tap_static('172.16.2.115', 'vnc002.domain.local'); - # test test: check if we can see the server - assert_script_run "ping -c 2 172.16.2.114"; - desktop_vt; menu_launch_type('boxes'); assert_screen ['apps_boxes_tutorial', 'boxes_new_connection']; if (match_has_tag 'apps_boxes_tutorial') { diff --git a/tests/_vnc_client_connect_pre.pm b/tests/_vnc_client_connect_pre.pm new file mode 100644 index 00000000..b78e519e --- /dev/null +++ b/tests/_vnc_client_connect_pre.pm @@ -0,0 +1,23 @@ +use base "installedtest"; +use strict; +use tapnet; +use testapi; +use utils; + +sub run { + my $self = shift; + boot_to_login_screen(timeout => 300); + $self->root_console(tty=>3); + setup_tap_static('172.16.2.115', 'vnc002.domain.local'); + # test test: check if we can see the server + assert_script_run "ping -c 2 172.16.2.114"; + desktop_vt; +} + +sub test_flags { + return { fatal => 1 }; +} + +1; + +# vim: set sw=4 et: diff --git a/tests/_vncconnect_client_setup.pm b/tests/_vncconnect_client_setup.pm index c2fb5f7f..cee15162 100644 --- a/tests/_vncconnect_client_setup.pm +++ b/tests/_vncconnect_client_setup.pm @@ -1,19 +1,11 @@ use base "installedtest"; use strict; use lockapi; -use tapnet; use testapi; use utils; sub run { my $self = shift; - $self->root_console(tty=>3); - setup_tap_static('172.16.2.117', 'vnc004.domain.local'); - # install tigervnc (Boxes doesn't do reverse VNC) - assert_script_run "dnf -y install tigervnc", 180; - # take down the firewall - assert_script_run "systemctl stop firewalld"; - desktop_vt; menu_launch_type 'terminal'; wait_still_screen 5; type_very_safely "vncviewer -FullScreen -listen\n"; diff --git a/tests/_vncconnect_client_setup_pre.pm b/tests/_vncconnect_client_setup_pre.pm new file mode 100644 index 00000000..08bb6f57 --- /dev/null +++ b/tests/_vncconnect_client_setup_pre.pm @@ -0,0 +1,25 @@ +use base "installedtest"; +use strict; +use tapnet; +use testapi; +use utils; + +sub run { + my $self = shift; + boot_to_login_screen(timeout => 300); + $self->root_console(tty=>3); + setup_tap_static('172.16.2.117', 'vnc004.domain.local'); + # install tigervnc (Boxes doesn't do reverse VNC) + assert_script_run "dnf -y install tigervnc", 180; + # take down the firewall + assert_script_run "systemctl stop firewalld"; + desktop_vt; +} + +sub test_flags { + return { fatal => 1 }; +} + +1; + +# vim: set sw=4 et: