mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-21 13:10:33 +00:00
25bef2d8f9
The library does not depend on stdenv, that `stdenv` exposes `lib` is an artifact of the ancient origins of nixpkgs.
50 lines
1.1 KiB
Nix
50 lines
1.1 KiB
Nix
# verifies:
|
|
# 1. jenkins service starts on master node
|
|
# 2. jenkins user can be extended on both master and slave
|
|
# 3. jenkins service not started on slave node
|
|
|
|
import ./make-test-python.nix ({ pkgs, ...} : {
|
|
name = "jenkins";
|
|
meta = with pkgs.lib.maintainers; {
|
|
maintainers = [ bjornfor coconnor domenkozar eelco ];
|
|
};
|
|
|
|
nodes = {
|
|
|
|
master =
|
|
{ ... }:
|
|
{ services.jenkins.enable = true;
|
|
|
|
# should have no effect
|
|
services.jenkinsSlave.enable = true;
|
|
|
|
users.users.jenkins.extraGroups = [ "users" ];
|
|
|
|
systemd.services.jenkins.serviceConfig.TimeoutStartSec = "6min";
|
|
};
|
|
|
|
slave =
|
|
{ ... }:
|
|
{ services.jenkinsSlave.enable = true;
|
|
|
|
users.users.jenkins.extraGroups = [ "users" ];
|
|
};
|
|
|
|
};
|
|
|
|
testScript = ''
|
|
start_all()
|
|
|
|
master.wait_for_unit("jenkins")
|
|
|
|
assert "Authentication required" in master.succeed("curl http://localhost:8080")
|
|
|
|
for host in master, slave:
|
|
groups = host.succeed("sudo -u jenkins groups")
|
|
assert "jenkins" in groups
|
|
assert "users" in groups
|
|
|
|
slave.fail("systemctl is-enabled jenkins.service")
|
|
'';
|
|
})
|