1import ./make-test-python.nix ({ pkgs, ...} :
2
3{
4 name = "plasma5-systemd-start";
5 meta = with pkgs.lib.maintainers; {
6 maintainers = [ oxalica ];
7 };
8
9 nodes.machine = { ... }:
10
11 {
12 imports = [ ./common/user-account.nix ];
13 services.xserver = {
14 enable = true;
15 displayManager.sddm.enable = true;
16 displayManager.defaultSession = "plasma";
17 desktopManager.plasma5.enable = true;
18 desktopManager.plasma5.runUsingSystemd = true;
19 displayManager.autoLogin = {
20 enable = true;
21 user = "alice";
22 };
23 };
24 };
25
26 testScript = { nodes, ... }: let
27 user = nodes.machine.config.users.users.alice;
28 in ''
29 with subtest("Wait for login"):
30 start_all()
31 machine.wait_for_file("${user.home}/.Xauthority")
32 machine.succeed("xauth merge ${user.home}/.Xauthority")
33
34 with subtest("Check plasmashell started"):
35 machine.wait_until_succeeds("pgrep plasmashell")
36 machine.wait_for_window("^Desktop ")
37
38 status, result = machine.systemctl('--no-pager show plasma-plasmashell.service', user='alice')
39 assert status == 0, 'Service not found'
40 assert 'ActiveState=active' in result.split('\n'), 'Systemd service not active'
41 '';
42})