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-02-10 21:07:12 +01:00
|
|
|
{ pkgs, ... }:
|
|
|
|
{
|
|
|
|
nodes = {
|
|
|
|
master = { pkgs, config, ... }: {
|
|
|
|
services.jenkins.enable = true;
|
2014-03-06 19:06:53 +01:00
|
|
|
|
|
|
|
# should have no effect
|
|
|
|
services.jenkinsSlave.enable = true;
|
|
|
|
|
|
|
|
users.extraUsers.jenkins.extraGroups = [ "users" ];
|
|
|
|
};
|
|
|
|
slave = { pkgs, config, ... }: {
|
|
|
|
services.jenkinsSlave.enable = true;
|
|
|
|
|
|
|
|
users.extraUsers.jenkins.extraGroups = [ "users" ];
|
2014-02-10 21:07:12 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
testScript = ''
|
|
|
|
startAll;
|
|
|
|
|
|
|
|
$master->waitForUnit("jenkins");
|
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");
|
|
|
|
|
|
|
|
$slave->mustFail("systemctl status jenkins.service");
|
2014-02-10 21:07:12 +01:00
|
|
|
'';
|
|
|
|
}
|