about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorMartin Weinelt <hexa@darmstadt.ccc.de>2024-03-14 12:43:39 +0100
committerMartin Weinelt <hexa@darmstadt.ccc.de>2024-03-16 14:50:57 +0100
commita01acbcefe650e830857ad402dad36d6045de090 (patch)
tree3787bd9f7c0c149cad030f4783631302b3afac49 /nixos
parentb05a529fd6eadeccc2b6350201a379af2344fbc8 (diff)
downloadnixlib-a01acbcefe650e830857ad402dad36d6045de090.tar
nixlib-a01acbcefe650e830857ad402dad36d6045de090.tar.gz
nixlib-a01acbcefe650e830857ad402dad36d6045de090.tar.bz2
nixlib-a01acbcefe650e830857ad402dad36d6045de090.tar.lz
nixlib-a01acbcefe650e830857ad402dad36d6045de090.tar.xz
nixlib-a01acbcefe650e830857ad402dad36d6045de090.tar.zst
nixlib-a01acbcefe650e830857ad402dad36d6045de090.zip
nixos/tests/pretix: init
Diffstat (limited to 'nixos')
-rw-r--r--nixos/tests/all-tests.nix1
-rw-r--r--nixos/tests/web-apps/pretix.nix47
2 files changed, 48 insertions, 0 deletions
diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix
index 6726b9071ef6..bdd4130f241a 100644
--- a/nixos/tests/all-tests.nix
+++ b/nixos/tests/all-tests.nix
@@ -729,6 +729,7 @@ in {
   pppd = handleTest ./pppd.nix {};
   predictable-interface-names = handleTest ./predictable-interface-names.nix {};
   pretalx = runTest ./web-apps/pretalx.nix;
+  pretix = runTest ./web-apps/pretix.nix;
   printing-socket = handleTest ./printing.nix { socket = true; };
   printing-service = handleTest ./printing.nix { socket = false; };
   privoxy = handleTest ./privoxy.nix {};
diff --git a/nixos/tests/web-apps/pretix.nix b/nixos/tests/web-apps/pretix.nix
new file mode 100644
index 000000000000..559316f9b85c
--- /dev/null
+++ b/nixos/tests/web-apps/pretix.nix
@@ -0,0 +1,47 @@
+{
+  lib,
+  pkgs,
+  ...
+}:
+
+{
+  name = "pretix";
+  meta.maintainers = with lib.maintainers; [ hexa ];
+
+  nodes = {
+    pretix = {
+      networking.extraHosts = ''
+        127.0.0.1 tickets.local
+      '';
+
+      services.pretix = {
+        enable = true;
+        nginx.domain = "tickets.local";
+        plugins = with pkgs.pretix.plugins; [
+          passbook
+          pages
+        ];
+        settings = {
+          pretix = {
+            instance_name = "NixOS Test";
+            url = "http://tickets.local";
+          };
+          mail.from = "hello@tickets.local";
+        };
+      };
+    };
+  };
+
+  testScript = ''
+    start_all()
+
+    pretix.wait_for_unit("pretix-web.service")
+    pretix.wait_for_unit("pretix-worker.service")
+
+    pretix.wait_until_succeeds("curl -q --fail http://tickets.local")
+
+    pretix.succeed("pretix-manage --help")
+
+    pretix.log(pretix.succeed("systemd-analyze security pretix-web.service"))
+  '';
+}