2014-03-06 10:06:53 -08:00
|
|
|
# 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
|
2014-04-11 08:15:56 -07:00
|
|
|
|
2019-11-24 11:54:10 -08:00
|
|
|
import ./make-test-python.nix ({ pkgs, ...} : {
|
2014-06-28 07:04:49 -07:00
|
|
|
name = "jenkins";
|
2021-01-10 11:08:30 -08:00
|
|
|
meta = with pkgs.lib.maintainers; {
|
2019-02-22 07:14:13 -08:00
|
|
|
maintainers = [ bjornfor coconnor domenkozar eelco ];
|
2015-07-12 03:09:40 -07:00
|
|
|
};
|
2014-04-14 05:02:44 -07:00
|
|
|
|
2014-02-10 12:07:12 -08:00
|
|
|
nodes = {
|
2014-04-11 08:15:56 -07:00
|
|
|
|
|
|
|
master =
|
2018-07-20 13:56:59 -07:00
|
|
|
{ ... }:
|
2014-04-11 08:15:56 -07:00
|
|
|
{ services.jenkins.enable = true;
|
2014-03-06 10:06:53 -08:00
|
|
|
|
|
|
|
# should have no effect
|
|
|
|
services.jenkinsSlave.enable = true;
|
|
|
|
|
2018-06-29 16:55:42 -07:00
|
|
|
users.users.jenkins.extraGroups = [ "users" ];
|
2014-09-05 06:50:55 -07:00
|
|
|
|
2015-02-10 07:49:47 -08:00
|
|
|
systemd.services.jenkins.serviceConfig.TimeoutStartSec = "6min";
|
2014-03-06 10:06:53 -08:00
|
|
|
};
|
2014-04-11 08:15:56 -07:00
|
|
|
|
|
|
|
slave =
|
2018-07-20 13:56:59 -07:00
|
|
|
{ ... }:
|
2014-04-11 08:15:56 -07:00
|
|
|
{ services.jenkinsSlave.enable = true;
|
2014-03-06 10:06:53 -08:00
|
|
|
|
2018-06-29 16:55:42 -07:00
|
|
|
users.users.jenkins.extraGroups = [ "users" ];
|
2014-02-10 12:07:12 -08:00
|
|
|
};
|
2014-04-11 08:15:56 -07:00
|
|
|
|
2014-02-10 12:07:12 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
testScript = ''
|
2019-11-24 11:54:10 -08:00
|
|
|
start_all()
|
2014-02-10 12:07:12 -08:00
|
|
|
|
2019-11-24 11:54:10 -08:00
|
|
|
master.wait_for_unit("jenkins")
|
2017-12-14 07:01:09 -08:00
|
|
|
|
2019-11-24 11:54:10 -08:00
|
|
|
assert "Authentication required" in master.succeed("curl http://localhost:8080")
|
2017-12-14 07:01:09 -08:00
|
|
|
|
2019-11-24 11:54:10 -08:00
|
|
|
for host in master, slave:
|
|
|
|
groups = host.succeed("sudo -u jenkins groups")
|
|
|
|
assert "jenkins" in groups
|
|
|
|
assert "users" in groups
|
2014-03-06 10:06:53 -08:00
|
|
|
|
2019-11-24 11:54:10 -08:00
|
|
|
slave.fail("systemctl is-enabled jenkins.service")
|
2014-02-10 12:07:12 -08:00
|
|
|
'';
|
2017-12-14 07:01:09 -08:00
|
|
|
})
|