diff --git a/needles/cockpit/cockpit_software_updates.json b/needles/cockpit/cockpit_software_updates.json new file mode 100644 index 00000000..cab4b5d8 --- /dev/null +++ b/needles/cockpit/cockpit_software_updates.json @@ -0,0 +1,15 @@ +{ + "properties": [], + "tags": [ + "cockpit_software_updates" + ], + "area": [ + { + "xpos": 68, + "ypos": 538, + "width": 51, + "height": 18, + "type": "match" + } + ] +} \ No newline at end of file diff --git a/needles/cockpit/cockpit_software_updates.png b/needles/cockpit/cockpit_software_updates.png new file mode 100644 index 00000000..8ae42cdf Binary files /dev/null and b/needles/cockpit/cockpit_software_updates.png differ diff --git a/needles/cockpit/cockpit_updates_all_install.json b/needles/cockpit/cockpit_updates_all_install.json new file mode 100644 index 00000000..063c22c7 --- /dev/null +++ b/needles/cockpit/cockpit_updates_all_install.json @@ -0,0 +1,15 @@ +{ + "properties": [], + "tags": [ + "cockpit_updates_all_install" + ], + "area": [ + { + "xpos": 778, + "ypos": 266, + "width": 56, + "height": 17, + "type": "match" + } + ] +} \ No newline at end of file diff --git a/needles/cockpit/cockpit_updates_all_install.png b/needles/cockpit/cockpit_updates_all_install.png new file mode 100644 index 00000000..4df44d20 Binary files /dev/null and b/needles/cockpit/cockpit_updates_all_install.png differ diff --git a/needles/cockpit/cockpit_updates_auto-20190529.json b/needles/cockpit/cockpit_updates_auto-20190529.json new file mode 100644 index 00000000..677158ff --- /dev/null +++ b/needles/cockpit/cockpit_updates_auto-20190529.json @@ -0,0 +1,15 @@ +{ + "area": [ + { + "height": 34, + "type": "match", + "ypos": 190, + "width": 48, + "xpos": 468 + } + ], + "properties": [], + "tags": [ + "cockpit_updates_auto" + ] +} \ No newline at end of file diff --git a/needles/cockpit/cockpit_updates_auto-20190529.png b/needles/cockpit/cockpit_updates_auto-20190529.png new file mode 100644 index 00000000..010073f4 Binary files /dev/null and b/needles/cockpit/cockpit_updates_auto-20190529.png differ diff --git a/needles/cockpit/cockpit_updates_auto.json b/needles/cockpit/cockpit_updates_auto.json new file mode 100644 index 00000000..acd8516e --- /dev/null +++ b/needles/cockpit/cockpit_updates_auto.json @@ -0,0 +1,15 @@ +{ + "properties": [], + "tags": [ + "cockpit_updates_auto" + ], + "area": [ + { + "xpos": 443, + "ypos": 204, + "width": 29, + "height": 17, + "type": "match" + } + ] +} \ No newline at end of file diff --git a/needles/cockpit/cockpit_updates_auto.png b/needles/cockpit/cockpit_updates_auto.png new file mode 100644 index 00000000..ffda8540 Binary files /dev/null and b/needles/cockpit/cockpit_updates_auto.png differ diff --git a/needles/cockpit/cockpit_updates_auto_on.json b/needles/cockpit/cockpit_updates_auto_on.json new file mode 100644 index 00000000..ad3dc22e --- /dev/null +++ b/needles/cockpit/cockpit_updates_auto_on.json @@ -0,0 +1,15 @@ +{ + "properties": [], + "tags": [ + "cockpit_updates_auto_on" + ], + "area": [ + { + "xpos": 368, + "ypos": 199, + "width": 66, + "height": 27, + "type": "match" + } + ] +} \ No newline at end of file diff --git a/needles/cockpit/cockpit_updates_auto_on.png b/needles/cockpit/cockpit_updates_auto_on.png new file mode 100644 index 00000000..e795013b Binary files /dev/null and b/needles/cockpit/cockpit_updates_auto_on.png differ diff --git a/needles/cockpit/cockpit_updates_available.json b/needles/cockpit/cockpit_updates_available.json new file mode 100644 index 00000000..3c41539b --- /dev/null +++ b/needles/cockpit/cockpit_updates_available.json @@ -0,0 +1,15 @@ +{ + "properties": [], + "tags": [ + "cockpit_updates_available" + ], + "area": [ + { + "xpos": 264, + "ypos": 259, + "width": 185, + "height": 28, + "type": "match" + } + ] +} \ No newline at end of file diff --git a/needles/cockpit/cockpit_updates_available.png b/needles/cockpit/cockpit_updates_available.png new file mode 100644 index 00000000..e4784aef Binary files /dev/null and b/needles/cockpit/cockpit_updates_available.png differ diff --git a/needles/cockpit/cockpit_updates_check.json b/needles/cockpit/cockpit_updates_check.json new file mode 100644 index 00000000..a2183ac5 --- /dev/null +++ b/needles/cockpit/cockpit_updates_check.json @@ -0,0 +1,15 @@ +{ + "properties": [], + "tags": [ + "cockpit_updates_check" + ], + "area": [ + { + "xpos": 787, + "ypos": 142, + "width": 110, + "height": 18, + "type": "match" + } + ] +} \ No newline at end of file diff --git a/needles/cockpit/cockpit_updates_check.png b/needles/cockpit/cockpit_updates_check.png new file mode 100644 index 00000000..1b850648 Binary files /dev/null and b/needles/cockpit/cockpit_updates_check.png differ diff --git a/needles/cockpit/cockpit_updates_console_update.json b/needles/cockpit/cockpit_updates_console_update.json new file mode 100644 index 00000000..0c7d9b61 --- /dev/null +++ b/needles/cockpit/cockpit_updates_console_update.json @@ -0,0 +1,15 @@ +{ + "area": [ + { + "xpos": 304, + "ypos": 309, + "width": 143, + "height": 17, + "type": "match" + } + ], + "properties": [], + "tags": [ + "cockpit_updates_console_update" + ] +} \ No newline at end of file diff --git a/needles/cockpit/cockpit_updates_console_update.png b/needles/cockpit/cockpit_updates_console_update.png new file mode 100644 index 00000000..496616c6 Binary files /dev/null and b/needles/cockpit/cockpit_updates_console_update.png differ diff --git a/needles/cockpit/cockpit_updates_dnf_install.json b/needles/cockpit/cockpit_updates_dnf_install.json new file mode 100644 index 00000000..d36588d5 --- /dev/null +++ b/needles/cockpit/cockpit_updates_dnf_install.json @@ -0,0 +1,15 @@ +{ + "properties": [], + "tags": [ + "cockpit_updates_dnf_install" + ], + "area": [ + { + "xpos": 846, + "ypos": 274, + "width": 43, + "height": 17, + "type": "match" + } + ] +} \ No newline at end of file diff --git a/needles/cockpit/cockpit_updates_dnf_install.png b/needles/cockpit/cockpit_updates_dnf_install.png new file mode 100644 index 00000000..5bdb61be Binary files /dev/null and b/needles/cockpit/cockpit_updates_dnf_install.png differ diff --git a/needles/cockpit/cockpit_updates_reconnect.json b/needles/cockpit/cockpit_updates_reconnect.json new file mode 100644 index 00000000..db991a2a --- /dev/null +++ b/needles/cockpit/cockpit_updates_reconnect.json @@ -0,0 +1,15 @@ +{ + "area": [ + { + "xpos": 565, + "ypos": 381, + "width": 75, + "height": 19, + "type": "match" + } + ], + "properties": [], + "tags": [ + "cockpit_updates_reconnect" + ] +} \ No newline at end of file diff --git a/needles/cockpit/cockpit_updates_reconnect.png b/needles/cockpit/cockpit_updates_reconnect.png new file mode 100644 index 00000000..afc28c64 Binary files /dev/null and b/needles/cockpit/cockpit_updates_reconnect.png differ diff --git a/needles/cockpit/cockpit_updates_restart_confirm.json b/needles/cockpit/cockpit_updates_restart_confirm.json new file mode 100644 index 00000000..bad9aab8 --- /dev/null +++ b/needles/cockpit/cockpit_updates_restart_confirm.json @@ -0,0 +1,15 @@ +{ + "properties": [], + "tags": [ + "cockpit_updates_restart_confirm" + ], + "area": [ + { + "xpos": 576, + "ypos": 260, + "width": 46, + "height": 15, + "type": "match" + } + ] +} \ No newline at end of file diff --git a/needles/cockpit/cockpit_updates_restart_confirm.png b/needles/cockpit/cockpit_updates_restart_confirm.png new file mode 100644 index 00000000..9a5f2d7c Binary files /dev/null and b/needles/cockpit/cockpit_updates_restart_confirm.png differ diff --git a/needles/cockpit/cockpit_updates_restart_ignore.json b/needles/cockpit/cockpit_updates_restart_ignore.json new file mode 100644 index 00000000..bb457a2b --- /dev/null +++ b/needles/cockpit/cockpit_updates_restart_ignore.json @@ -0,0 +1,15 @@ +{ + "properties": [], + "tags": [ + "cockpit_updates_restart_ignore" + ], + "area": [ + { + "xpos": 519, + "ypos": 260, + "width": 43, + "height": 16, + "type": "match" + } + ] +} \ No newline at end of file diff --git a/needles/cockpit/cockpit_updates_restart_ignore.png b/needles/cockpit/cockpit_updates_restart_ignore.png new file mode 100644 index 00000000..e93c6c01 Binary files /dev/null and b/needles/cockpit/cockpit_updates_restart_ignore.png differ diff --git a/needles/cockpit/cockpit_updates_security_install.json b/needles/cockpit/cockpit_updates_security_install.json new file mode 100644 index 00000000..c215f0ad --- /dev/null +++ b/needles/cockpit/cockpit_updates_security_install.json @@ -0,0 +1,15 @@ +{ + "properties": [], + "tags": [ + "cockpit_updates_security_install" + ], + "area": [ + { + "xpos": 619, + "ypos": 267, + "width": 93, + "height": 16, + "type": "match" + } + ] +} \ No newline at end of file diff --git a/needles/cockpit/cockpit_updates_security_install.png b/needles/cockpit/cockpit_updates_security_install.png new file mode 100644 index 00000000..c7600fa9 Binary files /dev/null and b/needles/cockpit/cockpit_updates_security_install.png differ diff --git a/needles/cockpit/cockpit_updates_updated.json b/needles/cockpit/cockpit_updates_updated.json new file mode 100644 index 00000000..f165c722 --- /dev/null +++ b/needles/cockpit/cockpit_updates_updated.json @@ -0,0 +1,15 @@ +{ + "properties": [], + "tags": [ + "cockpit_updates_updated" + ], + "area": [ + { + "xpos": 524, + "ypos": 276, + "width": 56, + "height": 43, + "type": "match" + } + ] +} \ No newline at end of file diff --git a/needles/cockpit/cockpit_updates_updated.png b/needles/cockpit/cockpit_updates_updated.png new file mode 100644 index 00000000..03d9a8e6 Binary files /dev/null and b/needles/cockpit/cockpit_updates_updated.png differ diff --git a/templates b/templates index ab33d479..dc5f3311 100755 --- a/templates +++ b/templates @@ -776,6 +776,17 @@ }, test_suite => { name => "server_cockpit_basic" }, }, + { + machine => { name => "64bit" }, + prio => 30, + product => { + arch => "x86_64", + distri => "fedora", + flavor => "Server-dvd-iso", + version => "*", + }, + test_suite => { name => "server_cockpit_updates" }, + }, { machine => { name => "64bit" }, prio => 30, @@ -2206,6 +2217,18 @@ }, test_suite => { name => "server_cockpit_default" }, }, + { + group_name => "Fedora PowerPC", + machine => { name => "ppc64le" }, + prio => 30, + product => { + arch => "ppc64le", + distri => "fedora", + flavor => "Server-dvd-iso", + version => "*", + }, + test_suite => { name => "server_cockpit_updates" }, + }, { group_name => "Fedora PowerPC", machine => { name => "ppc64le" }, @@ -3022,6 +3045,18 @@ }, test_suite => { name => "server_cockpit_basic" }, }, + { + group_name => "Fedora PowerPC", + machine => { name => "ppc64" }, + prio => 30, + product => { + arch => "ppc64", + distri => "fedora", + flavor => "Server-dvd-iso", + version => "*", + }, + test_suite => { name => "server_cockpit_updates" }, + }, { group_name => "Fedora PowerPC", machine => { name => "ppc64" }, @@ -3862,6 +3897,18 @@ }, test_suite => { name => "server_cockpit_basic" }, }, + { + group_name => "Fedora AArch64", + machine => { name => "aarch64" }, + prio => 30, + product => { + arch => "aarch64", + distri => "fedora", + flavor => "Server-dvd-iso", + version => "*", + }, + test_suite => { name => "server_cockpit_updates }, + }, { group_name => "Fedora AArch64", machine => { name => "aarch64" }, @@ -5640,6 +5687,20 @@ { key => "+HDD_1", value => "disk_%MACHINE%_cockpit.qcow2" }, ], }, + { + name => "server_cockpit_updates", + settings => [ + { key => "POSTINSTALL", value => "server_cockpit_updates" }, + { key => "USER_LOGIN", value => "false" }, + { key => "ROOT_PASSWORD", value => "weakpassword" }, + # to understand the '+' values in this test and the next, + # see the `jobs_from_update` docstring in fedora_openqa + # schedule.py + { key => "+START_AFTER_TEST", value => "server_cockpit_default" }, + { key => "BOOTFROM", value => "c" }, + { key => "+HDD_1", value => "disk_%MACHINE%_cockpit.qcow2" }, + ], + }, { name => "realmd_join_cockpit", settings => [ diff --git a/tests/server_cockpit_autoupdate.pm b/tests/server_cockpit_autoupdate.pm new file mode 100644 index 00000000..306dad12 --- /dev/null +++ b/tests/server_cockpit_autoupdate.pm @@ -0,0 +1,39 @@ +use base "installedtest"; +use strict; +use testapi; +use utils; +use packagetest; + +sub cockpit_update { + # This routine starts the Cockpit, logs in, and goes to the update page. + # run firefox and login to cockpit + start_cockpit(1); + # go to the updates screen + assert_and_click "cockpit_software_updates", '', 120; + # wait for the updates to download + while (!check_screen('cockpit_updates_check',1)) { + sleep 5; + } +} + +sub run { + my $self=shift; + bypass_1691487; + + # Start Cockpit + cockpit_update; + + # Switch on automatic updates + assert_and_click 'cockpit_updates_auto', '', 120; + assert_and_click 'cockpit_updates_dnf_install', '', 120; + assert_screen 'cockpit_updates_auto_on'; + +} + +sub test_flags { + return { always_rolllback => 1 }; +} + +1; + +# vim: set sw=4 et: diff --git a/tests/server_cockpit_updates.pm b/tests/server_cockpit_updates.pm new file mode 100644 index 00000000..5e23b7ef --- /dev/null +++ b/tests/server_cockpit_updates.pm @@ -0,0 +1,106 @@ +use base "installedtest"; +use strict; +use testapi; +use utils; +use packagetest; + +sub cockpit_update { + # This routine starts the Cockpit, logs in, and goes to the update page. + # run firefox and login to cockpit + start_cockpit(1); + # go to the updates screen + assert_and_click "cockpit_software_updates", '', 120; + # wait for the updates to download + while (!check_screen('cockpit_updates_check',1)) { + sleep 5; + } +} + +sub run { + my $self=shift; + bypass_1691487; + # Test if updates are available for the system -> if they are not + # prepare test packages that provide a possibilty to update + # something (See lib/packagetest.pm). + + script_run "dnf check-update ; echo \$? > status"; + my $result = script_output "cat status"; + my $cockdate = "0"; + if ($result eq "0") { + print "INFO: DNF did not find any packages to update. Will continue using modified packages."; + prepare_test_packages; + verify_installed_packages; + } + elsif ($result eq "100") { + print "INFO: DNF found packages to update. Will continue with real packages."; + # When Cockpit is updated through cockpit, the interface gets disconnected + # and the user logged out. Let us check if that is the situation. + } + else { + record_soft_failure "DNF returned an error exit code. I will try to run the test anyway."; + } + + # Start Cockpit + cockpit_update; + + + # If security updates are available, install them first, + # so that we test the most buttons in one go. + # After updates, ignore restart because we do not need + # restarting the machine to continue. Also, we would have + # to deal with much more complicated workflow. + # + if (check_screen('cockpit_updates_security_install',1)) { + assert_and_click 'cockpit_updates_security_install'; + sleep 60; # wait until things are installed + assert_and_click 'cockpit_updates_restart_ignore'; + wait_still_screen 2; + } + + + # Install the rest of the updates, or any updates + # that have not been previously installed. + assert_and_click 'cockpit_updates_all_install'; + my $run = 0; + while ($run < 40) { + # When Cockpit packages are also included in the updates + # the user is forced to reconnect, i.e. to restart the Web Application + # and relog for further interaction. We will check if reconnection is + # needed and if so, we will restart Firefox and login again. + # + if (check_screen("cockpit_updates_reconnect", 1)) { + send_key "ctrl-q"; + sleep 5; + cockpit_update; + $run = 50; + + } + elsif (check_screen('cockpit_updates_restart_ignore', 1)) { + # ignore restart, because we have not finished yet + assert_and_click 'cockpit_updates_restart_ignore'; + $run = 50; + } + else { + sleep 10; + $run = $run + 1; + } + } + # Check that the system is updated + assert_screen 'cockpit_updates_updated'; + + # Switch off Cockpit + send_key "ctrl-q"; + + if ($result eq "0") { + verify_updated_packages; + } + +} + +sub test_flags { + return { always_rollback => 1 }; +} + +1; + +# vim: set sw=4 et: