2014-03-06 22:06:53 +04: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 19:15:56 +04:00
|
|
|
|
2015-07-12 13:09:40 +03:00
|
|
|
import ./make-test.nix ({ pkgs, ...} : {
|
2014-06-28 18:04:49 +04:00
|
|
|
name = "jenkins";
|
2015-07-12 13:09:40 +03:00
|
|
|
meta = with pkgs.stdenv.lib.maintainers; {
|
2016-05-17 14:57:28 +03:00
|
|
|
maintainers = [ bjornfor coconnor domenkozar eelco chaoflow ];
|
2015-07-12 13:09:40 +03:00
|
|
|
};
|
2014-04-14 16:02:44 +04:00
|
|
|
|
2014-02-11 00:07:12 +04:00
|
|
|
nodes = {
|
2014-04-11 19:15:56 +04:00
|
|
|
|
|
|
|
master =
|
|
|
|
{ config, pkgs, ... }:
|
|
|
|
{ services.jenkins.enable = true;
|
2014-03-06 22:06:53 +04:00
|
|
|
|
|
|
|
# should have no effect
|
|
|
|
services.jenkinsSlave.enable = true;
|
|
|
|
|
|
|
|
users.extraUsers.jenkins.extraGroups = [ "users" ];
|
2014-09-05 17:50:55 +04:00
|
|
|
|
2015-02-10 18:49:47 +03:00
|
|
|
systemd.services.jenkins.serviceConfig.TimeoutStartSec = "6min";
|
2014-03-06 22:06:53 +04:00
|
|
|
};
|
2014-04-11 19:15:56 +04:00
|
|
|
|
|
|
|
slave =
|
|
|
|
{ config, pkgs, ... }:
|
|
|
|
{ services.jenkinsSlave.enable = true;
|
2014-03-06 22:06:53 +04:00
|
|
|
|
|
|
|
users.extraUsers.jenkins.extraGroups = [ "users" ];
|
2014-02-11 00:07:12 +04:00
|
|
|
};
|
2014-04-11 19:15:56 +04:00
|
|
|
|
2014-02-11 00:07:12 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
testScript = ''
|
|
|
|
startAll;
|
|
|
|
|
|
|
|
$master->waitForUnit("jenkins");
|
2014-03-06 22:06:53 +04: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 23:56:03 +04:00
|
|
|
$slave->mustFail("systemctl is-enabled jenkins.service");
|
2014-02-11 00:07:12 +04:00
|
|
|
'';
|
2015-07-12 13:09:40 +03:00
|
|
|
})
|