Add a regression test for #14623

+13 -2
+7 -2
nixos/tests/common/user-account.nix
··· 1 { lib, ... }: 2 3 - { users.extraUsers = lib.singleton 4 { isNormalUser = true; 5 - name = "alice"; 6 description = "Alice Foobar"; 7 password = "foobar"; 8 }; 9 }
··· 1 { lib, ... }: 2 3 + { users.extraUsers.alice = 4 { isNormalUser = true; 5 description = "Alice Foobar"; 6 + password = "foobar"; 7 + }; 8 + 9 + users.extraUsers.bob = 10 + { isNormalUser = true; 11 + description = "Bob Foobar"; 12 password = "foobar"; 13 }; 14 }
+6
nixos/tests/xfce.nix
··· 15 services.xserver.displayManager.auto.user = "alice"; 16 17 services.xserver.desktopManager.xfce.enable = true; 18 }; 19 20 testScript = ··· 32 $machine->waitForWindow(qr/Terminal/); 33 $machine->sleep(10); 34 $machine->screenshot("screen"); 35 ''; 36 })
··· 15 services.xserver.displayManager.auto.user = "alice"; 16 17 services.xserver.desktopManager.xfce.enable = true; 18 + 19 + environment.systemPackages = [ pkgs.xorg.xmessage ]; 20 }; 21 22 testScript = ··· 34 $machine->waitForWindow(qr/Terminal/); 35 $machine->sleep(10); 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'"); 41 ''; 42 })