1 import ../make-test-python.nix (
6 # nix shell .#rkvm --command "rkvm-certificate-gen --ip-addresses 10.0.0.1 cert.pem key.pem"
8 snakeoil-cert = ./cert.pem;
9 snakeoil-key = ./key.pem;
18 imports = [ ../common/user-account.nix ];
20 virtualisation.vlans = [ 1 ];
25 firewall.enable = false;
28 systemd.network.networks."01-eth1" = {
30 networkConfig.Address = "10.0.0.1/24";
33 services.getty.autologinUser = "alice";
35 services.rkvm.server = {
38 certificate = snakeoil-cert;
40 password = "snakeoil";
52 imports = [ ../common/user-account.nix ];
54 virtualisation.vlans = [ 1 ];
59 firewall.enable = false;
62 systemd.network.networks."01-eth1" = {
64 networkConfig.Address = "10.0.0.2/24";
67 services.getty.autologinUser = "alice";
69 services.rkvm.client = {
72 server = "10.0.0.1:5258";
73 certificate = snakeoil-cert;
75 password = "snakeoil";
82 server.wait_for_unit("getty@tty1.service")
83 server.wait_until_succeeds("pgrep -f 'agetty.*tty1'")
84 server.wait_for_unit("rkvm-server")
85 server.wait_for_open_port(5258)
87 client.wait_for_unit("getty@tty1.service")
88 client.wait_until_succeeds("pgrep -f 'agetty.*tty1'")
89 client.wait_for_unit("rkvm-client")
94 server.send_key("alt-alt_r", delay=0.2)
95 server.send_chars("echo 'hello client' > /tmp/test.txt\n")
98 server.send_key("alt-alt_r", delay=0.2)
99 server.send_chars("echo 'hello server' > /tmp/test.txt\n")
103 client.systemctl("stop rkvm-client.service")
104 server.systemctl("stop rkvm-server.service")
106 server_file = server.succeed("cat /tmp/test.txt")
107 assert server_file.strip() == "hello server"
109 client_file = client.succeed("cat /tmp/test.txt")
110 assert client_file.strip() == "hello client"