From 8ba3ad5ff245a01b855d2ef760fd67af460d14ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Vidot?= Date: Mon, 20 May 2024 12:50:55 +0200 Subject: [PATCH] Add openSUSEway test https://progress.opensuse.org/issues/158700 --- products/opensuse/main.pm | 4 ++++ schedule/sway.yaml | 15 ++++++++++++ tests/console/install_sway_pattern.pm | 33 +++++++++++++++++++++++++++ tests/x11/sway_reconfigure_openqa.pm | 27 ++++++++++++++++++++++ 4 files changed, 79 insertions(+) create mode 100644 schedule/sway.yaml create mode 100644 tests/console/install_sway_pattern.pm create mode 100644 tests/x11/sway_reconfigure_openqa.pm diff --git a/products/opensuse/main.pm b/products/opensuse/main.pm index 999dc5c00cdb..34c467c404bf 100644 --- a/products/opensuse/main.pm +++ b/products/opensuse/main.pm @@ -167,6 +167,7 @@ sub load_otherDE_tests { if ($de =~ /^enlightenment$/) { load_enlightenment_tests(); } if ($de =~ /^mate$/) { load_mate_tests(); } if ($de =~ /^lxqt$/) { load_lxqt_tests(); } + if ($de =~ /^sway/) { load_sway_tests(); } load_shutdown_tests; return 1; } @@ -190,6 +191,9 @@ sub load_mate_tests { loadtest "x11/mate_terminal"; } +sub load_sway_tests { +} + sub install_online_updates { return 0 unless get_var('INSTALL_ONLINE_UPDATES'); diff --git a/schedule/sway.yaml b/schedule/sway.yaml new file mode 100644 index 000000000000..938aece051a2 --- /dev/null +++ b/schedule/sway.yaml @@ -0,0 +1,15 @@ +name: test sway +description: > + Tests sway +schedule: + - boot/boot_to_desktop + - console/system_prepare + - console/consoletest_setup + - console/hostname + - update/zypper_clear_repos + - console/install_sway_pattern + - console/consoletest_finish + - x11/sway_reconfigure_openqa.pm + - x11/reboot_icewm + - installation/opensuse_welcome + - shutdown/shutdown diff --git a/tests/console/install_sway_pattern.pm b/tests/console/install_sway_pattern.pm new file mode 100644 index 000000000000..dba4c347b246 --- /dev/null +++ b/tests/console/install_sway_pattern.pm @@ -0,0 +1,33 @@ +# SUSE's openQA tests +# +# Copyright 2012-2016 SUSE LLC +# SPDX-License-Identifier: FSFAP + +# Summary: Framework to test other Desktop Environments +# Non-Primary desktop environments are generally installed by means +# of a pattern. For those tests, we assume a minimal-X based installation +# where the pattern is being installed on top. +# Maintainer: Dominique Leuenberger + +use base "consoletest"; +use strict; +use warnings; +use testapi; +use utils; + +sub run { + select_console 'root-console'; + + script_run("zypper lr -d | tee /dev/$serialdev"); + + zypper_call "in -t pattern sway"; + + # Reset the state of lightdm, to have the new default in use (lightdm saves what the user's last session was) + assert_script_run("rm -f ~lightdm/.cache/lightdm-gtk-greeter/state /var/lib/AccountsService/users/*"); +} + +sub test_flags { + return {milestone => 1, fatal => 1}; +} + +1; diff --git a/tests/x11/sway_reconfigure_openqa.pm b/tests/x11/sway_reconfigure_openqa.pm new file mode 100644 index 000000000000..313ccb048ebe --- /dev/null +++ b/tests/x11/sway_reconfigure_openqa.pm @@ -0,0 +1,27 @@ +# SUSE's openQA tests +# +# Copyright SUSE LLC +# SPDX-License-Identifier: FSFAP + +# Summary: Other Desktop Environments: sway +# Update the openQA internal configuration after the DE has been installed +# Maintainer: Dominique Leuenberger + +use base "x11test"; +use strict; +use warnings; +use testapi; +use utils; + +sub run { + my $self = shift; + + set_var('DESKTOP', 'sway'); + + set_var('DISPLAYMANAGER', 'sddm'); + set_var('DM_NEEDS_USERNAME', 1); + + $self->result('ok'); +} + +1;