about summary refs log tree commit diff
path: root/nixos/tests/jenkins-cli.nix
blob: f25e1604da330a7e29db32d773013b42a517bdbf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import ./make-test-python.nix ({ pkgs, ...} : rec {
  name = "jenkins-cli";
  meta = with pkgs.lib.maintainers; {
    maintainers = [ pamplemousse ];
  };

  nodes = {
    machine =
      { ... }:
      {
        services.jenkins = {
          enable = true;
          withCLI = true;
        };
      };
  };

  testScript = ''
    start_all()

    machine.wait_for_unit("jenkins")

    assert "JENKINS_URL" in machine.succeed("env")
    assert "http://0.0.0.0:8080" in machine.succeed("echo $JENKINS_URL")

    machine.succeed(
        "jenkins-cli -auth admin:$(cat /var/lib/jenkins/secrets/initialAdminPassword)"
    )
  '';
})