at 25.11-pre 757 B view raw
1import ./make-test-python.nix ( 2 { lib, ... }: 3 { 4 name = "plikd"; 5 meta = with lib.maintainers; { 6 maintainers = [ freezeboy ]; 7 }; 8 9 nodes.machine = 10 { pkgs, ... }: 11 let 12 in 13 { 14 services.plikd.enable = true; 15 environment.systemPackages = [ pkgs.plik ]; 16 }; 17 18 testScript = '' 19 # Service basic test 20 machine.wait_for_unit("plikd") 21 22 # Network test 23 machine.wait_for_open_port(8080) 24 machine.succeed("curl --fail -v http://localhost:8080") 25 26 # Application test 27 machine.execute("echo test > /tmp/data.txt") 28 machine.succeed("plik --server http://localhost:8080 /tmp/data.txt | grep curl") 29 30 machine.succeed("diff data.txt /tmp/data.txt") 31 ''; 32 } 33)