2022-04-03 18:54:34 +00:00
|
|
|
import ../make-test-python.nix ({ lib, pkgs, ... }: {
|
|
|
|
name = "netbox";
|
|
|
|
|
|
|
|
meta = with lib.maintainers; {
|
|
|
|
maintainers = [ n0emis ];
|
|
|
|
};
|
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
nodes.machine = { ... }: {
|
2022-04-03 18:54:34 +00:00
|
|
|
services.netbox = {
|
|
|
|
enable = true;
|
|
|
|
secretKeyFile = pkgs.writeText "secret" ''
|
|
|
|
abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
testScript = ''
|
|
|
|
machine.start()
|
|
|
|
machine.wait_for_unit("netbox.target")
|
|
|
|
machine.wait_until_succeeds("journalctl --since -1m --unit netbox --grep Listening")
|
|
|
|
|
|
|
|
with subtest("Home screen loads"):
|
|
|
|
machine.succeed(
|
|
|
|
"curl -sSfL http://[::1]:8001 | grep '<title>Home | NetBox</title>'"
|
|
|
|
)
|
|
|
|
|
|
|
|
with subtest("Staticfiles are generated"):
|
|
|
|
machine.succeed("test -e /var/lib/netbox/static/netbox.js")
|
|
|
|
'';
|
|
|
|
})
|