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