2014-03-06 19:06:53 +01: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 17:15:56 +02:00
|
|
|
|
2015-07-12 12:09:40 +02:00
|
|
|
import ./make-test.nix ({ pkgs, ...} : {
|
2014-06-28 16:04:49 +02:00
|
|
|
name = "jenkins";
|
2015-07-12 12:09:40 +02:00
|
|
|
meta = with pkgs.stdenv.lib.maintainers; {
|
2019-02-22 16:14:13 +01:00
|
|
|
maintainers = [ bjornfor coconnor domenkozar eelco ];
|
2015-07-12 12:09:40 +02:00
|
|
|
};
|
2014-04-14 14:02:44 +02:00
|
|
|
|
2014-02-10 21:07:12 +01:00
|
|
|
nodes = {
|
2014-04-11 17:15:56 +02:00
|
|
|
|
|
|
|
master =
|
2018-07-20 22:56:59 +02:00
|
|
|
{ ... }:
|
2014-04-11 17:15:56 +02:00
|
|
|
{ services.jenkins.enable = true;
|
2014-03-06 19:06:53 +01:00
|
|
|
|
|
|
|
# should have no effect
|
|
|
|
services.jenkinsSlave.enable = true;
|
|
|
|
|
2018-06-30 01:55:42 +02:00
|
|
|
users.users.jenkins.extraGroups = [ "users" ];
|
2014-09-05 15:50:55 +02:00
|
|
|
|
2015-02-10 16:49:47 +01:00
|
|
|
systemd.services.jenkins.serviceConfig.TimeoutStartSec = "6min";
|
2014-03-06 19:06:53 +01:00
|
|
|
};
|
2014-04-11 17:15:56 +02:00
|
|
|
|
|
|
|
slave =
|
2018-07-20 22:56:59 +02:00
|
|
|
{ ... }:
|
2014-04-11 17:15:56 +02:00
|
|
|
{ services.jenkinsSlave.enable = true;
|
2014-03-06 19:06:53 +01:00
|
|
|
|
2018-06-30 01:55:42 +02:00
|
|
|
users.users.jenkins.extraGroups = [ "users" ];
|
2014-02-10 21:07:12 +01:00
|
|
|
};
|
2014-04-11 17:15:56 +02:00
|
|
|
|
2014-02-10 21:07:12 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
testScript = ''
|
|
|
|
startAll;
|
|
|
|
|
|
|
|
$master->waitForUnit("jenkins");
|
2017-12-14 16:01:09 +01:00
|
|
|
|
|
|
|
$master->mustSucceed("curl http://localhost:8080 | grep 'Authentication required'");
|
|
|
|
|
2014-03-06 19:06:53 +01:00
|
|
|
print $master->execute("sudo -u jenkins groups");
|
|
|
|
$master->mustSucceed("sudo -u jenkins groups | grep jenkins | grep users");
|
|
|
|
|
|
|
|
print $slave->execute("sudo -u jenkins groups");
|
|
|
|
$slave->mustSucceed("sudo -u jenkins groups | grep jenkins | grep users");
|
|
|
|
|
2014-05-11 21:56:03 +02:00
|
|
|
$slave->mustFail("systemctl is-enabled jenkins.service");
|
2014-02-10 21:07:12 +01:00
|
|
|
'';
|
2017-12-14 16:01:09 +01:00
|
|
|
})
|