diff --git a/lib/installedtest.pm b/lib/installedtest.pm index 1467e7db..cde06ac1 100644 --- a/lib/installedtest.pm +++ b/lib/installedtest.pm @@ -56,6 +56,29 @@ sub menu_launch_type { send_key 'ret'; } +sub start_cockpit { + my $self = shift; + my $login = shift || 0; + # run firefox directly in X as root. never do this, kids! + type_string "startx /usr/bin/firefox\n"; + assert_screen "firefox"; + # open a new tab so we don't race with the default page load + # (also focuses the location bar for us) + send_key "ctrl-t"; + type_string "http://localhost:9090"; + # firefox's stupid 'smart' url bar is a pain. wait for things to settle. + wait_still_screen 3; + send_key "ret"; + assert_screen "cockpit_login"; + if ($login) { + type_string "root"; + send_key "tab"; + type_string get_var("ROOT_PASSWORD", "weakpassword"); + send_key "ret"; + assert_screen "cockpit_main"; + } +} + 1; # vim: set sw=4 et: diff --git a/needles/cockpit/login.json b/needles/cockpit/login.json new file mode 100644 index 00000000..c119baf1 --- /dev/null +++ b/needles/cockpit/login.json @@ -0,0 +1,15 @@ +{ + "area": [ + { + "xpos": 631, + "ypos": 126, + "width": 227, + "height": 77, + "type": "match" + } + ], + "tags": [ + "cockpit_login" + ], + "properties": [] +} \ No newline at end of file diff --git a/needles/cockpit/login.png b/needles/cockpit/login.png new file mode 100644 index 00000000..39d4b1da Binary files /dev/null and b/needles/cockpit/login.png differ diff --git a/needles/cockpit/logs.json b/needles/cockpit/logs.json new file mode 100644 index 00000000..1784c010 --- /dev/null +++ b/needles/cockpit/logs.json @@ -0,0 +1,15 @@ +{ + "tags": [ + "cockpit_logs" + ], + "area": [ + { + "xpos": 19, + "ypos": 206, + "width": 30, + "height": 15, + "type": "match" + } + ], + "properties": [] +} \ No newline at end of file diff --git a/needles/cockpit/logs.png b/needles/cockpit/logs.png new file mode 100644 index 00000000..5287d085 Binary files /dev/null and b/needles/cockpit/logs.png differ diff --git a/needles/cockpit/logs_notices.json b/needles/cockpit/logs_notices.json new file mode 100644 index 00000000..bb14c7f4 --- /dev/null +++ b/needles/cockpit/logs_notices.json @@ -0,0 +1,15 @@ +{ + "properties": [], + "area": [ + { + "xpos": 448, + "ypos": 159, + "width": 47, + "height": 16, + "type": "match" + } + ], + "tags": [ + "cockpit_logs_notices" + ] +} \ No newline at end of file diff --git a/needles/cockpit/logs_notices.png b/needles/cockpit/logs_notices.png new file mode 100644 index 00000000..d59177b7 Binary files /dev/null and b/needles/cockpit/logs_notices.png differ diff --git a/needles/cockpit/logs_notices_detail.json b/needles/cockpit/logs_notices_detail.json new file mode 100644 index 00000000..308542db --- /dev/null +++ b/needles/cockpit/logs_notices_detail.json @@ -0,0 +1,15 @@ +{ + "properties": [], + "tags": [ + "cockpit_logs_notices_detail" + ], + "area": [ + { + "xpos": 226, + "ypos": 353, + "width": 114, + "height": 14, + "type": "match" + } + ] +} \ No newline at end of file diff --git a/needles/cockpit/logs_notices_detail.png b/needles/cockpit/logs_notices_detail.png new file mode 100644 index 00000000..10cd35b5 Binary files /dev/null and b/needles/cockpit/logs_notices_detail.png differ diff --git a/needles/cockpit/logs_notices_entry.json b/needles/cockpit/logs_notices_entry.json new file mode 100644 index 00000000..6bb3e0e7 --- /dev/null +++ b/needles/cockpit/logs_notices_entry.json @@ -0,0 +1,15 @@ +{ + "tags": [ + "cockpit_logs_notices_entry" + ], + "area": [ + { + "xpos": 665, + "ypos": 254, + "width": 125, + "height": 12, + "type": "match" + } + ], + "properties": [] +} \ No newline at end of file diff --git a/needles/cockpit/logs_notices_entry.png b/needles/cockpit/logs_notices_entry.png new file mode 100644 index 00000000..822f5922 Binary files /dev/null and b/needles/cockpit/logs_notices_entry.png differ diff --git a/needles/cockpit/main.json b/needles/cockpit/main.json new file mode 100644 index 00000000..e1b19146 --- /dev/null +++ b/needles/cockpit/main.json @@ -0,0 +1,15 @@ +{ + "tags": [ + "cockpit_main" + ], + "area": [ + { + "xpos": 198, + "ypos": 111, + "width": 78, + "height": 22, + "type": "match" + } + ], + "properties": [] +} \ No newline at end of file diff --git a/needles/cockpit/main.png b/needles/cockpit/main.png new file mode 100644 index 00000000..57d0cabb Binary files /dev/null and b/needles/cockpit/main.png differ diff --git a/needles/cockpit/services.json b/needles/cockpit/services.json new file mode 100644 index 00000000..d98762f6 --- /dev/null +++ b/needles/cockpit/services.json @@ -0,0 +1,15 @@ +{ + "properties": [], + "area": [ + { + "xpos": 19, + "ypos": 181, + "width": 50, + "height": 13, + "type": "match" + } + ], + "tags": [ + "cockpit_services" + ] +} \ No newline at end of file diff --git a/needles/cockpit/services.png b/needles/cockpit/services.png new file mode 100644 index 00000000..10cd35b5 Binary files /dev/null and b/needles/cockpit/services.png differ diff --git a/needles/cockpit/services_auditd.json b/needles/cockpit/services_auditd.json new file mode 100644 index 00000000..988182e1 --- /dev/null +++ b/needles/cockpit/services_auditd.json @@ -0,0 +1,15 @@ +{ + "area": [ + { + "xpos": 580, + "ypos": 482, + "width": 81, + "height": 14, + "type": "match" + } + ], + "tags": [ + "cockpit_services_auditd" + ], + "properties": [] +} \ No newline at end of file diff --git a/needles/cockpit/services_auditd.png b/needles/cockpit/services_auditd.png new file mode 100644 index 00000000..818bd407 Binary files /dev/null and b/needles/cockpit/services_auditd.png differ diff --git a/needles/cockpit/services_auditd_detail.json b/needles/cockpit/services_auditd_detail.json new file mode 100644 index 00000000..276ef418 --- /dev/null +++ b/needles/cockpit/services_auditd_detail.json @@ -0,0 +1,15 @@ +{ + "properties": [], + "tags": [ + "cockpit_services_auditd_detail" + ], + "area": [ + { + "xpos": 215, + "ypos": 325, + "width": 319, + "height": 13, + "type": "match" + } + ] +} \ No newline at end of file diff --git a/needles/cockpit/services_auditd_detail.png b/needles/cockpit/services_auditd_detail.png new file mode 100644 index 00000000..04c31dca Binary files /dev/null and b/needles/cockpit/services_auditd_detail.png differ diff --git a/needles/firefox/firefox.json b/needles/firefox/firefox.json new file mode 100644 index 00000000..16321104 --- /dev/null +++ b/needles/firefox/firefox.json @@ -0,0 +1,22 @@ +{ + "properties": [], + "area": [ + { + "xpos": 771, + "ypos": 41, + "width": 20, + "height": 20, + "type": "match" + }, + { + "xpos": 887, + "ypos": 40, + "width": 24, + "height": 20, + "type": "match" + } + ], + "tags": [ + "firefox" + ] +} \ No newline at end of file diff --git a/needles/firefox/firefox.png b/needles/firefox/firefox.png new file mode 100644 index 00000000..a72e1c7c Binary files /dev/null and b/needles/firefox/firefox.png differ diff --git a/templates b/templates index 97667a2c..c74b681a 100755 --- a/templates +++ b/templates @@ -325,6 +325,28 @@ }, test_suite => { name => "server_realmd_join_kickstart" }, }, + { + machine => { name => "64bit" }, + prio => 40, + product => { + arch => "x86_64", + distri => "fedora", + flavor => "Server-dvd-iso", + version => "*", + }, + test_suite => { name => "server_cockpit_default" }, + }, + { + machine => { name => "64bit" }, + prio => 40, + product => { + arch => "x86_64", + distri => "fedora", + flavor => "Server-dvd-iso", + version => "*", + }, + test_suite => { name => "server_cockpit_basic" }, + }, { machine => { name => "64bit" }, prio => 20, @@ -1657,6 +1679,29 @@ { key => "WORKER_CLASS", value => "tap" }, ], }, + { + name => "server_cockpit_default", + settings => [ + { key => "POSTINSTALL", value => "server_cockpit_default" }, + { key => "USER_LOGIN", value => "false" }, + { key => "ROOT_PASSWORD", value => "weakpassword" }, + { key => "START_AFTER_TEST", value => "install_default_upload" }, + { key => "BOOTFROM", value => "c" }, + { key => "HDD_1", value => "disk_%FLAVOR%_%MACHINE%.qcow2" }, + { key => "STORE_HDD_1", value => "disk_%MACHINE%_cockpit.qcow2" }, + ], + }, + { + name => "server_cockpit_basic", + settings => [ + { key => "POSTINSTALL", value => "server_cockpit_basic" }, + { key => "USER_LOGIN", value => "false" }, + { key => "ROOT_PASSWORD", value => "weakpassword" }, + { key => "START_AFTER_TEST", value => "server_cockpit_default" }, + { key => "BOOTFROM", value => "c" }, + { key => "HDD_1", value => "disk_%MACHINE%_cockpit.qcow2" }, + ], + }, { name => "desktop_terminal", settings => [ diff --git a/tests/server_cockpit_basic_postinstall.pm b/tests/server_cockpit_basic_postinstall.pm new file mode 100644 index 00000000..08619321 --- /dev/null +++ b/tests/server_cockpit_basic_postinstall.pm @@ -0,0 +1,38 @@ +use base "installedtest"; +use strict; +use testapi; + +sub run { + my $self=shift; + # run firefox and login to cockpit + $self->start_cockpit(1); + # go to the logs screen + assert_and_click "cockpit_logs"; + # the date dropdown changes and messes with the button locations, so wait + wait_still_screen 2; + assert_and_click "cockpit_logs_notices"; + wait_still_screen 2; + # assume there's an entry, click it + assert_and_click "cockpit_logs_notices_entry"; + # check we get to the appropriate detail screen + assert_screen "cockpit_logs_notices_detail"; + # go to the services screen + assert_and_click "cockpit_services"; + wait_still_screen 2; + # assume auditd is there, click it + assert_and_click "cockpit_services_auditd"; + # check we get to the appropriate detail screen + assert_screen "cockpit_services_auditd_detail"; +} + +sub test_flags { + # without anything - rollback to 'lastgood' snapshot if failed + # 'fatal' - whole test suite is in danger if this fails + # 'milestone' - after this test succeeds, update 'lastgood' + # 'important' - if this fails, set the overall state to 'fail' + return { fatal => 1 }; +} + +1; + +# vim: set sw=4 et: diff --git a/tests/server_cockpit_default_postinstall.pm b/tests/server_cockpit_default_postinstall.pm new file mode 100644 index 00000000..a96fde46 --- /dev/null +++ b/tests/server_cockpit_default_postinstall.pm @@ -0,0 +1,31 @@ +use base "installedtest"; +use strict; +use testapi; + +sub run { + my $self=shift; + # check cockpit appears to be enabled and running and firewall is setup + assert_script_run 'systemctl is-enabled cockpit.socket'; + assert_script_run 'systemctl is-active cockpit.socket'; + assert_script_run 'firewall-cmd --query-service cockpit'; + # we don't want updates-testing for validation purposes + assert_script_run 'dnf config-manager --set-disabled updates-testing'; + # install a desktop and firefox so we can actually try it + assert_script_run 'dnf -y groupinstall "base-x"', 300; + assert_script_run 'dnf -y install firefox', 120; + $self->start_cockpit(0); + # quit firefox (return to console) + send_key "ctrl-q"; +} + +sub test_flags { + # without anything - rollback to 'lastgood' snapshot if failed + # 'fatal' - whole test suite is in danger if this fails + # 'milestone' - after this test succeeds, update 'lastgood' + # 'important' - if this fails, set the overall state to 'fail' + return { fatal => 1 }; +} + +1; + +# vim: set sw=4 et: