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.";