mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-27 08:04:14 +00:00
9a0ae3a604
I stopped using it, I can't test updates anymore.
42 lines
1012 B
Nix
42 lines
1012 B
Nix
import ./make-test-python.nix ({ lib, ... }: {
|
|
name = "tandoor-recipes";
|
|
meta.maintainers = with lib.maintainers; [ ];
|
|
|
|
nodes.machine = { pkgs, ... }: {
|
|
services.tandoor-recipes = {
|
|
enable = true;
|
|
extraConfig = {
|
|
DB_ENGINE = "django.db.backends.postgresql";
|
|
POSTGRES_HOST = "/run/postgresql";
|
|
POSTGRES_USER = "tandoor_recipes";
|
|
POSTGRES_DB = "tandoor_recipes";
|
|
};
|
|
};
|
|
|
|
services.postgresql = {
|
|
enable = true;
|
|
ensureDatabases = [ "tandoor_recipes" ];
|
|
ensureUsers = [
|
|
{
|
|
name = "tandoor_recipes";
|
|
ensureDBOwnership = true;
|
|
}
|
|
];
|
|
};
|
|
|
|
systemd.services = {
|
|
tandoor-recipes = {
|
|
after = [ "postgresql.service" ];
|
|
};
|
|
};
|
|
};
|
|
|
|
testScript = ''
|
|
machine.wait_for_unit("tandoor-recipes.service")
|
|
|
|
with subtest("Web interface gets ready"):
|
|
# Wait until server accepts connections
|
|
machine.wait_until_succeeds("curl -fs localhost:8080")
|
|
'';
|
|
})
|