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