summary refs log tree commit diff
path: root/nixos/tests/pgmanage.nix
diff options
context:
space:
mode:
authorBas van Dijk <v.dijk.bas@gmail.com>2017-11-02 20:35:05 +0100
committerBas van Dijk <v.dijk.bas@gmail.com>2017-11-03 00:14:00 +0100
commitc8943272153d1ad5c7dd1329bf0045f2834d52dd (patch)
tree49ebd22141a87c9fce11f5a918e2c87307baced3 /nixos/tests/pgmanage.nix
parent37c7bb42668949ebd0cddf3d85458db8763900f5 (diff)
downloadnixpkgs-c8943272153d1ad5c7dd1329bf0045f2834d52dd.tar
nixpkgs-c8943272153d1ad5c7dd1329bf0045f2834d52dd.tar.gz
nixpkgs-c8943272153d1ad5c7dd1329bf0045f2834d52dd.tar.bz2
nixpkgs-c8943272153d1ad5c7dd1329bf0045f2834d52dd.tar.lz
nixpkgs-c8943272153d1ad5c7dd1329bf0045f2834d52dd.tar.xz
nixpkgs-c8943272153d1ad5c7dd1329bf0045f2834d52dd.tar.zst
nixpkgs-c8943272153d1ad5c7dd1329bf0045f2834d52dd.zip
postage: replaced by pgmanage-10.0.2
postage is no longer maintained and has been replaced by the identical pgmanage. See:

https://github.com/workflowproducts/postage#postage-has-been-replaced-with-pgmanage

The following error is raised when a user enables the deprecated `services.postage.enable` option:

Failed assertions:
- services.postage is deprecated in favor of pgmanage. They have the same options so just substitute postage for pgmanage.
Diffstat (limited to 'nixos/tests/pgmanage.nix')
-rw-r--r--nixos/tests/pgmanage.nix39
1 files changed, 39 insertions, 0 deletions
diff --git a/nixos/tests/pgmanage.nix b/nixos/tests/pgmanage.nix
new file mode 100644
index 00000000000..110cbd5c5b4
--- /dev/null
+++ b/nixos/tests/pgmanage.nix
@@ -0,0 +1,39 @@
+import ./make-test.nix ({ pkgs, ... } :
+let
+  role     = "test";
+  password = "secret";
+  conn     = "local";
+in
+{
+  name = "pgmanage";
+  meta = with pkgs.stdenv.lib.maintainers; {
+    maintainers = [ basvandijk ];
+  };
+  nodes = {
+    one = { config, pkgs, ... }: {
+      services = {
+        postgresql = {
+          enable = true;
+          initialScript = pkgs.writeText "pg-init-script" ''
+            CREATE ROLE ${role} SUPERUSER LOGIN PASSWORD '${password}';
+          '';
+        };
+        pgmanage = {
+          enable = true;
+          connections = {
+            "${conn}" = "hostaddr=127.0.0.1 port=${toString config.services.postgresql.port} dbname=postgres";
+          };
+        };
+      };
+    };
+  };
+
+  testScript = ''
+    startAll;
+    $one->waitForUnit("default.target");
+    $one->requireActiveUnit("pgmanage.service");
+
+    # Test if we can log in.
+    $one->waitUntilSucceeds("curl 'http://localhost:8080/pgmanage/auth' --data 'action=login&connname=${conn}&username=${role}&password=${password}' --fail");
+  '';
+})