Skip to content

Commit

Permalink
Add openSUSEway test
Browse files Browse the repository at this point in the history
  • Loading branch information
cedvid committed Oct 30, 2024
1 parent ee1dc5c commit 1e7ccfb
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 0 deletions.
4 changes: 4 additions & 0 deletions products/opensuse/main.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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');

Expand Down
15 changes: 15 additions & 0 deletions schedule/sway.yaml
Original file line number Diff line number Diff line change
@@ -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
- x11/reboot_icewm
- console/install_sway_pattern
- shutdown/shutdown
33 changes: 33 additions & 0 deletions tests/console/install_sway_pattern.pm
Original file line number Diff line number Diff line change
@@ -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 <dimstar@opensuse.org>

use base "consoletest";
use serial_terminal 'select_serial_terminal';
use strict;
use warnings;
use testapi;
use utils;
use power_action_utils 'power_action';

sub run {
select_serial_terminal;

script_run("mkdir -p ~/.config/sway");
script_run("cp /etc/sway/config ~/.config/sway/");
assert_script_run("sed -i 's/set \$menu dmenu_path/set \$menu dmenu_path | dmenu -nb \\\'#173f4f\\' -sb \\\'#35b9ab\\' -nf \\\'#73ba25\\' -sf \\\'#173f4f\\' -fn \\\'Source Sans Pro-14\\' | xargs swaymsg exec --/' ~/.config/sway/config");
script_run('echo -e "[Desktop]\\nSession=sway" > ~/.dmrc');
power_action('reboot', textmode => 1);
$self->wait_boot;
send_key("super-d");
assert_screen 'sway-menu-bar';
}

1;
27 changes: 27 additions & 0 deletions tests/x11/sway_reconfigure_openqa.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# SUSE's openQA tests

Check failure on line 1 in tests/x11/sway_reconfigure_openqa.pm

View workflow job for this annotation

GitHub Actions / CI: Running static tests with perl v5.32

File tests/x11/sway_reconfigure_openqa.pm needs tidying
#
# 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 <dimstar@opensuse.org>

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', 0);

$self->result('ok');
}

1;

0 comments on commit 1e7ccfb

Please sign in to comment.