1 import ./make-test-python.nix ({ pkgs, ... }:
3 client = { pkgs, ... }: {
4 environment.systemPackages = [ pkgs.croc ];
6 pass = pkgs.writeText "pass" "PassRelay";
9 meta = with pkgs.lib.maintainers; {
10 maintainers = [ hax404 julm ];
28 # wait until relay is up
29 relay.wait_for_unit("croc")
30 relay.wait_for_open_port(9009)
31 relay.wait_for_open_port(9010)
32 relay.wait_for_open_port(9011)
33 relay.wait_for_open_port(9012)
34 relay.wait_for_open_port(9013)
36 # generate testfiles and send them
37 sender.wait_for_unit("multi-user.target")
38 sender.execute("echo Hello World > testfile01.txt")
39 sender.execute("echo Hello Earth > testfile02.txt")
41 "croc --pass ${pass} --relay relay send --code topSecret testfile01.txt testfile02.txt >&2 &"
44 # receive the testfiles and check them
46 "croc --pass ${pass} --yes --relay relay topSecret"
48 assert "Hello World" in receiver.succeed("cat testfile01.txt")
49 assert "Hello Earth" in receiver.succeed("cat testfile02.txt")