summary refs log tree commit diff
path: root/nixos/tests
diff options
context:
space:
mode:
authorMaciej Krüger <mkg20001@gmail.com>2022-03-02 18:00:16 +0100
committerMaciej Krüger <mkg20001@gmail.com>2022-03-07 23:38:25 +0100
commitd8bae875e07d7dc43bf1bf9087bdf10f076793a0 (patch)
tree6679ec81d2103ecba9539bd939398a35005aa752 /nixos/tests
parenta1cbf8cfffc04a4cb493fa4f1c296668119ac4ca (diff)
downloadnixpkgs-d8bae875e07d7dc43bf1bf9087bdf10f076793a0.tar
nixpkgs-d8bae875e07d7dc43bf1bf9087bdf10f076793a0.tar.gz
nixpkgs-d8bae875e07d7dc43bf1bf9087bdf10f076793a0.tar.bz2
nixpkgs-d8bae875e07d7dc43bf1bf9087bdf10f076793a0.tar.lz
nixpkgs-d8bae875e07d7dc43bf1bf9087bdf10f076793a0.tar.xz
nixpkgs-d8bae875e07d7dc43bf1bf9087bdf10f076793a0.tar.zst
nixpkgs-d8bae875e07d7dc43bf1bf9087bdf10f076793a0.zip
nixosTests.haste-server: init
Diffstat (limited to 'nixos/tests')
-rw-r--r--nixos/tests/all-tests.nix1
-rw-r--r--nixos/tests/haste-server.nix23
2 files changed, 24 insertions, 0 deletions
diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix
index 342e8f461b5..f86a2fa89e6 100644
--- a/nixos/tests/all-tests.nix
+++ b/nixos/tests/all-tests.nix
@@ -193,6 +193,7 @@ in
   hadoop.hdfs = handleTestOn [ "x86_64-linux" "aarch64-linux" ] ./hadoop/hdfs.nix {};
   hadoop.yarn = handleTestOn [ "x86_64-linux" "aarch64-linux" ] ./hadoop/yarn.nix {};
   haka = handleTest ./haka.nix {};
+  haste-server = handleTest ./haste-server.nix {};
   haproxy = handleTest ./haproxy.nix {};
   hardened = handleTest ./hardened.nix {};
   hedgedoc = handleTest ./hedgedoc.nix {};
diff --git a/nixos/tests/haste-server.nix b/nixos/tests/haste-server.nix
new file mode 100644
index 00000000000..9097c992c54
--- /dev/null
+++ b/nixos/tests/haste-server.nix
@@ -0,0 +1,23 @@
+import ./make-test-python.nix ({ pkgs, lib, ... }:
+  {
+    name = "haste-server";
+    meta.maintainers = with lib.maintainers; [ mkg20001 ];
+
+    nodes.machine = { pkgs, ... }: {
+      environment.systemPackages = with pkgs; [
+        curl
+        jq
+      ];
+
+      services.haste-server = {
+        enable = true;
+      };
+    };
+
+    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"')
+    '';
+  })