diff options
author | Bobby Rong <rjl931189261@126.com> | 2023-01-09 12:38:19 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-09 12:38:19 +0800 |
commit | 21b9c3cee5fa202659c07ca0071706f4ea2f14df (patch) | |
tree | 5bdf76f8153825887dea67c988243ddd371d4563 | |
parent | 17d08f2fcc34b21495431cbaa0c1967a191918fd (diff) | |
parent | db330d32d841a96fe966346f7ce0648538f1efc7 (diff) |
Merge pull request #209709 from bobby285271/init/nixosTests.mate
nixos/tests/mate: init
-rw-r--r-- | .github/labeler.yml | 5 | ||||
-rw-r--r-- | nixos/tests/all-tests.nix | 1 | ||||
-rw-r--r-- | nixos/tests/mate.nix | 58 |
3 files changed, 64 insertions, 0 deletions
diff --git a/.github/labeler.yml b/.github/labeler.yml index 412dff9c06f81..9381ff6722698 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -65,6 +65,11 @@ - pkgs/development/lua-modules/**/* - pkgs/top-level/lua-packages.nix +"6.topic: mate": + - nixos/modules/services/x11/desktop-managers/mate.nix + - nixos/tests/mate.nix + - pkgs/desktops/mate/**/* + "6.topic: nixos": - nixos/**/* - pkgs/os-specific/linux/nixos-rebuild/**/* diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index e5dc4a82e1b41..070c19eed92b2 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -377,6 +377,7 @@ in { man = handleTest ./man.nix {}; mariadb-galera = handleTest ./mysql/mariadb-galera.nix {}; mastodon = discoverTests (import ./web-apps/mastodon { inherit handleTestOn; }); + mate = handleTest ./mate.nix {}; matomo = handleTest ./matomo.nix {}; matrix-appservice-irc = handleTest ./matrix/appservice-irc.nix {}; matrix-conduit = handleTest ./matrix/conduit.nix {}; diff --git a/nixos/tests/mate.nix b/nixos/tests/mate.nix new file mode 100644 index 0000000000000..78ba59c5fc20d --- /dev/null +++ b/nixos/tests/mate.nix @@ -0,0 +1,58 @@ +import ./make-test-python.nix ({ pkgs, lib, ... }: { + name = "mate"; + + meta = { + maintainers = lib.teams.mate.members; + }; + + nodes.machine = { ... }: { + imports = [ + ./common/user-account.nix + ]; + + services.xserver.enable = true; + + services.xserver.displayManager = { + lightdm.enable = true; + autoLogin = { + enable = true; + user = "alice"; + }; + }; + + services.xserver.desktopManager.mate.enable = true; + + # Silence log spam due to no sound drivers loaded: + # ALSA lib confmisc.c:855:(parse_card) cannot find card '0' + hardware.pulseaudio.enable = true; + }; + + testScript = { nodes, ... }: + let + user = nodes.machine.users.users.alice; + in + '' + with subtest("Wait for login"): + machine.wait_for_x() + machine.wait_for_file("${user.home}/.Xauthority") + machine.succeed("xauth merge ${user.home}/.Xauthority") + + with subtest("Check that logging in has given the user ownership of devices"): + machine.succeed("getfacl -p /dev/snd/timer | grep -q ${user.name}") + + with subtest("Check if MATE session components actually start"): + machine.wait_until_succeeds("pgrep marco") + machine.wait_for_window("marco") + machine.wait_until_succeeds("pgrep mate-panel") + machine.wait_for_window("Top Panel") + machine.wait_for_window("Bottom Panel") + machine.wait_until_succeeds("pgrep caja") + machine.wait_for_window("Caja") + + with subtest("Open MATE terminal"): + machine.succeed("su - ${user.name} -c 'DISPLAY=:0.0 mate-terminal >&2 &'") + machine.wait_for_window("Terminal") + machine.sleep(20) + machine.screenshot("screen") + ''; +}) |