1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-18 11:40:45 +00:00
nixpkgs/nixos/tests/web-apps/netbox.nix
2022-04-19 17:52:09 +02:00

31 lines
811 B
Nix

import ../make-test-python.nix ({ lib, pkgs, ... }: {
name = "netbox";
meta = with lib.maintainers; {
maintainers = [ n0emis ];
};
nodes.machine = { ... }: {
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")
'';
})