3 describe 'apache::mod::authnz_ldap', :type => :class do
8 context "on a Debian OS" do
11 :lsbdistcodename => 'squeeze',
12 :osfamily => 'Debian',
13 :operatingsystemrelease => '6',
14 :concat_basedir => '/dne',
17 :operatingsystem => 'Debian',
18 :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
22 it { is_expected.to contain_class("apache::params") }
23 it { is_expected.to contain_class("apache::mod::ldap") }
24 it { is_expected.to contain_apache__mod('authnz_ldap') }
26 context 'default verifyServerCert' do
27 it { is_expected.to contain_file('authnz_ldap.conf').with_content(/^LDAPVerifyServerCert On$/) }
30 context 'verifyServerCert = false' do
31 let(:params) { { :verifyServerCert => false } }
32 it { is_expected.to contain_file('authnz_ldap.conf').with_content(/^LDAPVerifyServerCert Off$/) }
35 context 'verifyServerCert = wrong' do
36 let(:params) { { :verifyServerCert => 'wrong' } }
37 it 'should raise an error' do
38 expect { is_expected.to raise_error Puppet::Error }
43 context "on a RedHat OS" do
46 :osfamily => 'RedHat',
47 :operatingsystemrelease => '6',
48 :concat_basedir => '/dne',
51 :operatingsystem => 'RedHat',
52 :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
56 it { is_expected.to contain_class("apache::params") }
57 it { is_expected.to contain_class("apache::mod::ldap") }
58 it { is_expected.to contain_apache__mod('authnz_ldap') }
60 context 'default verifyServerCert' do
61 it { is_expected.to contain_file('authnz_ldap.conf').with_content(/^LDAPVerifyServerCert On$/) }
64 context 'verifyServerCert = false' do
65 let(:params) { { :verifyServerCert => false } }
66 it { is_expected.to contain_file('authnz_ldap.conf').with_content(/^LDAPVerifyServerCert Off$/) }
69 context 'verifyServerCert = wrong' do
70 let(:params) { { :verifyServerCert => 'wrong' } }
71 it 'should raise an error' do
72 expect { is_expected.to raise_error Puppet::Error }