diff options
| author | Leona Maroni <dev@leona.is> | 2025-03-14 16:44:34 +0100 |
|---|---|---|
| committer | github-actions[bot] <github-actions[bot]@users.noreply.github.com> | 2025-04-21 16:39:48 +0000 |
| commit | 19c1277a6a2e74c10bd02cab2aaa99b31ce568da (patch) | |
| tree | 191384258ad66b4068685ee078a05c4a24861cd0 | |
| parent | nixos/gitlab: convert gitlab-registry-cert.service to oneshot (diff) | |
| download | nixpkgs-origin/backport-390623-to-release-24.11.tar.gz | |
nixosTests.gitlab: add minimal test for gitlab-container-registryorigin/backport-390623-to-release-24.11
(cherry picked from commit cd7583a7d91ffedf4a69a97e9cf9286b3fc2ef34)
| -rw-r--r-- | nixos/tests/gitlab.nix | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/nixos/tests/gitlab.nix b/nixos/tests/gitlab.nix index da27cfbbc195..b04c93ea03aa 100644 --- a/nixos/tests/gitlab.nix +++ b/nixos/tests/gitlab.nix @@ -42,6 +42,10 @@ in environment.systemPackages = with pkgs; [ git ]; + networking.hosts."127.0.0.1" = [ + "registry.localhost" + "pages.localhost" + ]; virtualisation.memorySize = 6144; virtualisation.cores = 4; virtualisation.useNixStoreImage = true; @@ -59,6 +63,12 @@ in localhost = { locations."/".proxyPass = "http://unix:/run/gitlab/gitlab-workhorse.socket"; }; + "pages.localhost" = { + locations."/".proxyPass = "http://localhost:8090"; + }; + "registry.localhost" = { + locations."/".proxyPass = "http://localhost:4567"; + }; }; }; @@ -78,7 +88,7 @@ in smtp.enable = true; pages = { enable = true; - settings.pages-domain = "localhost"; + settings.pages-domain = "pages.localhost"; }; extraConfig = { incoming_email = { @@ -98,6 +108,14 @@ in jwsFile = pkgs.runCommand "oidcKeyBase" { } "${pkgs.openssl}/bin/openssl genrsa 2048 > $out"; }; + registry = { + enable = true; + certFile = "/var/lib/gitlab/registry_auth_cert"; + keyFile = "/var/lib/gitlab/registry_auth_key"; + externalAddress = "registry.localhost"; + externalPort = 443; + }; + # reduce memory usage sidekiq.concurrency = 1; puma.workers = 2; @@ -210,6 +228,7 @@ in gitlab.wait_for_unit("gitlab-sidekiq.service") gitlab.wait_for_file("${nodes.gitlab.services.gitlab.statePath}/tmp/sockets/gitlab.socket") gitlab.wait_until_succeeds("curl -sSf http://gitlab/users/sign_in") + gitlab.wait_for_unit("docker-registry.service") ''; # The actual test of GitLab. Only push data to GitLab if @@ -447,6 +466,10 @@ in """ ) gitlab.succeed("test -s /tmp/archive.tar.bz2") + '' + + '' + with subtest("Test docker registry http is available"): + gitlab.succeed("curl -sSf http://registry.localhost") ''; in |
