From 2a06cac30ae8f253aceaea0cb8e0428d2a7c5bfc Mon Sep 17 00:00:00 2001 From: Savyasachee Jha Date: Sun, 29 Sep 2024 22:57:42 +0530 Subject: [PATCH] nixos/tests/privatebin: init --- nixos/tests/all-tests.nix | 1 + nixos/tests/privatebin.nix | 21 +++++++++++++++++++++ pkgs/by-name/pr/privatebin/package.nix | 2 ++ 3 files changed, 24 insertions(+) create mode 100644 nixos/tests/privatebin.nix diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index a625cd92e236..d551066fc609 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -818,6 +818,7 @@ in { printing-socket = handleTest ./printing.nix { socket = true; }; printing-service = handleTest ./printing.nix { socket = false; }; private-gpt = handleTest ./private-gpt.nix {}; + privatebin = runTest ./privatebin.nix; privoxy = handleTest ./privoxy.nix {}; prometheus = handleTest ./prometheus {}; prometheus-exporters = handleTest ./prometheus-exporters.nix {}; diff --git a/nixos/tests/privatebin.nix b/nixos/tests/privatebin.nix new file mode 100644 index 000000000000..c920b6220084 --- /dev/null +++ b/nixos/tests/privatebin.nix @@ -0,0 +1,21 @@ +{ lib, ... }: + +{ + name = "privatebin"; + meta.maintainers = [ lib.maintainers.savyajha ]; + + nodes.dataImporter = + { ... }: + { + services.privatebin = { + enable = true; + enableNginx = true; + }; + }; + + testScript = '' + dataImporter.wait_for_unit("phpfpm-privatebin.service") + dataImporter.wait_for_unit("nginx.service") + dataImporter.succeed("curl -fvvv -Ls http://localhost/ | grep 'PrivateBin'") + ''; +} diff --git a/pkgs/by-name/pr/privatebin/package.nix b/pkgs/by-name/pr/privatebin/package.nix index 61fc7937b627..a6508f53badb 100644 --- a/pkgs/by-name/pr/privatebin/package.nix +++ b/pkgs/by-name/pr/privatebin/package.nix @@ -22,6 +22,8 @@ stdenvNoCC.mkDerivation (finalAttrs: { runHook postInstall ''; + passthru.tests = nixosTests.privatebin; + meta = { changelog = "https://github.com/PrivateBin/PrivateBin/releases/tag/${finalAttrs.version}"; description = "Minimalist, open source online pastebin where the server has zero knowledge of pasted data.";