|
111 | 111 | it { should_not contain_apache__mod('worker') } |
112 | 112 | it { should contain_file("/usr/local/etc/apache22/Modules/worker.conf").with_ensure('file') } |
113 | 113 | end |
| 114 | + |
| 115 | + # Template config doesn't vary by distro |
| 116 | + context "on all distros" do |
| 117 | + let :facts do |
| 118 | + { |
| 119 | + :osfamily => 'RedHat', |
| 120 | + :operatingsystemrelease => '6', |
| 121 | + :concat_basedir => '/dne', |
| 122 | + } |
| 123 | + end |
| 124 | + |
| 125 | + context 'defaults' do |
| 126 | + it { should contain_file('/etc/httpd/conf.d/worker.conf').with(:content => /^<IfModule mpm_worker_module>$/) } |
| 127 | + it { should contain_file('/etc/httpd/conf.d/worker.conf').with(:content => /^\s+ServerLimit\s+25$/) } |
| 128 | + it { should contain_file('/etc/httpd/conf.d/worker.conf').with(:content => /^\s+StartServers\s+2$/) } |
| 129 | + it { should contain_file('/etc/httpd/conf.d/worker.conf').with(:content => /^\s+MaxClients\s+150$/) } |
| 130 | + it { should contain_file('/etc/httpd/conf.d/worker.conf').with(:content => /^\s+MinSpareThreads\s+25$/) } |
| 131 | + it { should contain_file('/etc/httpd/conf.d/worker.conf').with(:content => /^\s+MaxSpareThreads\s+75$/) } |
| 132 | + it { should contain_file('/etc/httpd/conf.d/worker.conf').with(:content => /^\s+ThreadsPerChild\s+25$/) } |
| 133 | + it { should contain_file('/etc/httpd/conf.d/worker.conf').with(:content => /^\s+MaxRequestsPerChild\s+0$/) } |
| 134 | + it { should contain_file('/etc/httpd/conf.d/worker.conf').with(:content => /^\s+ThreadLimit\s+64$/) } |
| 135 | + end |
| 136 | + |
| 137 | + context 'setting params' do |
| 138 | + let :params do |
| 139 | + { |
| 140 | + :serverlimit => 10, |
| 141 | + :startservers => 11, |
| 142 | + :maxclients => 12, |
| 143 | + :minsparethreads => 13, |
| 144 | + :maxsparethreads => 14, |
| 145 | + :threadsperchild => 15, |
| 146 | + :maxrequestsperchild => 16, |
| 147 | + :threadlimit => 17 |
| 148 | + } |
| 149 | + end |
| 150 | + it { should contain_file('/etc/httpd/conf.d/worker.conf').with(:content => /^<IfModule mpm_worker_module>$/) } |
| 151 | + it { should contain_file('/etc/httpd/conf.d/worker.conf').with(:content => /^\s+ServerLimit\s+10$/) } |
| 152 | + it { should contain_file('/etc/httpd/conf.d/worker.conf').with(:content => /^\s+StartServers\s+11$/) } |
| 153 | + it { should contain_file('/etc/httpd/conf.d/worker.conf').with(:content => /^\s+MaxClients\s+12$/) } |
| 154 | + it { should contain_file('/etc/httpd/conf.d/worker.conf').with(:content => /^\s+MinSpareThreads\s+13$/) } |
| 155 | + it { should contain_file('/etc/httpd/conf.d/worker.conf').with(:content => /^\s+MaxSpareThreads\s+14$/) } |
| 156 | + it { should contain_file('/etc/httpd/conf.d/worker.conf').with(:content => /^\s+ThreadsPerChild\s+15$/) } |
| 157 | + it { should contain_file('/etc/httpd/conf.d/worker.conf').with(:content => /^\s+MaxRequestsPerChild\s+16$/) } |
| 158 | + it { should contain_file('/etc/httpd/conf.d/worker.conf').with(:content => /^\s+ThreadLimit\s+17$/) } |
| 159 | + end |
| 160 | + end |
114 | 161 | end |
0 commit comments