summary refs log tree commit diff
diff options
context:
space:
mode:
authorDavHau <hsngrmpf+github@gmail.com>2021-08-10 13:04:07 +0200
committerRaphael Megzari <raphael@megzari.com>2021-08-11 11:04:39 +0900
commitdf0f76b39ff419136f742e300eb7c07cc83bd54f (patch)
treecf1a0fbbcaad09c597c8cb07c3752ec1ea83a9e8
parent6e59bc79696bc826fdbf6821c0e0eccad93703db (diff)
downloadnixpkgs-df0f76b39ff419136f742e300eb7c07cc83bd54f.tar
nixpkgs-df0f76b39ff419136f742e300eb7c07cc83bd54f.tar.gz
nixpkgs-df0f76b39ff419136f742e300eb7c07cc83bd54f.tar.bz2
nixpkgs-df0f76b39ff419136f742e300eb7c07cc83bd54f.tar.lz
nixpkgs-df0f76b39ff419136f742e300eb7c07cc83bd54f.tar.xz
nixpkgs-df0f76b39ff419136f742e300eb7c07cc83bd54f.tar.zst
nixpkgs-df0f76b39ff419136f742e300eb7c07cc83bd54f.zip
cryptpad: add test for nixos module
-rw-r--r--nixos/tests/all-tests.nix1
-rw-r--r--nixos/tests/cryptpad.nix18
-rw-r--r--pkgs/servers/web-apps/cryptpad/default.nix3
3 files changed, 22 insertions, 0 deletions
diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix
index 30c1c77c6c9..8369f60e7b2 100644
--- a/nixos/tests/all-tests.nix
+++ b/nixos/tests/all-tests.nix
@@ -94,6 +94,7 @@ in
   cri-o = handleTestOn ["x86_64-linux"] ./cri-o.nix {};
   custom-ca = handleTest ./custom-ca.nix {};
   croc = handleTest ./croc.nix {};
+  cryptpad = handleTest ./cryptpad.nix {};
   deluge = handleTest ./deluge.nix {};
   dendrite = handleTest ./dendrite.nix {};
   dhparams = handleTest ./dhparams.nix {};
diff --git a/nixos/tests/cryptpad.nix b/nixos/tests/cryptpad.nix
new file mode 100644
index 00000000000..895f291abac
--- /dev/null
+++ b/nixos/tests/cryptpad.nix
@@ -0,0 +1,18 @@
+import ./make-test-python.nix ({ lib, ... }:
+
+with lib;
+
+{
+  name = "cryptpad";
+  meta.maintainers = with maintainers; [ davhau ];
+
+  nodes.machine =
+    { pkgs, ... }:
+    { services.cryptpad.enable = true; };
+
+  testScript = ''
+    machine.wait_for_unit("cryptpad.service")
+    machine.wait_for_open_port("3000")
+    machine.succeed("curl -L --fail http://localhost:3000/sheet")
+  '';
+})
diff --git a/pkgs/servers/web-apps/cryptpad/default.nix b/pkgs/servers/web-apps/cryptpad/default.nix
index 0d655ac5322..88c9b30b1bb 100644
--- a/pkgs/servers/web-apps/cryptpad/default.nix
+++ b/pkgs/servers/web-apps/cryptpad/default.nix
@@ -72,6 +72,9 @@ let
       EOF
       chmod +x $out/bin/cryptpad
     '';
+
+    meta.maintainers = with lib.maintainers; [ davhau ];
+
   };
 in
   combined