2019-12-02 21:20:36 +00:00
|
|
|
import ./make-test-python.nix ({ pkgs, ...} : {
|
2017-01-05 23:14:35 +00:00
|
|
|
name = "xrdp";
|
2021-01-10 19:08:30 +00:00
|
|
|
meta = with pkgs.lib.maintainers; {
|
2022-06-22 22:49:35 +00:00
|
|
|
maintainers = [ ];
|
2017-01-05 23:14:35 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nodes = {
|
2018-07-20 20:56:59 +00:00
|
|
|
server = { pkgs, ... }: {
|
2017-01-05 23:14:35 +00:00
|
|
|
imports = [ ./common/user-account.nix ];
|
|
|
|
services.xrdp.enable = true;
|
|
|
|
services.xrdp.defaultWindowManager = "${pkgs.xterm}/bin/xterm";
|
|
|
|
networking.firewall.allowedTCPPorts = [ 3389 ];
|
|
|
|
};
|
|
|
|
|
2018-07-20 20:56:59 +00:00
|
|
|
client = { pkgs, ... }: {
|
2017-01-05 23:14:35 +00:00
|
|
|
imports = [ ./common/x11.nix ./common/user-account.nix ];
|
2020-01-26 22:41:19 +00:00
|
|
|
test-support.displayManager.auto.user = "alice";
|
2017-01-05 23:14:35 +00:00
|
|
|
environment.systemPackages = [ pkgs.freerdp ];
|
|
|
|
services.xrdp.enable = true;
|
|
|
|
services.xrdp.defaultWindowManager = "${pkgs.icewm}/bin/icewm";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2019-12-02 21:20:36 +00:00
|
|
|
testScript = { nodes, ... }: let
|
|
|
|
user = nodes.client.config.users.users.alice;
|
|
|
|
in ''
|
|
|
|
start_all()
|
2017-01-05 23:14:35 +00:00
|
|
|
|
2019-12-02 21:20:36 +00:00
|
|
|
client.wait_for_x()
|
|
|
|
client.wait_for_file("${user.home}/.Xauthority")
|
|
|
|
client.succeed("xauth merge ${user.home}/.Xauthority")
|
2017-01-05 23:14:35 +00:00
|
|
|
|
2019-12-02 21:20:36 +00:00
|
|
|
client.sleep(5)
|
2017-01-05 23:14:35 +00:00
|
|
|
|
2021-11-05 00:43:22 +00:00
|
|
|
client.execute("xterm >&2 &")
|
2019-12-02 21:20:36 +00:00
|
|
|
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")
|
2017-01-05 23:14:35 +00:00
|
|
|
|
2021-11-05 00:43:22 +00:00
|
|
|
client.execute("xterm >&2 &")
|
2019-12-02 21:20:36 +00:00
|
|
|
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")
|
2017-01-05 23:14:35 +00:00
|
|
|
'';
|
|
|
|
})
|