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 desktopManager.plasma5.enable = true;
16 desktopManager.plasma5.runUsingSystemd = true;
17 };
18
19 services.displayManager = {
20 sddm.enable = true;
21 defaultSession = "plasma";
22 autoLogin = {
23 enable = true;
24 user = "alice";
25 };
26 };
27 };
28
29 testScript = { nodes, ... }: ''
30 with subtest("Wait for login"):
31 start_all()
32 machine.wait_for_file("/tmp/xauth_*")
33 machine.succeed("xauth merge /tmp/xauth_*")
34
35 with subtest("Check plasmashell started"):
36 machine.wait_until_succeeds("pgrep plasmashell")
37 machine.wait_for_window("^Desktop ")
38
39 status, result = machine.systemctl('--no-pager show plasma-plasmashell.service', user='alice')
40 assert status == 0, 'Service not found'
41 assert 'ActiveState=active' in result.split('\n'), 'Systemd service not active'
42 '';
43})