1import ./make-test-python.nix (
2 { pkgs, lib, ... }:
3 {
4 name = "haste-server";
5 meta.maintainers = with lib.maintainers; [ mkg20001 ];
6
7 nodes.machine =
8 { pkgs, ... }:
9 {
10 environment.systemPackages = with pkgs; [
11 curl
12 jq
13 ];
14
15 services.haste-server = {
16 enable = true;
17 };
18 };
19
20 testScript = ''
21 machine.wait_for_unit("haste-server")
22 machine.wait_until_succeeds("curl -s localhost:7777")
23 machine.succeed('curl -s -X POST http://localhost:7777/documents -d "Hello World!" > bla')
24 machine.succeed('curl http://localhost:7777/raw/$(cat bla | jq -r .key) | grep "Hello World"')
25 '';
26 }
27)