Add params and tests for CentOS and RedHat.

This commit is contained in:
matt.cover 2015-10-30 12:35:51 -07:00
parent 3274f6583a
commit 026b1a310c
2 changed files with 33 additions and 13 deletions

View File

@ -27,11 +27,21 @@ class nslcd::params {
$config = $default_config
$package_name = $default_package_name
$service_name = $default_service_name
$uid = 'nslcd'
$gid = 'nslcd'
$config_user = 'root'
$config_group = 'nslcd'
$config_mode = '0640'
$uid = 'nslcd'
$gid = 'nslcd'
$config_user = 'root'
$config_group = 'nslcd'
$config_mode = '0640'
}
RedHat: {
$config = $default_config
$package_name = 'nss-pam-ldapd'
$service_name = $default_service_name
$uid = 'nslcd'
$gid = 'ldap'
$config_user = 'root'
$config_group = 'root'
$config_mode = '0600'
}
default: {
fail("The ${module_name} module is not supported on an ${::osfamily} based system.")

View File

@ -2,13 +2,14 @@ require 'spec_helper'
describe 'nslcd' do
{'Ubuntu' => 'Debian', 'Debian' => 'Debian'}.each do |system, family|
{'Ubuntu' => 'Debian', 'Debian' => 'Debian', 'CentOS' => 'RedHat', 'RedHat' => 'RedHat' }.each do |system, family|
context "when on system #{system}" do
let :facts do
{
facts = {
:osfamily => family,
:operatingsystem => system,
}
}
let :facts do
facts
end
it { should contain_class('nslcd') }
@ -16,10 +17,19 @@ describe 'nslcd' do
it { should contain_class('nslcd::config') }
it { should contain_class('nslcd::service') }
it {
should contain_package('nslcd')
should contain_service('nslcd')
}
case facts[:osfamily]
when 'Debian'
it {
should contain_package('nslcd')
should contain_service('nslcd')
}
when 'RedHat'
it {
should contain_package('nss-pam-ldapd')
should contain_service('nslcd')
}
end
end
end