diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index b92e76ed60af..d11e03391d94 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -347,6 +347,7 @@ in containers-unified-hierarchy = runTest ./containers-unified-hierarchy.nix; convos = runTest ./convos.nix; corerad = handleTest ./corerad.nix { }; + corteza = runTest ./corteza.nix; cosmic = runTest { imports = [ ./cosmic.nix ]; _module.args.testName = "cosmic"; diff --git a/nixos/tests/corteza.nix b/nixos/tests/corteza.nix new file mode 100644 index 000000000000..514bb5339fc8 --- /dev/null +++ b/nixos/tests/corteza.nix @@ -0,0 +1,23 @@ +{ lib, ... }: +let + port = 8080; +in +{ + name = "corteza"; + meta.maintainers = [ lib.teams.ngi.members ]; + + nodes.machine = { + services.corteza = { + enable = true; + inherit port; + }; + }; + + testScript = '' + machine.start() + + machine.wait_for_unit("default.target") + + machine.wait_until_succeeds("curl http://localhost:${toString port}/auth/login | grep button-login") + ''; +} diff --git a/pkgs/by-name/co/corteza/package.nix b/pkgs/by-name/co/corteza/package.nix index e99ec15c81f6..612a3769b835 100644 --- a/pkgs/by-name/co/corteza/package.nix +++ b/pkgs/by-name/co/corteza/package.nix @@ -5,6 +5,7 @@ callPackage, fetchFromGitHub, lib, + nixosTests, stdenvNoCC, }: @@ -161,6 +162,7 @@ stdenvNoCC.mkDerivation (finalAttrs: { passthru = { srcs = { inherit corteza-server corteza-webapp; }; + tests = { inherit (nixosTests) corteza; }; }; inherit (corteza-server) meta;