nixpkgs/nixos/tests/web-apps/peering-manager.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

48 lines
1.4 KiB
Nix
Raw Normal View History

2022-12-01 16:32:15 +00:00
import ../make-test-python.nix (
{ lib, pkgs, ... }:
{
name = "peering-manager";
meta = with lib.maintainers; {
maintainers = [ yuka ];
};
nodes.machine =
{ ... }:
{
2022-12-01 16:32:15 +00:00
services.peering-manager = {
enable = true;
secretKeyFile = pkgs.writeText "secret" ''
abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
'';
};
};
2022-12-01 16:32:15 +00:00
testScript =
{ nodes }:
''
2022-12-01 16:32:15 +00:00
machine.start()
machine.wait_for_unit("peering-manager.target")
machine.wait_until_succeeds("journalctl --since -1m --unit peering-manager --grep Listening")
2022-12-01 16:32:15 +00:00
print(machine.succeed(
"curl -sSfL http://[::1]:8001"
))
with subtest("Home screen loads"):
machine.succeed(
"curl -sSfL http://[::1]:8001 | grep '<title>Home - Peering Manager</title>'"
)
with subtest("checks succeed"):
machine.succeed(
"systemctl stop peering-manager peering-manager-rq"
)
machine.succeed(
"sudo -u postgres psql -c 'ALTER USER \"peering-manager\" WITH SUPERUSER;'"
)
machine.succeed(
"cd ${nodes.machine.system.build.peeringManagerPkg}/opt/peering-manager ; peering-manager-manage test --no-input"
2022-12-01 16:32:15 +00:00
)
'';
}
)