forked from sgnl05/sgnl05-sssd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit_spec.rb
91 lines (75 loc) · 3.9 KB
/
init_spec.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
require 'spec_helper'
describe 'sssd' do
describe 'on RedHat 5.11' do
let(:facts) { { :osfamily => 'RedHat', :operatingsystemrelease => '5.7' } }
context 'with defaults for all parameters' do
it { is_expected.to contain_class('sssd::install') }
it { is_expected.to contain_class('sssd::config') }
it { is_expected.to contain_class('sssd::service') }
it { is_expected.to contain_package('authconfig').with_ensure('latest') }
it { is_expected.not_to contain_package('oddjob-mkhomedir') }
it { is_expected.not_to contain_service('oddjobd') }
it { is_expected.to contain_exec('authconfig-mkhomedir').that_comes_before('File[sssd.conf]') }
it { is_expected.to contain_service('sssd').with_ensure('running') }
end
context 'with service ensure stopped' do
let(:params) { { :service_ensure => 'stopped' } }
it { is_expected.to contain_service('sssd').with_ensure('stopped') }
end
end
describe 'on RedHat 6.6' do
let(:facts) { { :osfamily => 'RedHat', :operatingsystemrelease => '6.6' } }
context 'with defaults for all parameters' do
it { is_expected.to contain_class('sssd::install') }
it { is_expected.to contain_class('sssd::config') }
it { is_expected.to contain_class('sssd::service') }
it { is_expected.to contain_package('authconfig').with_ensure('present') }
it { is_expected.to contain_package('oddjob-mkhomedir') }
it { is_expected.to contain_service('oddjobd') }
it { is_expected.to contain_exec('authconfig-mkhomedir').that_comes_before('File[sssd.conf]') }
it { is_expected.to contain_service('sssd').with_ensure('running') }
it { is_expected.to contain_service('oddjobd').with_ensure('running') }
end
context 'with service ensure stopped' do
let(:params) { { :service_ensure => 'stopped' } }
it { is_expected.to contain_service('sssd').with_ensure('stopped') }
it { is_expected.to contain_service('oddjobd').with_ensure('stopped') }
end
end
describe 'on RedHat 7.1' do
let(:facts) { { :osfamily => 'RedHat', :operatingsystemrelease => '7.1' } }
context 'with defaults for all parameters' do
it { is_expected.to contain_class('sssd::install') }
it { is_expected.to contain_class('sssd::config') }
it { is_expected.to contain_class('sssd::service') }
it { is_expected.to contain_package('authconfig').with_ensure('present') }
it { is_expected.to contain_package('oddjob-mkhomedir') }
it { is_expected.to contain_service('oddjobd') }
it { is_expected.to contain_exec('authconfig-mkhomedir').that_comes_before('File[sssd.conf]') }
it { is_expected.to contain_service('sssd').with_ensure('running') }
it { is_expected.to contain_service('oddjobd').with_ensure('running') }
end
context 'with service ensure stopped' do
let(:params) { { :service_ensure => 'stopped' } }
it { is_expected.to contain_service('sssd').with_ensure('stopped') }
it { is_expected.to contain_service('oddjobd').with_ensure('stopped') }
end
end
describe 'on Debian 8.1' do
let(:facts) { { :osfamily => 'Debian', :operatingsystemrelease => '8.1' } }
context 'with defaults for all parameters' do
it { is_expected.to contain_class('sssd::install') }
it { is_expected.to contain_class('sssd::config') }
it { is_expected.to contain_class('sssd::service') }
it { is_expected.not_to contain_package('authconfig') }
it { is_expected.not_to contain_package('oddjob-mkhomedir') }
it { is_expected.to contain_package('libpam-runtime').with_ensure('present') }
it { is_expected.not_to contain_service('oddjobd') }
it { is_expected.to contain_service('sssd').with_ensure('running') }
end
context 'with service ensure stopped' do
let(:params) { { :service_ensure => 'stopped' } }
it { is_expected.to contain_service('sssd').with_ensure('stopped') }
end
end
end