1import ./make-test-python.nix ({ pkgs, ...} : {
2 name = "xfce";
3
4 machine =
5 { pkgs, ... }:
6
7 {
8 imports = [
9 ./common/user-account.nix
10 ];
11
12 services.xserver.enable = true;
13
14 services.xserver.displayManager = {
15 lightdm.enable = true;
16 autoLogin = {
17 enable = true;
18 user = "alice";
19 };
20 };
21
22 services.xserver.desktopManager.xfce.enable = true;
23
24 hardware.pulseaudio.enable = true; # needed for the factl test, /dev/snd/* exists without them but udev doesn't care then
25
26 virtualisation.memorySize = 1024;
27 };
28
29 testScript = { nodes, ... }: let
30 user = nodes.machine.config.users.users.alice;
31 in ''
32 machine.wait_for_x()
33 machine.wait_for_file("${user.home}/.Xauthority")
34 machine.succeed("xauth merge ${user.home}/.Xauthority")
35 machine.wait_for_window("xfce4-panel")
36 machine.sleep(10)
37
38 # Check that logging in has given the user ownership of devices.
39 machine.succeed("getfacl -p /dev/snd/timer | grep -q ${user.name}")
40
41 machine.succeed("su - ${user.name} -c 'DISPLAY=:0.0 xfce4-terminal &'")
42 machine.wait_for_window("Terminal")
43 machine.sleep(10)
44 machine.screenshot("screen")
45 '';
46})