tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
0
fork
atom
lol
0
fork
atom
overview
issues
pulls
pipelines
nixos/tests/mate: init
Bobby Rong
3 years ago
76c0fad1
a518c771
+59
2 changed files
expand all
collapse all
unified
split
nixos
tests
all-tests.nix
mate.nix
+1
nixos/tests/all-tests.nix
···
376
376
man = handleTest ./man.nix {};
377
377
mariadb-galera = handleTest ./mysql/mariadb-galera.nix {};
378
378
mastodon = discoverTests (import ./web-apps/mastodon { inherit handleTestOn; });
379
379
+
mate = handleTest ./mate.nix {};
379
380
matomo = handleTest ./matomo.nix {};
380
381
matrix-appservice-irc = handleTest ./matrix/appservice-irc.nix {};
381
382
matrix-conduit = handleTest ./matrix/conduit.nix {};
+58
nixos/tests/mate.nix
···
1
1
+
import ./make-test-python.nix ({ pkgs, lib, ... }: {
2
2
+
name = "mate";
3
3
+
4
4
+
meta = {
5
5
+
maintainers = lib.teams.mate.members;
6
6
+
};
7
7
+
8
8
+
nodes.machine = { ... }: {
9
9
+
imports = [
10
10
+
./common/user-account.nix
11
11
+
];
12
12
+
13
13
+
services.xserver.enable = true;
14
14
+
15
15
+
services.xserver.displayManager = {
16
16
+
lightdm.enable = true;
17
17
+
autoLogin = {
18
18
+
enable = true;
19
19
+
user = "alice";
20
20
+
};
21
21
+
};
22
22
+
23
23
+
services.xserver.desktopManager.mate.enable = true;
24
24
+
25
25
+
# Silence log spam due to no sound drivers loaded:
26
26
+
# ALSA lib confmisc.c:855:(parse_card) cannot find card '0'
27
27
+
hardware.pulseaudio.enable = true;
28
28
+
};
29
29
+
30
30
+
testScript = { nodes, ... }:
31
31
+
let
32
32
+
user = nodes.machine.users.users.alice;
33
33
+
in
34
34
+
''
35
35
+
with subtest("Wait for login"):
36
36
+
machine.wait_for_x()
37
37
+
machine.wait_for_file("${user.home}/.Xauthority")
38
38
+
machine.succeed("xauth merge ${user.home}/.Xauthority")
39
39
+
40
40
+
with subtest("Check that logging in has given the user ownership of devices"):
41
41
+
machine.succeed("getfacl -p /dev/snd/timer | grep -q ${user.name}")
42
42
+
43
43
+
with subtest("Check if MATE session components actually start"):
44
44
+
machine.wait_until_succeeds("pgrep marco")
45
45
+
machine.wait_for_window("marco")
46
46
+
machine.wait_until_succeeds("pgrep mate-panel")
47
47
+
machine.wait_for_window("Top Panel")
48
48
+
machine.wait_for_window("Bottom Panel")
49
49
+
machine.wait_until_succeeds("pgrep caja")
50
50
+
machine.wait_for_window("Caja")
51
51
+
52
52
+
with subtest("Open MATE terminal"):
53
53
+
machine.succeed("su - ${user.name} -c 'DISPLAY=:0.0 mate-terminal >&2 &'")
54
54
+
machine.wait_for_window("Terminal")
55
55
+
machine.sleep(20)
56
56
+
machine.screenshot("screen")
57
57
+
'';
58
58
+
})