Add a regression test for #14623

Changed files
+13 -2
nixos
tests
+7 -2
nixos/tests/common/user-account.nix
···
{ 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";
};
}
+6
nixos/tests/xfce.nix
···
services.xserver.displayManager.auto.user = "alice";
services.xserver.desktopManager.xfce.enable = true;
+
+
environment.systemPackages = [ pkgs.xorg.xmessage ];
};
testScript =
···
$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'");
'';
})