]> git.donarmstrong.com Git - dsa-puppet.git/blob - 3rdparty/modules/apache/spec/acceptance/mod_dav_svn_spec.rb
add Openstack modules to 3rdparty
[dsa-puppet.git] / 3rdparty / modules / apache / spec / acceptance / mod_dav_svn_spec.rb
1 require 'spec_helper_acceptance'
2
3 describe 'apache::mod::dav_svn class', :unless => (fact('operatingsystem') == 'OracleLinux' and fact('operatingsystemmajrelease') == '7') do
4   case fact('osfamily')
5   when 'Debian'
6     mod_dir             = '/etc/apache2/mods-available'
7     service_name        = 'apache2'
8     if fact('operatingsystemmajrelease') == '6' or fact('operatingsystemmajrelease') == '10.04' or fact('operatingsystemrelease') == '10.04'
9       authz_svn_load_file = 'dav_svn_authz_svn.load'
10     else
11       authz_svn_load_file = 'authz_svn.load'
12     end
13   when 'RedHat'
14     mod_dir             = '/etc/httpd/conf.d'
15     service_name        = 'httpd'
16     authz_svn_load_file = 'dav_svn_authz_svn.load'
17   when 'FreeBSD'
18     mod_dir             = '/usr/local/etc/apache24/Modules'
19     service_name        = 'apache24'
20     authz_svn_load_file = 'dav_svn_authz_svn.load'
21   end
22
23   context "default dav_svn config" do
24     it 'succeeds in puppeting dav_svn' do
25       pp= <<-EOS
26         class { 'apache': }
27         include apache::mod::dav_svn
28       EOS
29       apply_manifest(pp, :catch_failures => true)
30     end
31
32     describe service(service_name) do
33       it { is_expected.to be_enabled }
34       it { is_expected.to be_running }
35     end
36
37     describe file("#{mod_dir}/dav_svn.load") do
38       it { is_expected.to contain "LoadModule dav_svn_module" }
39     end
40   end
41
42   context "dav_svn with enabled authz_svn config" do
43     it 'succeeds in puppeting dav_svn' do
44       pp= <<-EOS
45         class { 'apache': }
46         class { 'apache::mod::dav_svn':
47             authz_svn_enabled => true,
48         }
49       EOS
50       apply_manifest(pp, :catch_failures => true)
51     end
52
53     describe service(service_name) do
54       it { is_expected.to be_enabled }
55       it { is_expected.to be_running }
56     end
57
58     describe file("#{mod_dir}/#{authz_svn_load_file}") do
59       it { is_expected.to contain "LoadModule authz_svn_module" }
60     end
61   end
62 end