From 27ba56f1e01e5015897be087fe25d5bbcfe13d70 Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Fri, 24 Mar 2017 08:02:24 -0500 Subject: [PATCH 1/4] nixos/plasma5: also test SDDM theme --- nixos/tests/plasma5.nix | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/nixos/tests/plasma5.nix b/nixos/tests/plasma5.nix index ca787e9c7b9b..f561fc8c3c4c 100644 --- a/nixos/tests/plasma5.nix +++ b/nixos/tests/plasma5.nix @@ -8,25 +8,27 @@ import ./make-test.nix ({ pkgs, ...} : machine = { lib, ... }: { imports = [ ./common/user-account.nix ]; - virtualisation.memorySize = 1024; services.xserver.enable = true; - services.xserver.displayManager.sddm = { - enable = true; - autoLogin = { - enable = true; - user = "alice"; - }; - }; + services.xserver.displayManager.sddm.enable = true; services.xserver.desktopManager.plasma5.enable = true; services.xserver.desktopManager.default = "plasma5"; - virtualisation.writableStore = false; # FIXME + virtualisation.memorySize = 1024; }; - testScript = { nodes, ... }: - let xdo = "${pkgs.xdotool}/bin/xdotool"; in - '' + enableOCR = true; + + testScript = { nodes, ... }: let + user = nodes.machine.config.users.extraUsers.alice; + xdo = "${pkgs.xdotool}/bin/xdotool"; + in '' startAll; + # Wait for display manager to start + $machine->waitForText(qr/${user.description}/); + $machine->screenshot("sddm"); + + # Log in + $machine->sendChars("${user.password}\n"); $machine->waitForFile("/home/alice/.Xauthority"); $machine->succeed("xauth merge ~alice/.Xauthority"); From e44cd00c2aae5d5e419e3207a571d402f95ec87a Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Fri, 24 Mar 2017 08:02:53 -0500 Subject: [PATCH 2/4] sddm: fix wrapper When I reduced the closure size, I broke the built-in theme. When I reverted that fix, the built-in theme worked but the Plasma theme was broken. Now the wrapper is fixed so that both themes work. --- .../display-managers/sddm/default.nix | 24 ++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/display-managers/sddm/default.nix b/pkgs/applications/display-managers/sddm/default.nix index 9fd56a49b5f5..f675febafb56 100644 --- a/pkgs/applications/display-managers/sddm/default.nix +++ b/pkgs/applications/display-managers/sddm/default.nix @@ -1,4 +1,4 @@ -{ stdenv, makeQtWrapper, fetchFromGitHub, fetchpatch +{ stdenv, lib, makeQtWrapper, fetchFromGitHub, fetchpatch , cmake, extra-cmake-modules, pkgconfig, libxcb, libpthreadstubs, lndir , libXdmcp, libXau, qtbase, qtdeclarative, qttools, pam, systemd , themes @@ -28,10 +28,12 @@ let nativeBuildInputs = [ cmake extra-cmake-modules pkgconfig qttools ]; buildInputs = [ - libxcb libpthreadstubs libXdmcp libXau qtbase pam systemd + libxcb libpthreadstubs libXdmcp libXau pam systemd ]; - propagatedBuildInputs = [ qtdeclarative ]; + propagatedBuildInputs = [ + qtbase qtdeclarative + ]; cmakeFlags = [ "-DCONFIG_FILE=/etc/sddm.conf" @@ -80,6 +82,22 @@ stdenv.mkDerivation { installPhase = '' runHook preInstall + propagated= + for i in $unwrapped $themes; do + findInputs $i propagated propagated-user-env-packages + if [ -z "$crossConfig" ]; then + findInputs $i propagated propagated-native-build-inputs + else + findInputs $i propagated propagated-build-inputs + fi + done + + for pkg in $propagated; do + addToSearchPath RUNTIME_XDG_DATA_DIRS "$pkg/share" + addToSearchPath RUNTIME_XDG_CONFIG_DIRS "$pkg/etc/xdg" + done + + mkdir -p "$out/bin" makeQtWrapper "$unwrapped/bin/sddm" "$out/bin/sddm" mkdir -p "$out/share/sddm" From 5dbbb60d4f11406467d2c3655c4fb35c951ee656 Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Fri, 24 Mar 2017 10:18:00 -0500 Subject: [PATCH 3/4] nixos/plasma5: re-enable test Fixes #24240. I do not know the cause of the test failures, but the tests pass now. --- nixos/release-combined.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/release-combined.nix b/nixos/release-combined.nix index 00abbcacf8c9..63ca39a9b602 100644 --- a/nixos/release-combined.nix +++ b/nixos/release-combined.nix @@ -72,7 +72,7 @@ in rec { (all nixos.tests.ecryptfs) (all nixos.tests.ipv6) (all nixos.tests.i3wm) - #(all nixos.tests.plasma5) # temporarily, see #24240 + (all nixos.tests.plasma5) #(all nixos.tests.lightdm) (all nixos.tests.login) (all nixos.tests.misc) From 352e335f3d643b84f34d5c102a4828712924a267 Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Fri, 24 Mar 2017 10:38:16 -0500 Subject: [PATCH 4/4] nixos/sddm: test automatic and manual login --- nixos/release-combined.nix | 2 +- nixos/release.nix | 2 +- nixos/tests/sddm.nix | 88 +++++++++++++++++++++++++++----------- 3 files changed, 66 insertions(+), 26 deletions(-) diff --git a/nixos/release-combined.nix b/nixos/release-combined.nix index 63ca39a9b602..5c1112a1c6d6 100644 --- a/nixos/release-combined.nix +++ b/nixos/release-combined.nix @@ -92,7 +92,7 @@ in rec { (all nixos.tests.openssh) (all nixos.tests.printing) (all nixos.tests.proxy) - (all nixos.tests.sddm) + (all nixos.tests.sddm.default) (all nixos.tests.simple) (all nixos.tests.udisks2) (all nixos.tests.xfce) diff --git a/nixos/release.nix b/nixos/release.nix index cf7f0a63f4b2..3535690a8e69 100644 --- a/nixos/release.nix +++ b/nixos/release.nix @@ -296,7 +296,7 @@ in rec { tests.quake3 = callTest tests/quake3.nix {}; tests.runInMachine = callTest tests/run-in-machine.nix {}; tests.samba = callTest tests/samba.nix {}; - tests.sddm = callTest tests/sddm.nix {}; + tests.sddm = callSubTests tests/sddm.nix {}; tests.simple = callTest tests/simple.nix {}; tests.smokeping = callTest tests/smokeping.nix {}; tests.taskserver = callTest tests/taskserver.nix {}; diff --git a/nixos/tests/sddm.nix b/nixos/tests/sddm.nix index a1bd8f14d23b..82be9bc1d727 100644 --- a/nixos/tests/sddm.nix +++ b/nixos/tests/sddm.nix @@ -1,26 +1,66 @@ -import ./make-test.nix ({ pkgs, ...} : { - name = "sddm"; +{ system ? builtins.currentSystem }: - machine = { lib, ... }: { - imports = [ ./common/user-account.nix ]; - services.xserver.enable = true; - services.xserver.displayManager.sddm.enable = true; - services.xserver.windowManager.default = "icewm"; - services.xserver.windowManager.icewm.enable = true; - services.xserver.desktopManager.default = "none"; +with import ../lib/testing.nix { inherit system; }; + +let + inherit (pkgs) lib; + + tests = { + default = { + name = "sddm"; + + machine = { lib, ... }: { + imports = [ ./common/user-account.nix ]; + services.xserver.enable = true; + services.xserver.displayManager.sddm.enable = true; + services.xserver.windowManager.default = "icewm"; + services.xserver.windowManager.icewm.enable = true; + services.xserver.desktopManager.default = "none"; + }; + + enableOCR = true; + + testScript = { nodes, ... }: let + user = nodes.machine.config.users.extraUsers.alice; + in '' + startAll; + $machine->waitForText(qr/ALICE/); + $machine->screenshot("sddm"); + $machine->sendChars("${user.password}\n"); + $machine->waitForFile("/home/alice/.Xauthority"); + $machine->succeed("xauth merge ~alice/.Xauthority"); + $machine->waitForWindow("^IceWM "); + ''; + }; + + autoLogin = { + name = "sddm-autologin"; + meta = with pkgs.stdenv.lib.maintainers; { + maintainers = [ ttuegel ]; + }; + + machine = { lib, ... }: { + imports = [ ./common/user-account.nix ]; + services.xserver.enable = true; + services.xserver.displayManager.sddm = { + enable = true; + autoLogin = { + enable = true; + user = "alice"; + }; + }; + services.xserver.windowManager.default = "icewm"; + services.xserver.windowManager.icewm.enable = true; + services.xserver.desktopManager.default = "none"; + }; + + testScript = { nodes, ... }: '' + startAll; + $machine->waitForFile("/home/alice/.Xauthority"); + $machine->succeed("xauth merge ~alice/.Xauthority"); + $machine->waitForWindow("^IceWM "); + ''; + }; }; - - enableOCR = true; - - testScript = { nodes, ... }: let - user = nodes.machine.config.users.extraUsers.alice; - in '' - startAll; - $machine->waitForText(qr/ALICE/); - $machine->screenshot("sddm"); - $machine->sendChars("${user.password}\n"); - $machine->waitForFile("/home/alice/.Xauthority"); - $machine->succeed("xauth merge ~alice/.Xauthority"); - $machine->waitForWindow("^IceWM "); - ''; -}) +in + lib.mapAttrs (lib.const makeTest) tests