From dfeee51818a69e0bd51d2015a42e74bd6e9e5ddc Mon Sep 17 00:00:00 2001 From: Luca Bruno Date: Tue, 15 Sep 2015 14:25:19 +0200 Subject: [PATCH] nixos tests: add gdm test --- nixos/release.nix | 1 + nixos/tests/gnome3-gdm.nix | 39 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 nixos/tests/gnome3-gdm.nix diff --git a/nixos/release.nix b/nixos/release.nix index 2dbc35c7d7b..4492ee4046e 100644 --- a/nixos/release.nix +++ b/nixos/release.nix @@ -226,6 +226,7 @@ in rec { tests.fleet = hydraJob (import tests/fleet.nix { system = "x86_64-linux"; }); #tests.gitlab = callTest tests/gitlab.nix {}; tests.gnome3 = callTest tests/gnome3.nix {}; + tests.gnome3-gdm = callTest tests/gnome3-gdm.nix {}; tests.i3wm = callTest tests/i3wm.nix {}; tests.installer.grub1 = forAllSystems (system: hydraJob (import tests/installer.nix { inherit system; }).grub1.test); tests.installer.lvm = forAllSystems (system: hydraJob (import tests/installer.nix { inherit system; }).lvm.test); diff --git a/nixos/tests/gnome3-gdm.nix b/nixos/tests/gnome3-gdm.nix new file mode 100644 index 00000000000..1c07ddf79c2 --- /dev/null +++ b/nixos/tests/gnome3-gdm.nix @@ -0,0 +1,39 @@ +import ./make-test.nix ({ pkgs, ...} : { + name = "gnome3-gdm"; + meta = with pkgs.stdenv.lib.maintainers; { + maintainers = [ lethalman ]; + }; + + machine = + { config, pkgs, ... }: + + { imports = [ ./common/user-account.nix ]; + + services.xserver.enable = true; + + services.xserver.displayManager.gdm = { + enable = true; + autoLogin = { + enable = true; + user = "alice"; + }; + }; + services.xserver.desktopManager.gnome3.enable = true; + + virtualisation.memorySize = 512; + }; + + testScript = + '' + $machine->waitForX; + $machine->sleep(15); + + # Check that logging in has given the user ownership of devices. + $machine->succeed("getfacl /dev/snd/timer | grep -q alice"); + + $machine->succeed("su - alice -c 'DISPLAY=:0.0 gnome-terminal &'"); + $machine->waitForWindow(qr/Terminal/); + $machine->sleep(20); + $machine->screenshot("screen"); + ''; +})