about summary refs log tree commit diff
path: root/nixos/tests
diff options
context:
space:
mode:
authorTaeer Bar-Yam <taeer@bar-yam.me>2022-02-02 06:23:43 -0500
committerTaeer Bar-Yam <taeer@bar-yam.me>2022-02-23 10:41:25 -0500
commite662b519a260b2085d58478e34afbcc4ecb2e40d (patch)
treec6eadb3ae606d81be68a94d6fef38d2f5d95fe2e /nixos/tests
parent9bc86d946b4447e9c138ff80e786ec1c50ca78b7 (diff)
downloadnixlib-e662b519a260b2085d58478e34afbcc4ecb2e40d.tar
nixlib-e662b519a260b2085d58478e34afbcc4ecb2e40d.tar.gz
nixlib-e662b519a260b2085d58478e34afbcc4ecb2e40d.tar.bz2
nixlib-e662b519a260b2085d58478e34afbcc4ecb2e40d.tar.lz
nixlib-e662b519a260b2085d58478e34afbcc4ecb2e40d.tar.xz
nixlib-e662b519a260b2085d58478e34afbcc4ecb2e40d.tar.zst
nixlib-e662b519a260b2085d58478e34afbcc4ecb2e40d.zip
zammad: add module test
Diffstat (limited to 'nixos/tests')
-rw-r--r--nixos/tests/all-tests.nix1
-rw-r--r--nixos/tests/zammad/default.nix27
-rw-r--r--nixos/tests/zammad/test_secrets2
3 files changed, 30 insertions, 0 deletions
diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix
index c9c39e792514..d348c2b0e91f 100644
--- a/nixos/tests/all-tests.nix
+++ b/nixos/tests/all-tests.nix
@@ -571,6 +571,7 @@ in
   xxh = handleTest ./xxh.nix {};
   yabar = handleTest ./yabar.nix {};
   yggdrasil = handleTest ./yggdrasil.nix {};
+  zammad = handleTest ./zammad {};
   zfs = handleTest ./zfs.nix {};
   zigbee2mqtt = handleTest ./zigbee2mqtt.nix {};
   zoneminder = handleTest ./zoneminder.nix {};
diff --git a/nixos/tests/zammad/default.nix b/nixos/tests/zammad/default.nix
new file mode 100644
index 000000000000..53b7ef0e30c5
--- /dev/null
+++ b/nixos/tests/zammad/default.nix
@@ -0,0 +1,27 @@
+import ./make-test-python.nix (
+  { lib, ... }:
+
+    {
+      name = "zammad";
+
+      meta.maintainers = with lib.maintainers; [ garbas ];
+
+      nodes.machine = {
+        services.zammad.enable = true;
+        services.zammad.secretsFile = "${./test_secrets}";
+      };
+
+      testScript = ''
+        start_all()
+        machine.wait_for_unit("postgresql.service")
+        machine.wait_for_unit("zammad-web.service")
+        machine.wait_for_unit("zammad-websocket.service")
+        machine.wait_for_unit("zammad-scheduler.service")
+        # without the grep the command does not produce valid utf-8 for some reason
+        with subtest("welcome screen loads"):
+            machine.succeed(
+                "curl -sSfL http://localhost:3000/ | grep '<title>Zammad Helpdesk</title>'"
+            )
+      '';
+    }
+)
diff --git a/nixos/tests/zammad/test_secrets b/nixos/tests/zammad/test_secrets
new file mode 100644
index 000000000000..a5da713d5cf8
--- /dev/null
+++ b/nixos/tests/zammad/test_secrets
@@ -0,0 +1,2 @@
+PGPASSWORD=12345
+SECRET_KEY_BASE=52882ef142066e09ab99ce816ba72522e789505caba224a52d750ec7dc872c2c371b2fd19f16b25dfbdd435a4dd46cb3df9f82eb63fafad715056bdfe25740d6