nixos/tests: new test for plikd

master
freezeboy 2020-11-13 15:00:34 +01:00
parent fc2ae7d79e
commit 10fa80fd30
2 changed files with 28 additions and 0 deletions

View File

@ -306,6 +306,7 @@ in
pinnwand = handleTest ./pinnwand.nix {};
plasma5 = handleTest ./plasma5.nix {};
pleroma = handleTestOn [ "x86_64-linux" "aarch64-linux" ] ./pleroma.nix {};
plikd = handleTest ./plikd.nix {};
plotinus = handleTest ./plotinus.nix {};
podman = handleTestOn ["x86_64-linux"] ./podman.nix {};
postfix = handleTest ./postfix.nix {};

27
nixos/tests/plikd.nix Normal file
View File

@ -0,0 +1,27 @@
import ./make-test-python.nix ({ lib, ... }: {
name = "plikd";
meta = with lib.maintainers; {
maintainers = [ freezeboy ];
};
machine = { pkgs, ... }: let
in {
services.plikd.enable = true;
environment.systemPackages = [ pkgs.plik ];
};
testScript = ''
# Service basic test
machine.wait_for_unit("plikd")
# Network test
machine.wait_for_open_port("8080")
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")
'';
})