2020-11-13 14:00:34 +00:00
|
|
|
import ./make-test-python.nix ({ lib, ... }: {
|
|
|
|
name = "plikd";
|
|
|
|
meta = with lib.maintainers; {
|
|
|
|
maintainers = [ freezeboy ];
|
|
|
|
};
|
|
|
|
|
2022-03-20 23:15:30 +00:00
|
|
|
nodes.machine = { pkgs, ... }: let
|
2020-11-13 14:00:34 +00:00
|
|
|
in {
|
|
|
|
services.plikd.enable = true;
|
|
|
|
environment.systemPackages = [ pkgs.plik ];
|
|
|
|
};
|
|
|
|
|
|
|
|
testScript = ''
|
|
|
|
# Service basic test
|
|
|
|
machine.wait_for_unit("plikd")
|
|
|
|
|
|
|
|
# Network test
|
2022-06-11 12:22:53 +00:00
|
|
|
machine.wait_for_open_port(8080)
|
2020-11-13 14:00:34 +00:00
|
|
|
machine.succeed("curl --fail -v http://localhost:8080")
|
|
|
|
|
|
|
|
# Application test
|
|
|
|
machine.execute("echo test > /tmp/data.txt")
|
|
|
|
machine.succeed("plik --server http://localhost:8080 /tmp/data.txt | grep curl")
|
|
|
|
|
|
|
|
machine.succeed("diff data.txt /tmp/data.txt")
|
|
|
|
'';
|
|
|
|
})
|