nixpkgs/nixos/tests/haste-server.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

26 lines
622 B
Nix
Raw Normal View History

{ pkgs, lib, ... }:
{
name = "haste-server";
meta.maintainers = with lib.maintainers; [ mkg20001 ];
2022-03-02 18:00:16 +01:00
nodes.machine =
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
curl
jq
];
2022-03-02 18:00:16 +01:00
services.haste-server = {
enable = true;
2022-03-02 18:00:16 +01:00
};
};
2022-03-02 18:00:16 +01:00
testScript = ''
machine.wait_for_unit("haste-server")
machine.wait_until_succeeds("curl -s localhost:7777")
machine.succeed('curl -s -X POST http://localhost:7777/documents -d "Hello World!" > bla')
machine.succeed('curl http://localhost:7777/raw/$(cat bla | jq -r .key) | grep "Hello World"')
'';
}