1 import ./make-test-python.nix ({ pkgs, ... }: {
2 name = "magic-wormhole-mailbox-server";
3 meta = with pkgs.lib.maintainers; {
4 maintainers = [ mmahut ];
9 networking.firewall.allowedTCPPorts = [ 4000 ];
10 services.magic-wormhole-mailbox-server.enable = true;
13 client_alice = { ... }: {
14 networking.firewall.enable = false;
15 environment.systemPackages = [ pkgs.magic-wormhole ];
18 client_bob = { ... }: {
19 environment.systemPackages = [ pkgs.magic-wormhole ];
26 # Start the wormhole relay server
27 server.wait_for_unit("magic-wormhole-mailbox-server.service")
28 server.wait_for_open_port(4000)
30 # Create a secret file and send it to Bob
31 client_alice.succeed("echo mysecret > secretfile")
32 client_alice.succeed("wormhole --relay-url=ws://server:4000/v1 send -0 secretfile >&2 &")
34 # Retrieve a secret file from Alice and check its content
35 client_bob.succeed("wormhole --relay-url=ws://server:4000/v1 receive -0 --accept-file")
36 client_bob.succeed("grep mysecret secretfile")