From 0f57c4b9529b840d8d3a1e2349513535f3b7adc7 Mon Sep 17 00:00:00 2001 From: oxalica Date: Mon, 1 Nov 2021 04:34:10 +0800 Subject: nixosTest/plasma5-systemd-start: init --- nixos/tests/plasma5-systemd-start.nix | 43 +++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 nixos/tests/plasma5-systemd-start.nix (limited to 'nixos/tests/plasma5-systemd-start.nix') diff --git a/nixos/tests/plasma5-systemd-start.nix b/nixos/tests/plasma5-systemd-start.nix new file mode 100644 index 00000000000..ac6fad7da6c --- /dev/null +++ b/nixos/tests/plasma5-systemd-start.nix @@ -0,0 +1,43 @@ +import ./make-test-python.nix ({ pkgs, ...} : + +{ + name = "plasma5-systemd-start"; + meta = with pkgs.lib.maintainers; { + maintainers = [ oxalica ]; + }; + + machine = { ... }: + + { + imports = [ ./common/user-account.nix ]; + services.xserver = { + enable = true; + displayManager.sddm.enable = true; + displayManager.defaultSession = "plasma"; + desktopManager.plasma5.enable = true; + desktopManager.plasma5.runUsingSystemd = true; + displayManager.autoLogin = { + enable = true; + user = "alice"; + }; + }; + virtualisation.memorySize = 1024; + }; + + testScript = { nodes, ... }: let + user = nodes.machine.config.users.users.alice; + in '' + with subtest("Wait for login"): + start_all() + machine.wait_for_file("${user.home}/.Xauthority") + machine.succeed("xauth merge ${user.home}/.Xauthority") + + with subtest("Check plasmashell started"): + machine.wait_until_succeeds("pgrep plasmashell") + machine.wait_for_window("^Desktop ") + + status, result = machine.systemctl('--no-pager show plasma-plasmashell.service', user='alice') + assert status == 0, 'Service not found' + assert 'ActiveState=active' in result.split('\n'), 'Systemd service not active' + ''; +}) -- cgit 1.4.1