From 0f57c4b9529b840d8d3a1e2349513535f3b7adc7 Mon Sep 17 00:00:00 2001 From: oxalica Date: Mon, 1 Nov 2021 04:34:10 +0800 Subject: [PATCH] nixosTest/plasma5-systemd-start: init --- nixos/tests/all-tests.nix | 1 + nixos/tests/plasma5-systemd-start.nix | 43 +++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 nixos/tests/plasma5-systemd-start.nix diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index b7d82f2ff640..b6fce1bb6192 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -351,6 +351,7 @@ in php80 = handleTest ./php { php = pkgs.php80; }; pinnwand = handleTest ./pinnwand.nix {}; plasma5 = handleTest ./plasma5.nix {}; + plasma5-systemd-start = handleTest ./plasma5-systemd-start.nix {}; plausible = handleTest ./plausible.nix {}; pleroma = handleTestOn [ "x86_64-linux" "aarch64-linux" ] ./pleroma.nix {}; plikd = handleTest ./plikd.nix {}; diff --git a/nixos/tests/plasma5-systemd-start.nix b/nixos/tests/plasma5-systemd-start.nix new file mode 100644 index 000000000000..ac6fad7da6c6 --- /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' + ''; +})