Add a regression test for #14623

+13 -2
+7 -2
nixos/tests/common/user-account.nix
··· 1 1 { lib, ... }: 2 2 3 - { users.extraUsers = lib.singleton 3 + { users.extraUsers.alice = 4 4 { isNormalUser = true; 5 - name = "alice"; 6 5 description = "Alice Foobar"; 6 + password = "foobar"; 7 + }; 8 + 9 + users.extraUsers.bob = 10 + { isNormalUser = true; 11 + description = "Bob Foobar"; 7 12 password = "foobar"; 8 13 }; 9 14 }
+6
nixos/tests/xfce.nix
··· 15 15 services.xserver.displayManager.auto.user = "alice"; 16 16 17 17 services.xserver.desktopManager.xfce.enable = true; 18 + 19 + environment.systemPackages = [ pkgs.xorg.xmessage ]; 18 20 }; 19 21 20 22 testScript = ··· 32 34 $machine->waitForWindow(qr/Terminal/); 33 35 $machine->sleep(10); 34 36 $machine->screenshot("screen"); 37 + 38 + # Ensure that the X server does proper access control. 39 + $machine->mustFail("su - bob -c 'DISPLAY=:0.0 xmessage Foo'"); 40 + $machine->mustFail("su - bob -c 'DISPLAY=:0 xmessage Foo'"); 35 41 ''; 36 42 })