1
0
mirror of https://pagure.io/fedora-qa/os-autoinst-distri-fedora.git synced 2024-11-21 13:33:08 +00:00

Add openQA tests for i3

This commit is contained in:
Dan Čermák 2020-10-18 00:22:09 +02:00 committed by Adam Williamson
parent 82abc61432
commit 4315e5ff6f
66 changed files with 1146 additions and 99 deletions

View File

@ -4,6 +4,7 @@ use strict;
use base 'distribution';
use Cwd;
use i3;
# Fedora distribution class
@ -63,7 +64,7 @@ sub init() {
# If this should change in the future, we would need to enhance this routine.
sub x11_start_program {
my ($self, $program, $timeout, $options) = @_;
send_key "alt-f2";
send_key (get_var("DESKTOP") eq "i3" ? get_i3_modifier() . "-d" : "alt-f2");
assert_screen "desktop_runner";
type_string $program, 20;
sleep 5; # because of KDE dialog - SUSE guys are doing the same!
@ -182,5 +183,19 @@ sub assert_script_sudo {
return;
}
sub become_root {
my ($self) = @_;
my $rootpwd = get_var("ROOT_PASSWORD", "weakpassword");
if (check_screen("apps_run_terminal") || is_serial_terminal()) {
type_string("su -\n");
sleep(2);
type_string("$rootpwd\n");
} else {
die "No terminal to become root is present";
}
}
1;
# vim: set sw=4 et:

55
lib/i3.pm Normal file
View File

@ -0,0 +1,55 @@
package i3;
use strict;
use base 'Exporter';
use Exporter;
use testapi;
use utils;
our @EXPORT = qw/firstlaunch_setup get_i3_modifier create_user_i3_config launch_terminal/;
sub get_i3_modifier {
return get_var("I3_MODIFIER", 'alt');
}
sub firstlaunch_setup {
my %args = @_;
my $timeout = $args{timeout} || 30;
my $modifier = $args{modifier} || get_i3_modifier();
die "invalid modifier $modifier, only alt and super are possible" unless (($modifier eq 'alt') || ($modifier eq 'super'));
assert_screen('i3_firstlaunch_wizard', $timeout);
if ($modifier eq 'alt') {
send_key('esc', wait_screen_change => 1);
} else {
send_key('ret', wait_screen_change => 1);
send_key_until_needlematch('down', 'i3_generate_config');
send_key('ret', wait_screen_change => 1);
}
}
sub create_user_i3_config {
my %args = @_;
my $login = $args{login};
my $remove_config_wizard = $args{remove_config_wizard} || 1;
assert_script_run("mkdir -p /home/$login/.config/i3/");
# ensure that no alias of cp prevents an existing config from being overwritten
assert_script_run("/usr/bin/cp -f /etc/i3/config /home/$login/.config/i3/config");
if ($remove_config_wizard) {
assert_script_run("sed -i '/i3-config-wizard/d' /home/$login/.config/i3/config");
}
assert_script_run "chown -R $login.$login /home/$login/.config";
assert_script_run "restorecon -vr /home/$login/.config";
}
sub launch_terminal {
send_key(get_i3_modifier() . '-ret');
assert_screen("apps_run_terminal");
}

View File

@ -4,6 +4,7 @@ use strict;
use base 'Exporter';
use Exporter;
use i3;
use lockapi;
use testapi qw(is_serial_terminal :DEFAULT);
@ -1082,6 +1083,7 @@ sub check_desktop {
# close it if it's open.
my %args = (
timeout => 30,
no_firstlaunch_check => 0,
@_
);
my $count = 5;
@ -1108,11 +1110,35 @@ sub check_desktop {
last;
}
}
if (get_var("DESKTOP") eq 'i3') {
my $version = get_var('VERSION');
# i3 launches pretty quickly, but sometimes we have to wait for the
# whole VM to launch
assert_screen("i3-bar", $args{timeout});
if ($version ne "Rawhide") {
assert_screen("${version}_background");
}
unless ($args{no_firstlaunch_check}) {
die "firstlaunch setup is present" if defined(check_screen('i3_firstlaunch_wizard'));
}
} else {
assert_screen "apps_menu_button", $args{timeout};
# GNOME 40 starts on the overview by default; for consistency with
# older GNOME and KDE, let's just close it
if (match_has_tag "apps_menu_button_active") {
wait_still_screen 3;
send_key "alt-f1";
assert_screen "apps_menu_button_inactive";
}
}
if ($activematched) {
# make sure we got to inactive after active
die "never reached apps_menu_button_inactive!" unless (match_has_tag "apps_menu_button_inactive");
}
}
sub quit_firefox {
# Quit Firefox, handling the 'close multiple tabs' warning screen if
@ -1376,9 +1402,13 @@ sub menu_launch_type {
diag("Moving the mouse away from the launcher.");
mouse_set(1, 1);
}
if (get_var("DESKTOP") eq "i3") {
send_key(get_var("I3_MODIFIER", 'alt') . "-d");
} else {
wait_screen_change { send_key 'super'; };
# srsly KDE y u so slo
wait_still_screen 3;
}
type_very_safely $app;
# Wait for KDE to place focus correctly.
wait_still_screen 2;

View File

@ -0,0 +1,15 @@
{
"area": [
{
"width": 30,
"height": 18,
"ypos": 508,
"xpos": 475,
"type": "match"
}
],
"properties": [],
"tags": [
"firefox_addon_add"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 KiB

View File

@ -0,0 +1,22 @@
{
"area": [
{
"xpos": 520,
"type": "match",
"width": 62,
"height": 17,
"ypos": 508
},
{
"width": 20,
"ypos": 73,
"height": 19,
"type": "match",
"xpos": 951
}
],
"properties": [],
"tags": [
"firefox_addon_success"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 KiB

29
needles/i3-bar.json Normal file
View File

@ -0,0 +1,29 @@
{
"area": [
{
"xpos": 0,
"type": "match",
"width": 16,
"ypos": 751,
"height": 17
},
{
"height": 14,
"width": 15,
"ypos": 752,
"type": "match",
"xpos": 434
},
{
"type": "match",
"xpos": 486,
"height": 14,
"width": 18,
"ypos": 751
}
],
"properties": [],
"tags": [
"i3-bar"
]
}

BIN
needles/i3-bar.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 914 KiB

22
needles/i3-dmenu.json Normal file
View File

@ -0,0 +1,22 @@
{
"area": [
{
"xpos": 0,
"ypos": 0,
"width": 44,
"height": 17,
"type": "match"
},
{
"xpos": 999,
"ypos": 0,
"width": 25,
"height": 18,
"type": "match"
}
],
"properties": [],
"tags": [
"desktop_runner"
]
}

BIN
needles/i3-dmenu.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

View File

@ -0,0 +1,25 @@
{
"area": [
{
"ypos": 369,
"width": 130,
"height": 41,
"type": "match",
"xpos": 460
},
{
"type": "match",
"height": 24,
"xpos": 599,
"width": 53,
"ypos": 424
}
],
"properties": [],
"tags": [
"login_screen",
"graphical_login_input",
"graphical_login",
"lightdm_login_screen"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -0,0 +1,25 @@
{
"area": [
{
"xpos": 460,
"ypos": 369,
"width": 130,
"height": 41,
"type": "match"
},
{
"xpos": 599,
"ypos": 424,
"width": 53,
"height": 24,
"type": "match"
}
],
"properties": [],
"tags": [
"login_screen",
"graphical_login_input",
"graphical_login",
"lightdm_login_screen"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

View File

@ -0,0 +1,26 @@
{
"area": [
{
"xpos": 4,
"ypos": 5,
"width": 180,
"height": 17,
"type": "match"
},
{
"xpos": 891,
"ypos": 7,
"width": 73,
"height": 15,
"type": "match",
"click_point": {
"xpos": 36.5,
"ypos": 7.5
}
}
],
"properties": [],
"tags": [
"i3-logout-bar"
]
}

BIN
needles/i3-logout-bar.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

View File

@ -0,0 +1,19 @@
{
"area": [
{
"xpos": 227,
"ypos": 200,
"width": 113,
"height": 21,
"type": "match",
"click_point": {
"xpos": 56.5,
"ypos": 10.5
}
}
],
"properties": [],
"tags": [
"printing_pdfprinter_ready"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

View File

@ -0,0 +1,19 @@
{
"area": [
{
"xpos": 763,
"ypos": 601,
"width": 56,
"height": 21,
"type": "match",
"click_point": {
"xpos": 28,
"ypos": 10.5
}
}
],
"properties": [],
"tags": [
"printing_print"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"height": 18,
"type": "match",
"xpos": 116,
"ypos": 18,
"width": 328
}
],
"properties": [],
"tags": [
"printing_check_sentence"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@ -0,0 +1,36 @@
{
"area": [
{
"xpos": 3,
"ypos": 3,
"width": 95,
"height": 11,
"type": "match"
},
{
"xpos": 17,
"ypos": 22,
"width": 68,
"height": 25,
"type": "match"
},
{
"xpos": 111,
"ypos": 26,
"width": 71,
"height": 20,
"type": "match"
},
{
"xpos": 209,
"ypos": 25,
"width": 106,
"height": 21,
"type": "match"
}
],
"properties": [],
"tags": [
"audio_mixer"
]
}

BIN
needles/i3-pavucontrol.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

23
needles/i3-urxvt-run.json Normal file
View File

@ -0,0 +1,23 @@
{
"area": [
{
"height": 14,
"type": "match",
"ypos": 2,
"width": 38,
"xpos": 2
},
{
"type": "match",
"ypos": 33,
"xpos": 163,
"width": 37,
"height": 13
}
],
"properties": [],
"tags": [
"apps_run_terminal",
"i3_dunst_no_notification"
]
}

BIN
needles/i3-urxvt-run.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"height": 19,
"ypos": 29,
"width": 285,
"type": "match",
"xpos": 702
}
],
"properties": [],
"tags": [
"i3_dunst_foo_notification"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

@ -0,0 +1,29 @@
{
"area": [
{
"xpos": 493,
"ypos": 281,
"width": 137,
"height": 13,
"type": "match"
},
{
"xpos": 514,
"ypos": 364,
"width": 201,
"height": 16,
"type": "match"
},
{
"xpos": 519,
"ypos": 391,
"width": 214,
"height": 14,
"type": "match"
}
],
"properties": [],
"tags": [
"i3_firstlaunch_wizard"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@ -0,0 +1,29 @@
{
"area": [
{
"width": 679,
"height": 16,
"ypos": 0,
"type": "match",
"xpos": 0
},
{
"ypos": 535,
"height": 128,
"width": 373,
"type": "match",
"xpos": 328
},
{
"xpos": 728,
"ypos": 7,
"width": 132,
"height": 23,
"type": "match"
}
],
"properties": [],
"tags": [
"i3_windows_split"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 0,
"ypos": 0,
"width": 133,
"height": 52,
"type": "match"
}
],
"properties": [],
"tags": [
"i3_windows_stacked"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 0,
"ypos": 0,
"width": 824,
"height": 18,
"type": "match"
}
],
"properties": [],
"tags": [
"i3_windows_tabbed"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -0,0 +1,19 @@
{
"area": [
{
"xpos": 467,
"type": "match",
"ypos": 258,
"width": 89,
"height": 26,
"click_point": {
"xpos": 44.5,
"ypos": 13
}
}
],
"properties": [],
"tags": [
"login_jack"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 827 KiB

View File

@ -0,0 +1,19 @@
{
"area": [
{
"xpos": 467,
"ypos": 347,
"width": 66,
"height": 23,
"type": "match",
"click_point": {
"xpos": 33,
"ypos": 11.5
}
}
],
"properties": [],
"tags": [
"login_jim"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 828 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 360,
"ypos": 407,
"width": 293,
"height": 22,
"type": "match"
}
],
"properties": [],
"tags": [
"login_wrong_password"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View File

@ -0,0 +1,33 @@
{
"area": [
{
"xpos": 278,
"ypos": 314,
"width": 53,
"height": 53,
"type": "match"
},
{
"xpos": 345,
"ypos": 316,
"width": 53,
"height": 18,
"type": "match"
},
{
"xpos": 682,
"ypos": 426,
"width": 54,
"height": 22,
"type": "match",
"click_point": {
"xpos": 27,
"ypos": 11
}
}
],
"properties": [],
"tags": [
"lightdm_power_menu-reboot-confirm"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 804 KiB

View File

@ -0,0 +1,40 @@
{
"area": [
{
"xpos": 366,
"ypos": 324,
"width": 76,
"height": 85,
"type": "match"
},
{
"xpos": 599,
"ypos": 425,
"width": 54,
"height": 21,
"type": "match"
},
{
"xpos": 855,
"ypos": 77,
"width": 82,
"height": 21,
"type": "match",
"click_point": {
"xpos": 41,
"ypos": 10.5
}
},
{
"xpos": 965,
"ypos": 0,
"width": 59,
"height": 25,
"type": "match"
}
],
"properties": [],
"tags": [
"lightdm_power_menu-reboot"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 834 KiB

View File

@ -0,0 +1,33 @@
{
"area": [
{
"xpos": 333,
"ypos": 311,
"width": 76,
"height": 27,
"type": "match"
},
{
"xpos": 263,
"ypos": 309,
"width": 63,
"height": 64,
"type": "match"
},
{
"xpos": 675,
"ypos": 429,
"width": 70,
"height": 17,
"type": "match",
"click_point": {
"xpos": 35,
"ypos": 8.5
}
}
],
"properties": [],
"tags": [
"lightdm_power_menu-shutdown-confirm"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View File

@ -0,0 +1,33 @@
{
"area": [
{
"xpos": 966,
"ypos": 3,
"width": 54,
"height": 19,
"type": "match",
"click_point": {
"xpos": 42,
"ypos": 9.5
}
},
{
"xpos": 358,
"ypos": 323,
"width": 89,
"height": 91,
"type": "match"
},
{
"xpos": 597,
"ypos": 423,
"width": 56,
"height": 25,
"type": "match"
}
],
"properties": [],
"tags": [
"lightdm_power_menu"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 841 KiB

View File

@ -0,0 +1,33 @@
{
"area": [
{
"xpos": 600,
"ypos": 442,
"width": 51,
"height": 21,
"type": "match"
},
{
"xpos": 624,
"ypos": 303,
"width": 43,
"height": 47,
"type": "match",
"click_point": {
"xpos": 21.5,
"ypos": 23.5
}
},
{
"xpos": 364,
"ypos": 306,
"width": 81,
"height": 90,
"type": "match"
}
],
"properties": [],
"tags": [
"lightdm_user_selection"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 826 KiB

View File

@ -0,0 +1,22 @@
{
"area": [
{
"xpos": 422,
"ypos": 27,
"width": 182,
"height": 19,
"type": "match"
},
{
"xpos": 684,
"ypos": 2,
"width": 129,
"height": 12,
"type": "match"
}
],
"properties": [],
"tags": [
"mousepad_no_document_open"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"ypos": 223,
"width": 99,
"type": "match",
"xpos": 231,
"height": 19
}
],
"properties": [],
"tags": [
"printing_select_pdfprinter"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

View File

@ -213,6 +213,20 @@
},
"version": "*"
},
"fedora-i3-live-x86_64*": {
"arch": "x86_64",
"distri": "fedora",
"flavor": "i3-live-iso",
"settings": {
"DESKTOP": "i3",
"DEPLOY_UPLOAD_TEST": "install_default_upload",
"LIVE": "1",
"PACKAGE_SET": "default",
"TEST_TARGET": "ISO",
"USER_LOGIN": "i3-user"
},
"version": "*"
},
"fedora-Minimal-raw_xz-raw.xz-aarch64-*": {
"arch": "aarch64",
"distri": "fedora",
@ -513,6 +527,14 @@
"machine": "bios",
"product": "fedora-KDE-live-iso-x86_64-*"
},
"fedora-i3-live-x86_64-*-uefi": {
"machine": "uefi",
"product": "fedora-i3-live-x86_64*"
},
"fedora-i3-live-x86_64-*-64bit": {
"machine": "64bit",
"product": "fedora-i3-live-x86_64*"
},
"fedora-Minimal-raw_xz-raw.xz-aarch64-*-aarch64": {
"machine": "aarch64",
"product": "fedora-Minimal-raw_xz-raw.xz-aarch64-*"
@ -631,7 +653,9 @@
"fedora-Workstation-live-iso-ppc64le-*-ppc64le": 40,
"fedora-Workstation-upgrade-x86_64-*-64bit": 40,
"fedora-Workstation-live-iso-x86_64-*-64bit": 40,
"fedora-Workstation-live_osbuild-iso-x86_64-*-64bit": 70
"fedora-Workstation-live_osbuild-iso-x86_64-*-64bit": 70,
"fedora-Workstation-live-iso-x86_64-*-64bit": 40,
"fedora-i3-live-x86_64-*-64bit": 40
},
"settings": {
"BOOTFROM": "c",
@ -663,7 +687,8 @@
"fedora-Workstation-live_osbuild-iso-x86_64-*-64bit": 70,
"fedora-Workstation-upgrade-x86_64-*-64bit": 40,
"fedora-Workstation-raw_xz-raw.xz-aarch64-*-aarch64": 22,
"fedora-Workstation-upgrade-aarch64-*-aarch64": 40
"fedora-Workstation-upgrade-aarch64-*-aarch64": 40,
"fedora-i3-live-x86_64-*-64bit": 20
},
"settings": {
"BOOTFROM": "c",
@ -696,7 +721,8 @@
"fedora-Workstation-live_osbuild-iso-x86_64-*-64bit": 70,
"fedora-Workstation-upgrade-x86_64-*-64bit": 40,
"fedora-Workstation-upgrade-aarch64-*-aarch64": 40,
"fedora-Workstation-raw_xz-raw.xz-aarch64-*-aarch64": 22
"fedora-Workstation-raw_xz-raw.xz-aarch64-*-aarch64": 22,
"fedora-i3-live-x86_64-*-64bit": 20
},
"settings": {
"BOOTFROM": "c",
@ -724,7 +750,8 @@
"fedora-Workstation-live_osbuild-iso-x86_64-*-64bit": 70,
"fedora-Workstation-upgrade-x86_64-*-64bit": 40,
"fedora-Workstation-upgrade-aarch64-*-aarch64": 40,
"fedora-Workstation-raw_xz-raw.xz-aarch64-*-aarch64": 22
"fedora-Workstation-raw_xz-raw.xz-aarch64-*-aarch64": 22,
"fedora-i3-live-x86_64-*-64bit": 20
},
"settings": {
"BOOTFROM": "c",
@ -752,7 +779,8 @@
"fedora-Workstation-live_osbuild-iso-x86_64-*-64bit": 70,
"fedora-Workstation-upgrade-x86_64-*-64bit": 40,
"fedora-Workstation-upgrade-aarch64-*-aarch64": 40,
"fedora-Workstation-raw_xz-raw.xz-aarch64-*-aarch64": 42
"fedora-Workstation-raw_xz-raw.xz-aarch64-*-aarch64": 42,
"fedora-i3-live-x86_64-*-64bit": 40
},
"settings": {
"BOOTFROM": "c",
@ -786,7 +814,8 @@
"fedora-Workstation-live_osbuild-iso-x86_64-*-64bit": 70,
"fedora-Workstation-upgrade-x86_64-*-64bit": 40,
"fedora-Workstation-upgrade-aarch64-*-aarch64": 40,
"fedora-Workstation-raw_xz-raw.xz-aarch64-*-aarch64": 42
"fedora-Workstation-raw_xz-raw.xz-aarch65-*-aarch64": 42,
"fedora-i3-live-x86_64-*-64bit": 40
},
"settings": {
"BOOTFROM": "c",
@ -819,7 +848,8 @@
"fedora-Workstation-live_osbuild-iso-x86_64-*-64bit": 70,
"fedora-Workstation-upgrade-x86_64-*-64bit": 40,
"fedora-Workstation-upgrade-aarch64-*-aarch64": 40,
"fedora-Workstation-raw_xz-raw.xz-aarch64-*-aarch64": 42
"fedora-Workstation-raw_xz-raw.xz-aarch64-*-aarch64": 42,
"fedora-i3-live-x86_64-*-64bit": 40
},
"settings": {
"BOOTFROM": "c",
@ -852,7 +882,8 @@
"fedora-Workstation-live_osbuild-iso-x86_64-*-64bit": 70,
"fedora-Workstation-upgrade-x86_64-*-64bit": 40,
"fedora-Workstation-upgrade-aarch64-*-aarch64": 40,
"fedora-Workstation-raw_xz-raw.xz-aarch64-*-aarch64": 42
"fedora-Workstation-raw_xz-raw.xz-aarch64-*-aarch64": 42,
"fedora-i3-live-x86_64-*-64bit": 40
},
"settings": {
"BOOTFROM": "c",
@ -912,7 +943,8 @@
"fedora-Workstation-live_osbuild-iso-x86_64-*-64bit": 70,
"fedora-Workstation-upgrade-x86_64-*-64bit": 40,
"fedora-Workstation-upgrade-aarch64-*-aarch64": 40,
"fedora-Workstation-raw_xz-raw.xz-aarch64-*-aarch64": 22
"fedora-Workstation-raw_xz-raw.xz-aarch64-*-aarch64": 22,
"fedora-i3-live-x86_64-*-64bit": 50
},
"settings": {
"BOOTFROM": "c",
@ -927,7 +959,8 @@
"fedora-Workstation-live-iso-x86_64-*-64bit": 30,
"fedora-Workstation-live_osbuild-iso-x86_64-*-64bit": 70,
"fedora-Workstation-upgrade-x86_64-*-64bit": 40,
"fedora-Workstation-live-iso-ppc64le-*-ppc64le": 30
"fedora-Workstation-live-iso-ppc64le-*-ppc64le": 30,
"fedora-i3-live-x86_64-*-64bit": 30
},
"settings": {
"BOOTFROM": "c",
@ -960,7 +993,8 @@
"fedora-Workstation-live_osbuild-iso-x86_64-*-64bit": 70,
"fedora-Workstation-upgrade-x86_64-*-64bit": 40,
"fedora-Workstation-upgrade-aarch64-*-aarch64": 40,
"fedora-Workstation-raw_xz-raw.xz-aarch64-*-aarch64": 22
"fedora-Workstation-raw_xz-raw.xz-aarch64-*-aarch64": 22,
"fedora-i3-live-x86_64-*-64bit": 20
},
"settings": {
"BOOTFROM": "c",
@ -974,7 +1008,8 @@
"fedora-KDE-live-iso-x86_64-*-64bit": 32,
"fedora-Workstation-live-iso-ppc64le-*-ppc64le": 30,
"fedora-Workstation-live-iso-x86_64-*-64bit": 30,
"fedora-Workstation-live_osbuild-iso-x86_64-*-64bit": 70
"fedora-Workstation-live_osbuild-iso-x86_64-*-64bit": 70,
"fedora-i3-live-x86_64-*-64bit": 30
},
"settings": {
"ENTRYPOINT": "desktop_notifications"
@ -986,7 +1021,9 @@
"fedora-Workstation-live-iso-ppc64le-*-ppc64le": 30,
"fedora-Workstation-upgrade-x86_64-*-64bit": 40,
"fedora-Workstation-live-iso-x86_64-*-64bit": 30,
"fedora-Workstation-live_osbuild-iso-x86_64-*-64bit": 70
"fedora-Workstation-live_osbuild-iso-x86_64-*-64bit": 70,
"fedora-Workstation-live-iso-x86_64-*-64bit": 30,
"fedora-i3-live-x86_64-*-64bit": 30
},
"settings": {
"BOOTFROM": "c",
@ -1021,7 +1058,8 @@
"fedora-Workstation-live_osbuild-iso-x86_64-*-64bit": 70,
"fedora-Workstation-upgrade-x86_64-*-64bit": 40,
"fedora-Workstation-upgrade-aarch64-*-aarch64": 40,
"fedora-Workstation-raw_xz-raw.xz-aarch64-*-aarch64": 22
"fedora-Workstation-raw_xz-raw.xz-aarch64-*-aarch64": 22,
"fedora-i3-live-x86_64-*-64bit": 20
},
"settings": {
"BOOTFROM": "c",
@ -1040,7 +1078,8 @@
"fedora-Workstation-live_osbuild-iso-x86_64-*-64bit": 70,
"fedora-Workstation-upgrade-x86_64-*-64bit": 40,
"fedora-Workstation-upgrade-aarch64-*-aarch64": 40,
"fedora-Workstation-raw_xz-raw.xz-aarch64-*-aarch64": 22
"fedora-Workstation-raw_xz-raw.xz-aarch64-*-aarch64": 22,
"fedora-i3-live-x86_64-*-64bit": 30
},
"settings": {
"BOOTFROM": "c",
@ -1381,7 +1420,8 @@
"fedora-Workstation-live_osbuild-iso-x86_64-*-64bit": 70,
"fedora-Workstation-upgrade-x86_64-*-64bit": 40,
"fedora-Workstation-upgrade-aarch64-*-aarch64": 40,
"fedora-Workstation-raw_xz-raw.xz-aarch64-*-aarch64": 32
"fedora-Workstation-raw_xz-raw.xz-aarch64-*-aarch64": 32,
"fedora-Workstation-live-iso-x86_64-*-64bit": 30
},
"settings": {
"BOOTFROM": "c",
@ -1390,6 +1430,17 @@
"START_AFTER_TEST": "%DEPLOY_UPLOAD_TEST%"
}
},
"i3_tilling": {
"profiles": {
"fedora-i3-live-x86_64-*-64bit": 30
},
"settings": {
"BOOTFROM": "c",
"HDD_1": "disk_%FLAVOR%_%MACHINE%.qcow2",
"POSTINSTALL": "i3_tilling",
"START_AFTER_TEST": "%DEPLOY_UPLOAD_TEST%"
}
},
"install_anaconda_text": {
"profiles": {
"fedora-Server-dvd-iso-aarch64-*-aarch64": 20,
@ -1648,7 +1699,13 @@
"fedora-Server-boot-iso-x86_64-*-64bit": 11,
"fedora-Server-dvd-iso-x86_64-*-bios": 11,
"fedora-Silverblue-dvd_ostree-iso-x86_64-*-bios": 51,
"fedora-Workstation-live-iso-x86_64-*-bios": 11
"fedora-Workstation-live-iso-x86_64-*-bios": 11,
"fedora-Server-boot-iso-x86_64-*-64bit": 10,
"fedora-Server-boot-iso-x86_64-*-uefi": 11,
"fedora-Server-dvd-iso-x86_64-*-uefi": 11,
"fedora-Silverblue-dvd_ostree-iso-x86_64-*-uefi": 51,
"fedora-Workstation-live-iso-x86_64-*-uefi": 11,
"fedora-i3-live-x86_64-*-64bit": 10
},
"settings": {
"PACKAGE_SET": "default",
@ -1669,7 +1726,8 @@
"fedora-Silverblue-dvd_ostree-iso-x86_64-*-64bit": 50,
"fedora-Workstation-live-iso-ppc64le-*-ppc64le": 10,
"fedora-Workstation-live-iso-x86_64-*-64bit": 10,
"fedora-Workstation-live_osbuild-iso-x86_64-*-64bit": 60
"fedora-Workstation-live_osbuild-iso-x86_64-*-64bit": 60,
"fedora-i3-live-x86_64-*-64bit": 20
},
"settings": {
"PACKAGE_SET": "default",
@ -2512,7 +2570,8 @@
"fedora-Workstation-live_osbuild-iso-x86_64-*-64bit": 60,
"fedora-Workstation-upgrade-x86_64-*-64bit": 40,
"fedora-Workstation-upgrade-aarch64-*-aarch64": 40,
"fedora-Workstation-raw_xz-raw.xz-aarch64-*-aarch64": 42
"fedora-Workstation-raw_xz-raw.xz-aarch64-*-aarch64": 42,
"fedora-i3-live-x86_64-*-64bit": 50
},
"settings": {
"BOOTFROM": "c",

View File

@ -5,6 +5,7 @@ use testapi;
use utils;
use tapnet;
use anaconda;
use i3;
sub _handle_incomplete_hub {
if (match_has_tag "anaconda_main_hub_keyboard_layout_incomplete") {
@ -147,14 +148,16 @@ sub run {
# on lives, we have to explicitly launch anaconda
my $launched = 0;
my $count = 5;
# i3 got no real desktop, so we need to launch liveinst via the launcher
if (get_var('DESKTOP') eq 'i3') {
firstlaunch_setup(timeout => 300);
x11_start_program("liveinst");
} else {
while ($count > 0) {
$count -= 1;
assert_screen ["live_start_anaconda_icon", "apps_menu_button_active", "next_button"], 300;
if (match_has_tag "next_button") {
# we're looking at gnome-initial-setup - this
# is what we expect on images that use anaconda
# webui, though as of 2024-08 it's disabled due
# to maintenance difficulty
# we're on F39+ Workstation and looking at gnome-initial-setup
# completing g-i-s launches the installer
gnome_initial_setup(live => 1);
$launched = 1;
@ -171,6 +174,7 @@ sub run {
last;
}
}
}
# if we hit the g-i-s flow we already launched
unless ($launched) {
# for KDE we need to double-click

View File

@ -2,6 +2,7 @@ use base "installedtest";
use strict;
use testapi;
use utils;
use i3;
sub _enter_password {
my $password = shift;
@ -102,6 +103,10 @@ sub run {
desktop_vt;
}
if (get_var("DESKTOP") eq 'i3') {
firstlaunch_setup();
}
# Move the mouse somewhere it won't highlight the match areas and
# hopefully won't negatively interact with anything else later
mouse_set(1023, 384);

View File

@ -2,9 +2,21 @@ use base "installedtest";
use strict;
use testapi;
use utils;
use i3;
sub run {
if (!get_var("BOOTFROM")) {
# If we are checking the desktop background on live, we will not get
# _graphical_wait_login scheduled and need to boot ourselves.
# On i3, we'll also get the firstlaunch wizard on auto-login and need to
# ignore it for check_desktop. We then run the firstlaunch setup so that
# the wizard window does not block the desktop background.
do_bootloader(postinstall=>0);
check_desktop(timeout => 120, no_firstlaunch_check => 1);
firstlaunch_setup() if (get_var("DESKTOP") eq "i3");
} else {
check_desktop;
}
# If we want to check that there is a correct background used, as a part
# of self identification test, we will do it here. For now we don't do
# this for Rawhide as Rawhide doesn't have its own backgrounds and we

View File

@ -32,10 +32,15 @@ sub run {
$self->root_console(tty => 3);
disable_firefox_studies;
desktop_vt;
if (get_var("DESKTOP") eq "i3") {
x11_start_program("firefox");
}
else {
send_key 'super';
# wait out animations
wait_still_screen(stilltime=>4, similarity_level=>45);
assert_and_click 'browser_launcher';
}
unless (check_screen 'browser', 45) {
if (check_screen 'browser', 45) {
record_soft_failure "Browser start up is very slow - probably https://bugzilla.redhat.com/show_bug.cgi?id=2312900";

View File

@ -2,12 +2,15 @@ use base "installedtest";
use strict;
use testapi;
use utils;
use i3;
our $desktop = get_var("DESKTOP");
our $syspwd = get_var("USER_PASSWORD") || "weakpassword";
our $term = "terminal";
if ($desktop eq "kde") {
$term = "konsole";
} elsif ($desktop eq "i3") {
$term = "i3-sensible-terminal";
}
sub type_password {
@ -21,12 +24,12 @@ sub type_password {
sub adduser {
# Add user to the system.
my %args = @_;
$args{termstop} //= 1;
my $name = $args{name};
my $login = $args{login};
my $password = $args{password};
assert_script_run "useradd -c '$name' $login";
assert_script_run "usermod -a -G dialout $login";
if ($password ne "askuser") {
# If we want to create a user with a defined password.
assert_script_run "echo '$login:$password' | chpasswd";
@ -39,16 +42,34 @@ sub adduser {
assert_script_run "chage --lastday 0 $login";
}
assert_script_run "grep $login /etc/passwd";
# Disable Gnome initial setup on accounts when testing
# inside Gnome.
if ($desktop eq "gnome") {
assert_script_run "mkdir /home/$login/.config";
# gnome-initial-setup-done is obsolete from F34 onwards, can be removed after F33 EOL
assert_script_run "echo 'yes' >> /home/$login/.config/gnome-initial-setup-done";
}
elsif ($desktop eq "i3") {
create_user_i3_config(login => $login);
}
if ($desktop eq "gnome") {
assert_script_run "chown -R $login.$login /home/$login/.config";
assert_script_run "restorecon -vr /home/$login/.config";
}
}
sub lock_screen {
if ($desktop eq "i3") {
x11_start_program("i3lock");
} else {
# Click on buttons to lock the screen.
#my $desktop = get_var("DESKTOP");
assert_and_click "system_menu_button";
if ($desktop eq "kde") {
assert_and_click "leave_button";
}
assert_and_click "lock_button";
}
wait_still_screen 10;
}
@ -61,14 +82,20 @@ sub login_user {
my $user = $args{user};
my $password = $args{password};
my $method = $args{method};
if ($method ne "unlock" && !check_screen "login_$user") {
if (!check_screen "login_$user" || ($desktop eq 'i3')) {
# Sometimes, especially in SDDM, we do not get the user list
# but rather a "screensaver" screen for the DM. If this is the
# case, hit Escape to bring back the user list.
# We do want to skip this with lightdm though, as we would then deselect
# the password entry field
send_key "esc";
wait_still_screen(stilltime => 5, similarity_level => 45);
}
if ($method ne "unlock") {
# on lightdm we have to open the drop down menu to get to the user selection
if (check_screen('lightdm_login_screen')) {
assert_and_click('lightdm_user_selection');
}
# When we do not just want to unlock the screen, we need to select a user.
if (check_screen "login_$user", 30) {
click_lastmatch;
@ -84,12 +111,20 @@ sub login_user {
# of password typing.
type_very_safely "$password\n";
}
type_very_safely "$password\n";
check_desktop(timeout => 60) if ($args{checklogin});
wait_still_screen(stilltime => 5, similarity_level => 45);
if ($desktop eq "kde") {
click_lastmatch if (check_screen "getting_started");
}
if (get_var('DESKTOP') ne 'i3') {
type_very_safely "$password\n";
}
else {
# use essentially type_very_safely, but without wait_screen_change being
# set, because the i3lock screen does not change enough when typing a
# character and that just causes huge delays to unlock the screen
type_string("$password\n", max_interval => 1);
}
check_desktop(timeout => 60) if ($args{checklogin});
wait_still_screen(stilltime => 5, similarity_level => 45);
}
sub check_user_logged_in {
@ -104,6 +139,13 @@ sub check_user_logged_in {
menu_launch_type $term;
wait_still_screen 2;
$exitkey = "alt-f4";
} elsif ($desktop eq "i3") {
my $mod = get_i3_modifier();
send_key("$mod-ret");
assert_screen("apps_run_terminal");
assert_script_run('[ $(whoami) = "' . "$user\" ]");
wait_screen_change { send_key("$mod-shift-q"); };
return;
}
# With KDE, the user is shown in the main menu, so let us just
# open this and see.
@ -117,6 +159,12 @@ sub check_user_logged_in {
}
sub logout_user {
if ($desktop eq "i3") {
my $mod = get_i3_modifier();
send_key("$mod-shift-e");
assert_and_click("i3-logout-bar");
assert_screen("graphical_login_input");
} else {
# Do steps to log out the user to reach the login screen.
assert_and_click "system_menu_button";
assert_and_click "leave_button";
@ -125,6 +173,7 @@ sub logout_user {
wait_still_screen 5;
sleep 10;
}
}
sub switch_user {
# Switch the user, i.e. leave the current user logged in and
@ -146,28 +195,62 @@ sub switch_user {
}
}
sub reboot_system_i3 {
# we are still in i3 if the bar is visible
if (check_screen('i3-bar')) {
logout_user();
}
assert_and_click('lightdm_power_menu');
assert_and_click('lightdm_power_menu-reboot');
assert_and_click('lightdm_power_menu-reboot-confirm');
boot_to_login_screen();
}
sub reboot_system {
# Reboots the system and handles everything until the next login screen.
if ($desktop eq 'i3') {
reboot_system_i3();
return;
}
# Reboots the system and handles everything until the next GDM screen.
if (check_screen "system_menu_button") {
# In a logged in desktop, we access power options through system menu
assert_and_click "system_menu_button";
# In KDE the reboot entry is right here, on GNOME we need to
# enter some kind of power option submenu.
# In KDE since F34, reboot entry is right here, otherwise we need to
# enter some kind of power option submenu
assert_screen ["power_entry", "reboot_entry"];
click_lastmatch;
assert_and_click "reboot_entry" if (match_has_tag("power_entry"));
assert_and_click "restart_confirm";
}
# When we are outside KDE (not logged in), the only way to reboot is to click
# the reboot icon.
else {
assert_and_click "reboot_icon";
}
boot_to_login_screen();
}
sub power_off {
# Powers-off the machine.
if (get_var('DESKTOP') eq 'i3') {
# we are still in i3 if the bar is visible
if (check_screen('i3-bar')) {
logout_user();
}
assert_screen('lightdm_login_screen');
send_key('alt-f4');
assert_and_click('lightdm_power_menu-shutdown-confirm');
}
else {
assert_and_click "system_menu_button";
# in KDE, there's no submenu to access, the button is right here,
# in GNOME we need the submenu
# in KDE since F34, there's no submenu to access, the button is right here
assert_screen ["power_entry", "power_off_entry"];
click_lastmatch;
assert_and_click "power_off_entry" if (match_has_tag("power_entry"));
assert_and_click "power_off_confirm";
assert_shutdown 120;
}
assert_shutdown;
}
sub run {
@ -238,7 +321,18 @@ sub run {
# Try to log in with either account, intentionally entering the wrong password.
login_user(user=>"jack", password=>"wrongpassword", checklogin=>0);
# get back to the login screen if necessary (dismiss an error message)
my $relnum = get_release_number;
if (($desktop eq "gnome" && $relnum < 34) || $desktop eq 'i3') {
# In GDM before F34 or lightdm (used by i3), a message is shown about an
# unsuccessful login and it can be asserted, so let's do it. In SDDM and
# GDM F34+, there is also a message, but it is only displayed for a
# short moment and the assertion fails here, so we will skip the
# assertion. Not being able to login in with a wrong password is enough
# here.
assert_screen "login_wrong_password";
# don't send escape in lightdm, it does nothing there
send_key 'esc' unless $desktop eq 'i3';
}
send_key 'esc' unless (check_screen "login_jim");
# Now, log into the system again using the correct password. This will

View File

@ -3,6 +3,7 @@ use strict;
use testapi;
use utils;
use packagetest;
use i3;
# This test sort of covers QA:Testcase_desktop_update_notification
# and QA:Testcase_desktop_error_checks . If it fails, probably *one*
@ -27,6 +28,7 @@ sub run {
$self->root_console(tty => 1);
# ensure we actually have some package updates available
prepare_test_packages;
my $user = get_var('USER_LOGIN', 'test');
if ($desktop eq 'gnome') {
# On GNOME, move the clock forward if needed, because it won't
# check for updates before 6am(!)
@ -47,7 +49,7 @@ sub run {
my $longago = $now - 14 * 24 * 60 * 60;
# have to log in as the user to do this
script_run 'exit', 0;
console_login(user => get_var('USER_LOGIN', 'test'), password => get_var('USER_PASSWORD', 'weakpassword'));
console_login(user=>$user, password=>get_var('USER_PASSWORD', 'weakpassword'));
script_run "gsettings set org.gnome.software check-timestamp ${yyday}", 0;
script_run "gsettings set org.gnome.software update-notification-timestamp ${longago}", 0;
script_run "gsettings set org.gnome.software online-updates-timestamp ${longago}", 0;
@ -57,6 +59,14 @@ sub run {
script_run 'exit', 0;
console_login(user => 'root', password => get_var('ROOT_PASSWORD', 'weakpassword'));
}
} elsif ($desktop eq 'i3') {
assert_script_run('dnf install -y libnotify');
my $target_user = get_var("USER_LOGIN");
if (!defined(get_var("BOOTFROM"))) {
$target_user = "liveuser";
}
assert_script_run("usermod -a -G dialout $target_user");
create_user_i3_config(login => $target_user);
}
if ($desktop eq 'kde' && get_var("BOOTFROM")) {
# need to login as user for this
@ -121,6 +131,21 @@ sub run {
click_lastmatch;
}
}
if ($desktop eq 'i3') {
# we launch a terminal so that the top of the screen is filled with
# something that we know and can check that it is not covered by a
# notification popup from dunst
send_key(get_i3_modifier() . '-ret');
assert_screen("apps_run_terminal");
assert_script_run('notify-send -t 5000 "foo"');
assert_screen("i3_dunst_foo_notification", timeout => 5);
sleep 6;
assert_screen("i3_dunst_no_notification");
# we quit at this point as the i3 spin has no desktop update notifier
return;
}
if (get_var("BOOTFROM")) {
# we should see an update notification and no others
assert_screen "desktop_update_notification_only";

View File

@ -2,6 +2,7 @@ use base "installedtest";
use strict;
use testapi;
use utils;
use i3;
sub run {
my $self = shift;
@ -19,8 +20,13 @@ sub run {
# If the test should be running with CUPS-PDF, we need to install it first.
if ($usecups) {
my $pkgs = "cups-pdf";
# On I3, we also need to install the PDF reader.
if ($desktop eq "i3") {
$pkgs = $pkgs . " mupdf";
}
# Install the Cups-PDF package to use the Cups-PDF printer
assert_script_run "dnf -y install cups-pdf", 180;
assert_script_run "dnf -y install $pkgs", 240;
}
# Here, we were doing a version logic. This is no longer needed, because
@ -32,6 +38,21 @@ sub run {
# Verification commands need serial console to be writable and readable for
# normal users, let's make it writable then.
script_run("chmod 666 /dev/${serialdev}");
# Check whether the cups-pdf printer is actually present on the system
# FIXME: If it is missing, add it manually by removing and installing
# cups-pdf again
my $cups_pdf_present = script_run('lpstat -t|grep -q -i cups-pdf');
if ($cups_pdf_present != 0) {
record_soft_failure 'Cups-PDF printer is not present on the system (rhbz#1984295)';
assert_script_run "dnf -y remove cups-pdf", 180;
assert_script_run "dnf -y install cups-pdf", 180;
}
# FIXME: log version of cups-pdf and check it for output location
# this is only necessary as long as the test may run on cups-pdf
# 3.0.1-11 or lower, as soon as that's not true we can cut it
my $cpdfver = script_output 'rpm -q cups-pdf --queryformat "%{VERSION}-%{RELEASE}\n"';
assert_script_run "dnf -y install rpmdevtools", 180;
my $cpdfvercmp = script_run "rpmdev-vercmp $cpdfver 3.0.1-11.5";
# Leave the root terminal and switch back to desktop for the rest of the test.
desktop_vt();
@ -48,6 +69,11 @@ sub run {
$maximize = "super-pgup";
$term = "konsole";
}
elsif ($desktop eq "i3") {
$editor = "mousepad";
$viewer = "mupdf";
$maximize = undef;
}
# give the desktop a few seconds to settle, we seem to be getting
# a lot of mis-types in KDE if we do not, as of 2024-02
@ -58,18 +84,27 @@ sub run {
}
# Let's open the terminal. We will use it to start the applications
# as well as to check for the name of the printed file.
unless ($desktop eq "i3") {
menu_launch_type($term);
wait_still_screen(5);
}
else {
launch_terminal;
# switch to tabbed mode
send_key(get_i3_modifier() . "-w");
}
# Open the text editor and maximize it.
wait_screen_change { type_very_safely "$editor /home/test/testfile.txt &\n"; };
wait_still_screen(stilltime => 2, similarity_level => 45);
unless ($desktop eq "i3") {
wait_screen_change { send_key($maximize); };
wait_still_screen(stilltime => 2, similarity_level => 45);
}
# Print the file using one of the available methods
send_key "ctrl-p";
wait_still_screen(stilltime => 3, similarity_level => 45);
wait_still_screen(stilltime => 5, similarity_level => 45);
# We will select the printing method
# In case of KDE, we will need to select the printer first.
if ($desktop eq "kde") {
@ -95,7 +130,28 @@ sub run {
}
else {
# Exit the application
send_key "alt-f4";
send_key "alt-f4" unless $desktop eq "i3";
}
# Open the pdf file and check the print
if ($desktop eq "i3") {
launch_terminal;
} else {
send_key "alt-f2";
wait_still_screen(stilltime=>5, similarity_level=>45);
}
# output location is different for cups-pdf 3.0.1-12 or later (we
# checked this above)
if ($cpdfvercmp eq "12") {
# older cups-pdf
type_safely "$viewer /home/$user/Desktop/testfile.pdf\n";
}
elsif ($editor eq "mousepad") {
# mousepad creates relatively weird pdf names, so we use a wildcard here
type_safely "$viewer /home/$user/" . 'Mousepad*job_1.pdf' . "\n";
}
else {
type_safely "$viewer /home/$user/Desktop/testfile-job_1.pdf\n";
}
# Get the name of the printed file. The path location depends
@ -121,9 +177,9 @@ sub run {
wait_still_screen(stilltime => 3, similarity_level => 45);
# Resize the window, so that the size of the document fits the bigger space
# and gets more readable.
send_key $maximize;
send_key $maximize unless !defined($maximize);
wait_still_screen(stilltime=>2, similarity_level=>45);
# in KDE, make sure we're at the start of the document
# make sure we're at the start of the document
send_key "ctrl-home" if ($desktop eq "kde");
# Check the printed pdf.
assert_screen "printing_check_sentence";

46
tests/i3_tilling.pm Normal file
View File

@ -0,0 +1,46 @@
use base "installedtest";
use strict;
use testapi;
use utils;
use i3;
sub run {
my $desktop = get_var("DESKTOP");
my $mod = get_i3_modifier();
die "This test is only for the i3 desktop" unless $desktop eq "i3";
# launch a terminal first
send_key("$mod-ret");
assert_screen("apps_run_terminal");
# start pavucontrol, mousepad and check that they are split on the screen
x11_start_program("pavucontrol");
x11_start_program("mousepad");
assert_screen("i3_windows_split");
# switch to tabbed layout
send_key("$mod-w");
assert_screen("i3_windows_tabbed");
send_key_until_needlematch("apps_run_terminal", "$mod-j");
send_key("$mod-;");
assert_screen("audio_mixer");
send_key("$mod-;");
assert_screen("mousepad_no_document_open");
# switch to stacked layout
send_key("$mod-s");
assert_screen("i3_windows_stacked");
send_key_until_needlematch("apps_run_terminal", "$mod-k");
send_key("$mod-l");
assert_screen("mousepad_no_document_open");
send_key("$mod-l");
assert_screen("audio_mixer");
}
1;