depot/third_party/nixpkgs/nixos/tests/plikd.nix
Default email 75ca762b89 Project import generated by Copybara.
GitOrigin-RevId: 29b0d4d0b600f8f5dd0b86e3362a33d4181938f9
2021-03-09 11:18:52 +08:00

27 lines
679 B
Nix

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")
'';
})