3
0
Fork 0
forked from mirrors/nixpkgs

Add a regression test for #14623

This commit is contained in:
Eelco Dolstra 2016-04-12 19:12:28 +02:00
parent 9153d8ed64
commit a42698d2a4
2 changed files with 13 additions and 2 deletions

View file

@ -1,9 +1,14 @@
{ lib, ... }:
{ users.extraUsers = lib.singleton
{ users.extraUsers.alice =
{ isNormalUser = true;
name = "alice";
description = "Alice Foobar";
password = "foobar";
};
users.extraUsers.bob =
{ isNormalUser = true;
description = "Bob Foobar";
password = "foobar";
};
}

View file

@ -15,6 +15,8 @@ import ./make-test.nix ({ pkgs, ...} : {
services.xserver.displayManager.auto.user = "alice";
services.xserver.desktopManager.xfce.enable = true;
environment.systemPackages = [ pkgs.xorg.xmessage ];
};
testScript =
@ -32,5 +34,9 @@ import ./make-test.nix ({ pkgs, ...} : {
$machine->waitForWindow(qr/Terminal/);
$machine->sleep(10);
$machine->screenshot("screen");
# Ensure that the X server does proper access control.
$machine->mustFail("su - bob -c 'DISPLAY=:0.0 xmessage Foo'");
$machine->mustFail("su - bob -c 'DISPLAY=:0 xmessage Foo'");
'';
})