#352 Rewrite tests from VNC to RDP
Merged 4 months ago by adamwill. Opened 4 months ago by lruzicka.

file modified
+2
@@ -87,6 +87,8 @@ 

  | `_SECRET_BUGZILLA_PASSWORD` | string | not set | used with `BUGZILLA_LOGIN` | This is used to store a password string which does not get exposed in log files. |

  | `_SECRET_BUGZILLA_APIKEY` | string | not set | used with other secrets | This is used to store an API key which does not get exposed in log files. |

  | `USE_CUPS` | boolean | `false`/not set | if set, the desktop printing test will use cups-pdf instead of the generic method |

+ | `RDP_SERVER` | boolean | `false`/not set | set to identify an RDP server which will modify the script path for installation tests |

+ | `RDP_CLIENT` | boolean | `false`/not set | set to identify an RDP client which will modify the script path for installation tests |

  

  Run variables

  -------------

file modified
+4 -4
@@ -156,8 +156,8 @@ 

      # boot phase is loaded automatically every time

      autotest::loadtest "tests/_boot_to_anaconda.pm";

  

-     # if this is a kickstart or VNC install, that's all folks

-     return if (get_var("KICKSTART") || get_var("VNC_SERVER"));

+     # if this is a kickstart or RDP install, that's all folks

+     return if (get_var("KICKSTART") || get_var("RDP_SERVER"));

  

      # Root password and user creation spokes are suppressed on

      # Workstation live install and Silverblue DVD install, so we do
@@ -273,8 +273,8 @@ 

          autotest::loadtest "tests/_memcheck.pm";

          return;

      }

-     # VNC client test's work is done once install is complete

-     if (get_var("VNC_CLIENT")) {

+     # RDP client test's work is done once install is complete

+     if (get_var("RDP_CLIENT")) {

          return;

      }

  

@@ -0,0 +1,15 @@ 

+ {

+   "area": [

+     {

+       "xpos": 13,

+       "ypos": 43,

+       "width": 23,

+       "height": 23,

+       "type": "match"

+     }

+   ],

+   "properties": [],

+   "tags": [

+     "connections_add_connection"

+   ]

+ } 

\ No newline at end of file

@@ -0,0 +1,15 @@ 

+ {

+   "area": [

+     {

+       "xpos": 555,

+       "ypos": 556,

+       "width": 96,

+       "height": 19,

+       "type": "match"

+     }

+   ],

+   "properties": [],

+   "tags": [

+     "connections_authenticate_button"

+   ]

+ } 

\ No newline at end of file

@@ -0,0 +1,15 @@ 

+ {

+   "area": [

+     {

+       "xpos": 300,

+       "ypos": 311,

+       "width": 62,

+       "height": 20,

+       "type": "match"

+     }

+   ],

+   "properties": [],

+   "tags": [

+     "connections_connect_button"

+   ]

+ } 

\ No newline at end of file

@@ -0,0 +1,15 @@ 

+ {

+   "area": [

+     {

+       "xpos": 614,

+       "ypos": 220,

+       "width": 55,

+       "height": 21,

+       "type": "match"

+     }

+   ],

+   "properties": [],

+   "tags": [

+     "connections_connect_button"

+   ]

+ } 

\ No newline at end of file

@@ -0,0 +1,15 @@ 

+ {

+   "area": [

+     {

+       "xpos": 816,

+       "ypos": 42,

+       "width": 23,

+       "height": 24,

+       "type": "match"

+     }

+   ],

+   "properties": [],

+   "tags": [

+     "connections_fullscreen_toggle"

+   ]

+ } 

\ No newline at end of file

@@ -0,0 +1,15 @@ 

+ {

+   "area": [

+     {

+       "xpos": 475,

+       "ypos": 595,

+       "width": 74,

+       "height": 19,

+       "type": "match"

+     }

+   ],

+   "properties": [],

+   "tags": [

+     "connections_no_thanks"

+   ]

+ } 

\ No newline at end of file

@@ -0,0 +1,15 @@ 

+ {

+   "area": [

+     {

+       "xpos": 60,

+       "ypos": 237,

+       "width": 93,

+       "height": 18,

+       "type": "match"

+     }

+   ],

+   "properties": [],

+   "tags": [

+     "connections_type_rdp"

+   ]

+ } 

\ No newline at end of file

@@ -0,0 +1,15 @@ 

+ {

+   "area": [

+     {

+       "xpos": 619,

+       "ypos": 219,

+       "width": 47,

+       "height": 21,

+       "type": "match"

+     }

+   ],

+   "properties": [],

+   "tags": [

+     "connections_verify_button"

+   ]

+ } 

\ No newline at end of file

@@ -0,0 +1,15 @@ 

+ {

+   "area": [

+     {

+       "xpos": 349,

+       "ypos": 280,

+       "width": 123,

+       "height": 22,

+       "type": "match"

+     }

+   ],

+   "properties": [],

+   "tags": [

+     "connections_verify_screen"

+   ]

+ } 

\ No newline at end of file

@@ -0,0 +1,15 @@ 

+ {

+   "area": [

+     {

+       "xpos": 352,

+       "ypos": 493,

+       "width": 319,

+       "height": 26,

+       "type": "match"

+     }

+   ],

+   "properties": [],

+   "tags": [

+     "connections_welcome"

+   ]

+ } 

\ No newline at end of file

@@ -0,0 +1,16 @@ 

+ {

+   "area": [

+     {

+       "width": 32,

+       "ypos": 46,

+       "height": 21,

+       "xpos": 970,

+       "type": "match"

+     }

+   ],

+   "properties": [],

+   "tags": [

+     "skip_button",

+     "LANGUAGE-english"

+   ]

+ } 

\ No newline at end of file

empty or binary file added
@@ -0,0 +1,16 @@ 

+ {

+   "area": [

+     {

+       "xpos": 970,

+       "width": 32,

+       "type": "match",

+       "height": 21,

+       "ypos": 46

+     }

+   ],

+   "properties": [],

+   "tags": [

+     "skip_button",

+     "LANGUAGE-english"

+   ]

+ } 

\ No newline at end of file

empty or binary file added
file modified
+31
@@ -2266,6 +2266,37 @@ 

                  "WORKER_CLASS": "tap"

              }

          },

+         "install_rdp_client": {

+             "profiles": {

+                 "fedora-Server-dvd-iso-aarch64-*-aarch64": 40,

+                 "fedora-Server-dvd-iso-ppc64le-*-ppc64le": 40,

+                 "fedora-Server-dvd-iso-x86_64-*-64bit": 40

+             },

+             "settings": {

+                 "BOOTFROM": "c",

+                 "DESKTOP": "gnome",

+                 "HDD_1": "disk_f%CURRREL%_desktop_5_%ARCH%.qcow2",

+                 "INSTALL": "1",

+                 "NICTYPE": "tap",

+                 "PARALLEL_WITH": "install_rdp_server",

+                 "PREINSTALL": "_rdp_client_connect_pre _graphical_wait_login _rdp_client_connect",

+                 "RDP_CLIENT": "1",

+                 "WORKER_CLASS": "tap"

+             }

+         },

+         "install_rdp_server": {

+             "profiles": {

+                 "fedora-Server-dvd-iso-aarch64-*-aarch64": 40,

+                 "fedora-Server-dvd-iso-ppc64le-*-ppc64le": 40,

+                 "fedora-Server-dvd-iso-x86_64-*-64bit": 40

+             },

+             "settings": {

+                 "GRUB": "inst.rdp inst.rdp.username=rapunzel inst.rdp.password=towertop net.ifnames=0 biosdevname=0 ip=172.16.2.114::172.16.2.2:255.255.255.0:rdp001.test.openqa.fedoraproject.org:eth0:off",

+                 "NICTYPE": "tap",

+                 "RDP_SERVER": "1",

+                 "WORKER_CLASS": "tap"

+             }

+         },

          "install_xfs": {

              "profiles": {

                  "fedora-Server-dvd-iso-aarch64-*-aarch64": 40,

file modified
+4 -4
@@ -104,15 +104,15 @@ 

      $timeout = 120 if (get_var("IS_PXE"));

  

      # 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")) {

+     # unless we're a RDP install client (no bootloader there)

+     unless (get_var("RDP_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") || get_var("VNC_SERVER")) {

+     if (get_var("KICKSTART") || get_var("RDP_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
@@ -123,7 +123,7 @@ 

      }

      else {

          if (get_var("ANACONDA_TEXT")) {

-             # select that we don't want to start VNC; we want to run in text mode

+             # select that we don't want to start RDP; we want to run in text mode

              if (get_var("SERIAL_CONSOLE")) {

                  # we direct the installer to virtio-console1, and use

                  # virtio-console as a root console

@@ -98,9 +98,9 @@ 

          die "Error encountered!" if (check_screen "anaconda_error_report");

          # move the mouse a bit

          mouse_set 100, 100;

-         # also click, if we're a VNC client, seems just moving mouse

+         # also click, if we're a RDP client, seems just moving mouse

          # isn't enough to defeat blanking

-         mouse_click if (get_var("VNC_CLIENT"));

+         mouse_click if (get_var("RDP_CLIENT"));

          mouse_hide;

          last if (check_screen "anaconda_install_done", $interval);

          $timeout -= $interval;
@@ -136,10 +136,10 @@ 

      # check whether install is affected by

      # https://bugzilla.redhat.com/show_bug.cgi?id=2268505 ,

      # soft fail and work around it if so

-     # our approach for taking all these actions doesn't work on VNC

+     # our approach for taking all these actions doesn't work on RDP

      # installs, fortunately we don't need any of them in that case

-     # yet, so for now let's just flush the list here if we're VNC

-     @actions = () if (get_var("VNC_CLIENT"));

+     # yet, so for now let's just flush the list here if we're RDP

+     @actions = () if (get_var("RDP_CLIENT"));

      # If we have no actions, let's just go ahead and reboot now,

      # unless this is memcheck

      unless (@actions) {

@@ -0,0 +1,48 @@ 

+ use base "installedtest";

+ use strict;

+ use testapi;

+ use utils;

+ 

+ sub run {

+     # run connections

+     menu_launch_type('Connections');

+     # If we see the Welcome screen, dismiss it.

+     if (check_screen("connections_welcome", timeout => 10)) {

+         assert_and_click("connections_no_thanks");

+     }

+     # Add a connection

+     assert_and_click("connections_add_connection");

+     # Fill in the connection details

+     type_very_safely("172.16.2.114");

+     assert_and_click("connections_type_rdp");

+     assert_and_click("connections_connect_button");

+ 

+     # "Verify" connection.

+     assert_screen("connections_verify_screen");

+     assert_and_click("connections_verify_button");

+ 

+     # Fill in credentials

+     send_key("tab");

+     type_very_safely("rapunzel");

+     send_key("tab");

+     sleep(1);

+     send_key("tab");

+     sleep(1);

+     type_very_safely("towertop");

+     assert_and_click("connections_authenticate_button");

+     wait_still_screen(5);

+     # Make connection full screen to comply with installation needles.

+     assert_and_click("connections_fullscreen_toggle");

+ 

+     # The connection should have been established, so let's

+     # check for it.

+     assert_screen("anaconda_select_install_lang");

+ }

+ 

+ sub test_flags {

+     return {fatal => 1};

+ }

+ 

+ 1;

+ 

+ # vim: set sw=4 et:

@@ -0,0 +1,31 @@ 

+ 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', 'rdp002.test.openqa.fedoraproject.org');

+     # test test: check if we can see the server

+     assert_script_run "ping -c 2 172.16.2.114";

+     # We try to connect through Connections which should

+     # be installed by default, however if this is not

+     # the case, we do not want the test to fail, so we will

+     # install the app and record a soft failure.

+     if (script_run("rpm -qa | grep gnome-connections", timeout => 30)) {

+         assert_script_run("dnf install -y gnome-connections", timeout => 120);

+         record_soft_failure("Gnome Connections are not installed.");

+     }

+     desktop_vt;

+ }

+ 

+ sub test_flags {

+     return {fatal => 1};

+ }

+ 

+ 1;

+ 

+ # vim: set sw=4 et:

The VNC installation method has been replaced with a similar method
based on RDP. This PR uses the old mechanism and alters it for the
RDP method.

The test suite consists of two parts, a server and a client part.
The server is the real test on which Fedora Custom installation
is performed from the client via RDP.

The client is spinned off the pre-installed desktop image.

Fixes #345

Merge Failed.

This change or one of its cross-repo dependencies was unable to be automatically merged with the current state of its repository. Please rebase the change and upload a new patchset.
Warning:
Error merging pagure.io/fedora-qa/os-autoinst-distri-fedora for 352,ca033c91ad03492ea52acc032572f4f8c196f720

Merge Failed.

This change or one of its cross-repo dependencies was unable to be automatically merged with the current state of its repository. Please rebase the change and upload a new patchset.
Warning:
Error merging pagure.io/fedora-qa/os-autoinst-distri-fedora for 352,ca033c91ad03492ea52acc032572f4f8c196f720

Merge Failed.

This change or one of its cross-repo dependencies was unable to be automatically merged with the current state of its repository. Please rebase the change and upload a new patchset.
Warning:
Error merging pagure.io/fedora-qa/os-autoinst-distri-fedora for 352,ca033c91ad03492ea52acc032572f4f8c196f720

rebased onto dab034c

4 months ago

Build failed. More information on how to proceed and troubleshoot errors available at https://fedoraproject.org/wiki/Zuul-based-ci
https://fedora.softwarefactory-project.io/zuul/buildset/94374a6ed2d64befa0f79650ab1ab477

rebased onto 564d019

4 months ago

rebased onto 564d019

4 months ago

rebased onto 564d019

4 months ago

I am not getting what is the problem here, I did not touch fifloader.py anyhow and when I make a diff to the master branch myself, both files are the same. It is not missing anything.

What is the problem, @adamwill ? Thanks for your help.

Tag(s) without needle(s) found!
skip_button
connections_delete_local_cert
connections_unexpected_cert

the output of the needle check script gets kinda hidden :/ you have to click the 'more' link and scroll back to find it. I dunno if I can make it clearer somehow.

Tag(s) without needle(s) found! skip_button connections_delete_local_cert connections_unexpected_cert
the output of the needle check script gets kinda hidden :/ you have to click the 'more' link and scroll back to find it. I dunno if I can make it clearer somehow.

Oh, I did not see there was the more option. That clears the situation and I will know for next time.
Thanks.

The missing needles cover for if check_screen functions, so they might not have appeared that often. I will need to make sure, I will get into them and create the needles.

1 new commit added

  • Add skip button needle.
4 months ago

1 new commit added

  • Delete certificate checking as it is no longer needed.
4 months ago

rebased onto 1cf138c

4 months ago

please remove this again. it was removed as part of F39 EOL cleanup, and I guess came back via whatever you did to get the VNC code back.

this comment seems to be a lie. we're using Connections, not xfreerdp.

i guess I'll just fix up the things I noted myself, as they're pretty trivial. will test later.

rebased onto 1cf138c

4 months ago

Ran this a couple times and it worked, so merging. Thanks!

Pull-Request has been merged by adamwill

4 months ago
Metadata
Changes Summary 31
+2 -0
file changed
VARIABLES.md
+4 -4
file changed
main.pm
+15
file added
needles/gnome/apps/connections/connections_add_connection-20241203.json
+0
file added
needles/gnome/apps/connections/connections_add_connection-20241203.png
+15
file added
needles/gnome/apps/connections/connections_authenticate_button-20241203.json
+0
file added
needles/gnome/apps/connections/connections_authenticate_button-20241203.png
+15
file added
needles/gnome/apps/connections/connections_connect_button-20241203.json
+0
file added
needles/gnome/apps/connections/connections_connect_button-20241203.png
+15
file added
needles/gnome/apps/connections/connections_connect_button-verify-20241203.json
+0
file added
needles/gnome/apps/connections/connections_connect_button-verify-20241203.png
+15
file added
needles/gnome/apps/connections/connections_fullscreen_toggle-20241203.json
+0
file added
needles/gnome/apps/connections/connections_fullscreen_toggle-20241203.png
+15
file added
needles/gnome/apps/connections/connections_no_thanks-20241203.json
+0
file added
needles/gnome/apps/connections/connections_no_thanks-20241203.png
+15
file added
needles/gnome/apps/connections/connections_type_rdp-20241203.json
+0
file added
needles/gnome/apps/connections/connections_type_rdp-20241203.png
+15
file added
needles/gnome/apps/connections/connections_verify_button-20241203.json
+0
file added
needles/gnome/apps/connections/connections_verify_button-20241203.png
+15
file added
needles/gnome/apps/connections/connections_verify_screen-20241203.json
+0
file added
needles/gnome/apps/connections/connections_verify_screen-20241203.png
+15
file added
needles/gnome/apps/connections/connections_welcome-20241203.json
+0
file added
needles/gnome/apps/connections/connections_welcome-20241203.png
+16
file added
needles/gnome/skip_button-bold-20220817.json
+0
file added
needles/gnome/skip_button-bold-20220817.png
+16
file added
needles/gnome/skip_button-bold-20230701.json
+0
file added
needles/gnome/skip_button-bold-20230701.png
+31 -0
file changed
templates.fif.json
+4 -4
file changed
tests/_boot_to_anaconda.pm
+5 -5
file changed
tests/_do_install_and_reboot.pm
+48
file added
tests/_rdp_client_connect.pm
+31
file added
tests/_rdp_client_connect_pre.pm