add basic test for postgresql
This commit is contained in:
parent
4b3ca4ee01
commit
3ad91bd9b5
4 changed files with 38 additions and 1 deletions
11
flake.nix
11
flake.nix
|
@ -284,6 +284,17 @@ rec {
|
|||
# Uncomment the line to build an installer image
|
||||
# This is EXTREMELY LARGE and will make builds take forever
|
||||
# installer.x86_64-linux = nixosConfigurations.installer.config.system.build.isoImage;
|
||||
tests = let
|
||||
pkgs = import nixpkgs {
|
||||
system = "x86_64-linux";
|
||||
overlays = [
|
||||
self.overlays.x86_64-linux
|
||||
args.nix-packages.overlays.x86_64-linux.default
|
||||
];
|
||||
};
|
||||
in {
|
||||
postgresql = pkgs.callPackage ./new-infra/containers/postgresql/test.nix {};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -35,6 +35,14 @@
|
|||
enable = true;
|
||||
};
|
||||
system.stateVersion = "24.05";
|
||||
systemd.tmpfiles.rules = [
|
||||
"d /persist - postgresql postgresql - -"
|
||||
"d /backup - postgresql postgresql - -"
|
||||
];
|
||||
};
|
||||
};
|
||||
systemd.tmpfiles.rules = [
|
||||
"d /persist/postgresql - - - - -"
|
||||
"d /persist/backup/postgresql - - - - -"
|
||||
];
|
||||
}
|
18
new-infra/containers/postgresql/test.nix
Normal file
18
new-infra/containers/postgresql/test.nix
Normal file
|
@ -0,0 +1,18 @@
|
|||
{pkgs ? import <nixpkgs> {}, ...}:
|
||||
pkgs.testers.runNixOSTest {
|
||||
name = "postgresql";
|
||||
|
||||
nodes.postgresql = {
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
./default.nix
|
||||
];
|
||||
system.stateVersion = "23.11";
|
||||
};
|
||||
testScript = ''
|
||||
postgresql.wait_for_unit("container@postgresql.service")
|
||||
'';
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
imports = [
|
||||
../containers/postgresql.nix # TODO
|
||||
../containers/postgresql/default.nix # TODO
|
||||
];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue