postgresql.tests.postgresql.postgresql-backup-all: fix random dump
The new `\restrict` migitation creates random keys in the dump file by default, which breaks a before/after test for the backup module. By making the restrict key reproducible, the test passes again.
This commit is contained in:
@@ -124,10 +124,7 @@ in
|
|||||||
type = lib.types.separatedString " ";
|
type = lib.types.separatedString " ";
|
||||||
default = "-C";
|
default = "-C";
|
||||||
description = ''
|
description = ''
|
||||||
Command line options for pg_dump. This options is not used
|
Command line options for pg_dump or pg_dumpall.
|
||||||
if `config.services.postgresqlBackup.backupAll` is enabled.
|
|
||||||
Note that config.services.postgresqlBackup.backupAll is also active,
|
|
||||||
when no databases where specified.
|
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -177,7 +174,7 @@ in
|
|||||||
];
|
];
|
||||||
})
|
})
|
||||||
(lib.mkIf (cfg.enable && cfg.backupAll) {
|
(lib.mkIf (cfg.enable && cfg.backupAll) {
|
||||||
systemd.services.postgresqlBackup = postgresqlBackupService "all" "pg_dumpall";
|
systemd.services.postgresqlBackup = postgresqlBackupService "all" "pg_dumpall ${cfg.pgdumpOptions}";
|
||||||
})
|
})
|
||||||
(lib.mkIf (cfg.enable && !cfg.backupAll) {
|
(lib.mkIf (cfg.enable && !cfg.backupAll) {
|
||||||
systemd.services = lib.listToAttrs (
|
systemd.services = lib.listToAttrs (
|
||||||
|
|||||||
@@ -65,6 +65,7 @@ let
|
|||||||
services.postgresqlBackup = {
|
services.postgresqlBackup = {
|
||||||
enable = true;
|
enable = true;
|
||||||
databases = lib.optional (!backupAll) "postgres";
|
databases = lib.optional (!backupAll) "postgres";
|
||||||
|
pgdumpOptions = "--restrict-key=ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user