diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2016-04-12 19:12:28 +0200 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2016-04-12 19:13:52 +0200 |
commit | a42698d2a496516da08f31cfc7daab3d6f69a0fe (patch) | |
tree | 2bf9dfcf2fe76f6269cb1e7d3ad0d1379049af16 | |
parent | 9153d8ed640e4df38422cad89a72a43c9df9f057 (diff) | |
download | nixpkgs-a42698d2a496516da08f31cfc7daab3d6f69a0fe.tar nixpkgs-a42698d2a496516da08f31cfc7daab3d6f69a0fe.tar.gz nixpkgs-a42698d2a496516da08f31cfc7daab3d6f69a0fe.tar.bz2 nixpkgs-a42698d2a496516da08f31cfc7daab3d6f69a0fe.tar.lz nixpkgs-a42698d2a496516da08f31cfc7daab3d6f69a0fe.tar.xz nixpkgs-a42698d2a496516da08f31cfc7daab3d6f69a0fe.tar.zst nixpkgs-a42698d2a496516da08f31cfc7daab3d6f69a0fe.zip |
Add a regression test for #14623
-rw-r--r-- | nixos/tests/common/user-account.nix | 9 | ||||
-rw-r--r-- | nixos/tests/xfce.nix | 6 |
2 files changed, 13 insertions, 2 deletions
diff --git a/nixos/tests/common/user-account.nix b/nixos/tests/common/user-account.nix index ded8275000a..93aeb60e456 100644 --- a/nixos/tests/common/user-account.nix +++ b/nixos/tests/common/user-account.nix @@ -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"; + }; } diff --git a/nixos/tests/xfce.nix b/nixos/tests/xfce.nix index 9f1f997db5f..c8b18f12265 100644 --- a/nixos/tests/xfce.nix +++ b/nixos/tests/xfce.nix @@ -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'"); ''; }) |