1 import ../make-test-python.nix ({ lib, pkgs, ... }: {
2 name = "peering-manager";
4 meta = with lib.maintainers; {
5 maintainers = [ yuka ];
8 nodes.machine = { ... }: {
9 services.peering-manager = {
11 secretKeyFile = pkgs.writeText "secret" ''
12 abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
17 testScript = { nodes }: ''
19 machine.wait_for_unit("peering-manager.target")
20 machine.wait_until_succeeds("journalctl --since -1m --unit peering-manager --grep Listening")
22 print(machine.succeed(
23 "curl -sSfL http://[::1]:8001"
25 with subtest("Home screen loads"):
27 "curl -sSfL http://[::1]:8001 | grep '<title>Home - Peering Manager</title>'"
29 with subtest("checks succeed"):
31 "systemctl stop peering-manager peering-manager-rq"
34 "sudo -u postgres psql -c 'ALTER USER \"peering-manager\" WITH SUPERUSER;'"
37 "cd ${nodes.machine.system.build.peeringManagerPkg}/opt/peering-manager ; peering-manager-manage test --no-input"