vuls: init at 0.27.0
[NixPkgs.git] / nixos / tests / gerrit.nix
blob8ae9e89cf6b0c81bb5f51704fb76b8ce12d62120
1 import ./make-test-python.nix ({ pkgs, ... }:
3 let
4   lfs = pkgs.fetchurl {
5     url = "https://gerrit-ci.gerritforge.com/job/plugin-lfs-bazel-master/90/artifact/bazel-bin/plugins/lfs/lfs.jar";
6     sha256 = "023b0kd8djm3cn1lf1xl67yv3j12yl8bxccn42lkfmwxjwjfqw6h";
7   };
9 in {
10   name = "gerrit";
12   meta = with pkgs.lib.maintainers; {
13     maintainers = [ flokli zimbatm ];
14   };
16   nodes = {
17     server =
18       { config, pkgs, ... }: {
19         networking.firewall.allowedTCPPorts = [ 80 2222 ];
22         services.gerrit = {
23           enable = true;
24           serverId = "aa76c84b-50b0-4711-a0a0-1ee30e45bbd0";
25           listenAddress = "[::]:80";
26           jvmHeapLimit = "1g";
28           plugins = [ lfs ];
29           builtinPlugins = [ "hooks" "webhooks" ];
30           settings = {
31             gerrit.canonicalWebUrl = "http://server";
32             lfs.plugin = "lfs";
33             plugins.allowRemoteAdmin = true;
34             sshd.listenAddress = "[::]:2222";
35             sshd.advertisedAddress = "[::]:2222";
36           };
37         };
38       };
40     client =
41       { ... }: {
42       };
43   };
45   testScript = ''
46     start_all()
47     server.wait_for_unit("gerrit.service")
48     server.wait_for_open_port(80)
49     client.succeed("curl http://server")
51     server.wait_for_open_port(2222)
52     client.succeed("nc -z server 2222")
53   '';