2015-04-16 18:04:30 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe 'nslcd' do
|
|
|
|
|
2015-10-30 15:35:51 -04:00
|
|
|
{'Ubuntu' => 'Debian', 'Debian' => 'Debian', 'CentOS' => 'RedHat', 'RedHat' => 'RedHat' }.each do |system, family|
|
2015-04-16 18:04:30 -04:00
|
|
|
context "when on system #{system}" do
|
2015-10-30 15:35:51 -04:00
|
|
|
facts = {
|
2015-04-16 18:04:30 -04:00
|
|
|
:osfamily => family,
|
|
|
|
:operatingsystem => system,
|
2015-10-30 15:35:51 -04:00
|
|
|
}
|
|
|
|
let :facts do
|
|
|
|
facts
|
2015-04-16 18:04:30 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
it { should contain_class('nslcd') }
|
|
|
|
it { should contain_class('nslcd::install') }
|
|
|
|
it { should contain_class('nslcd::config') }
|
|
|
|
it { should contain_class('nslcd::service') }
|
|
|
|
|
2015-10-30 15:35:51 -04:00
|
|
|
|
|
|
|
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
|
2015-04-16 18:04:30 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'when on an unknown system' do
|
|
|
|
it { expect { should raise_error(Puppet::Error) } }
|
|
|
|
end
|
|
|
|
end
|