at master 776 B view raw
1{ 2 lib, 3 pkgs, 4 ... 5}: 6{ 7 name = "send"; 8 9 meta = { 10 maintainers = with lib.maintainers; [ 11 moraxyc 12 MrSom3body 13 ]; 14 }; 15 16 nodes.machine = 17 { pkgs, ... }: 18 { 19 environment.systemPackages = with pkgs; [ 20 curl 21 ffsend 22 ]; 23 24 services.send = { 25 enable = true; 26 }; 27 }; 28 29 testScript = '' 30 machine.wait_for_unit("send.service") 31 32 machine.wait_for_open_port(1443) 33 34 machine.succeed("curl --fail --max-time 10 http://127.0.0.1:1443") 35 36 machine.succeed("echo HelloWorld > /tmp/test") 37 url = machine.succeed("ffsend upload -q -h http://127.0.0.1:1443/ /tmp/test") 38 machine.succeed(f'ffsend download --output /tmp/download {url}') 39 machine.succeed("cat /tmp/download | grep HelloWorld") 40 ''; 41}