diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index cb6089983f8c..ffccb6b44660 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -341,6 +341,7 @@ in networking.networkd = handleTest ./networking.nix { networkd = true; }; networking.scripted = handleTest ./networking.nix { networkd = false; }; specialisation = handleTest ./specialisation.nix {}; + netbox = handleTest ./web-apps/netbox.nix {}; # TODO: put in networking.nix after the test becomes more complete networkingProxy = handleTest ./networking-proxy.nix {}; nextcloud = handleTest ./nextcloud {}; diff --git a/nixos/tests/web-apps/netbox.nix b/nixos/tests/web-apps/netbox.nix new file mode 100644 index 000000000000..95f24029ec92 --- /dev/null +++ b/nixos/tests/web-apps/netbox.nix @@ -0,0 +1,30 @@ +import ../make-test-python.nix ({ lib, pkgs, ... }: { + name = "netbox"; + + meta = with lib.maintainers; { + maintainers = [ n0emis ]; + }; + + 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 '