comparison modules/apache/spec/classes/mod/reqtimeout_spec.rb @ 257:675c1cc61eaf

Update Apache module to get CentOS 8 support Unfortunately it only fixes some bits. mod_wsgi still needs other approaches This also overrides the vhost modification to make them come last in the import order (after module loading)
author IBBoard <dev@ibboard.co.uk>
date Sun, 22 Dec 2019 14:43:29 -0500
parents 37675581a273
children d9352a684e62
comparison
equal deleted inserted replaced
252:47750947f4dc 257:675c1cc61eaf
1 require 'spec_helper' 1 require 'spec_helper'
2 2
3 describe 'apache::mod::reqtimeout', :type => :class do 3 describe 'apache::mod::reqtimeout', :type => :class do
4 let :pre_condition do 4 it_behaves_like "a mod class, without including apache"
5 'class { "apache":
6 default_mods => false,
7 }'
8 end
9 context "on a Debian OS" do 5 context "on a Debian OS" do
10 let :facts do 6 let :facts do
11 { 7 {
12 :osfamily => 'Debian', 8 :osfamily => 'Debian',
13 :operatingsystemrelease => '6', 9 :operatingsystemrelease => '6',
110 it { is_expected.to contain_class("apache::params") } 106 it { is_expected.to contain_class("apache::params") }
111 it { is_expected.to contain_apache__mod('reqtimeout') } 107 it { is_expected.to contain_apache__mod('reqtimeout') }
112 it { is_expected.to contain_file('reqtimeout.conf').with_content(/^RequestReadTimeout header=20-60,minrate=600$/) } 108 it { is_expected.to contain_file('reqtimeout.conf').with_content(/^RequestReadTimeout header=20-60,minrate=600$/) }
113 end 109 end
114 end 110 end
111 context "on a Gentoo OS" do
112 let :facts do
113 {
114 :osfamily => 'Gentoo',
115 :operatingsystem => 'Gentoo',
116 :operatingsystemrelease => '3.16.1-gentoo',
117 :concat_basedir => '/dne',
118 :id => 'root',
119 :kernel => 'Linux',
120 :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin',
121 :is_pe => false,
122 }
123 end
124 context "passing no parameters" do
125 it { is_expected.to contain_class("apache::params") }
126 it { is_expected.to contain_apache__mod('reqtimeout') }
127 it { is_expected.to contain_file('reqtimeout.conf').with_content(/^RequestReadTimeout header=20-40,minrate=500\nRequestReadTimeout body=10,minrate=500$/) }
128 end
129 context "passing timeouts => ['header=20-60,minrate=600', 'body=60,minrate=600']" do
130 let :params do
131 {:timeouts => ['header=20-60,minrate=600', 'body=60,minrate=600']}
132 end
133 it { is_expected.to contain_class("apache::params") }
134 it { is_expected.to contain_apache__mod('reqtimeout') }
135 it { is_expected.to contain_file('reqtimeout.conf').with_content(/^RequestReadTimeout header=20-60,minrate=600\nRequestReadTimeout body=60,minrate=600$/) }
136 end
137 context "passing timeouts => 'header=20-60,minrate=600'" do
138 let :params do
139 {:timeouts => 'header=20-60,minrate=600'}
140 end
141 it { is_expected.to contain_class("apache::params") }
142 it { is_expected.to contain_apache__mod('reqtimeout') }
143 it { is_expected.to contain_file('reqtimeout.conf').with_content(/^RequestReadTimeout header=20-60,minrate=600$/) }
144 end
145 end
115 end 146 end