mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-15 09:03:48 +00:00
c894327215
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.
40 lines
1 KiB
Nix
40 lines
1 KiB
Nix
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");
|
|
'';
|
|
})
|