nixpkgs-suyu/nixos/tests/xrdp.nix
worldofpeace c95612a5a2 nixos/display-managers/auto: remove
This module allows root autoLogin, so we would break that for users, but
they shouldn't be using it anyways. This gives the impression like auto
is some special display manager, when it's just lightdm and special pam
rules to allow root autoLogin. It was created for NixOS's testing
so I believe this is where it belongs.
2020-01-29 19:05:46 -05:00

47 lines
1.4 KiB
Nix

import ./make-test-python.nix ({ pkgs, ...} : {
name = "xrdp";
meta = with pkgs.stdenv.lib.maintainers; {
maintainers = [ volth ];
};
nodes = {
server = { pkgs, ... }: {
imports = [ ./common/user-account.nix ];
services.xrdp.enable = true;
services.xrdp.defaultWindowManager = "${pkgs.xterm}/bin/xterm";
networking.firewall.allowedTCPPorts = [ 3389 ];
};
client = { pkgs, ... }: {
imports = [ ./common/x11.nix ./common/user-account.nix ];
test-support.displayManager.auto.user = "alice";
environment.systemPackages = [ pkgs.freerdp ];
services.xrdp.enable = true;
services.xrdp.defaultWindowManager = "${pkgs.icewm}/bin/icewm";
};
};
testScript = { nodes, ... }: let
user = nodes.client.config.users.users.alice;
in ''
start_all()
client.wait_for_x()
client.wait_for_file("${user.home}/.Xauthority")
client.succeed("xauth merge ${user.home}/.Xauthority")
client.sleep(5)
client.execute("xterm &")
client.sleep(1)
client.send_chars("xfreerdp /cert-tofu /w:640 /h:480 /v:127.0.0.1 /u:${user.name} /p:${user.password}\n")
client.sleep(5)
client.screenshot("localrdp")
client.execute("xterm &")
client.sleep(1)
client.send_chars("xfreerdp /cert-tofu /w:640 /h:480 /v:server /u:${user.name} /p:${user.password}\n")
client.sleep(5)
client.screenshot("remoterdp")
'';
})