forked from redhat-openstack/openstack-puppet-modules
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #792 from roidelapluie/reqtimeout
configure timeouts for apache::mod::reqtimeout
- Loading branch information
Showing
4 changed files
with
137 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
require 'spec_helper' | ||
|
||
describe 'apache::mod::reqtimeout', :type => :class do | ||
let :pre_condition do | ||
'class { "apache": | ||
default_mods => false, | ||
}' | ||
end | ||
context "on a Debian OS" do | ||
let :facts do | ||
{ | ||
:osfamily => 'Debian', | ||
:operatingsystemrelease => '6', | ||
:concat_basedir => '/dne', | ||
:operatingsystem => 'Debian', | ||
:id => 'root', | ||
:kernel => 'Linux', | ||
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', | ||
:lsbdistcodename => 'squeeze', | ||
} | ||
end | ||
context "passing no parameters" do | ||
it { is_expected.to contain_class("apache::params") } | ||
it { is_expected.to contain_apache__mod('reqtimeout') } | ||
it { is_expected.to contain_file('reqtimeout.conf').with_content(/^RequestReadTimeout header=20-40,minrate=500\nRequestReadTimeout body=10,minrate=500$/) } | ||
end | ||
context "passing timeouts => ['header=20-60,minrate=600', 'body=60,minrate=600']" do | ||
let :params do | ||
{:timeouts => ['header=20-60,minrate=600', 'body=60,minrate=600']} | ||
end | ||
it { is_expected.to contain_class("apache::params") } | ||
it { is_expected.to contain_apache__mod('reqtimeout') } | ||
it { is_expected.to contain_file('reqtimeout.conf').with_content(/^RequestReadTimeout header=20-60,minrate=600\nRequestReadTimeout body=60,minrate=600$/) } | ||
end | ||
context "passing timeouts => 'header=20-60,minrate=600'" do | ||
let :params do | ||
{:timeouts => 'header=20-60,minrate=600'} | ||
end | ||
it { is_expected.to contain_class("apache::params") } | ||
it { is_expected.to contain_apache__mod('reqtimeout') } | ||
it { is_expected.to contain_file('reqtimeout.conf').with_content(/^RequestReadTimeout header=20-60,minrate=600$/) } | ||
end | ||
end | ||
context "on a RedHat OS" do | ||
let :facts do | ||
{ | ||
:osfamily => 'RedHat', | ||
:operatingsystemrelease => '6', | ||
:concat_basedir => '/dne', | ||
:operatingsystem => 'Redhat', | ||
:id => 'root', | ||
:kernel => 'Linux', | ||
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', | ||
} | ||
end | ||
context "passing no parameters" do | ||
it { is_expected.to contain_class("apache::params") } | ||
it { is_expected.to contain_apache__mod('reqtimeout') } | ||
it { is_expected.to contain_file('reqtimeout.conf').with_content(/^RequestReadTimeout header=20-40,minrate=500\nRequestReadTimeout body=10,minrate=500$/) } | ||
end | ||
context "passing timeouts => ['header=20-60,minrate=600', 'body=60,minrate=600']" do | ||
let :params do | ||
{:timeouts => ['header=20-60,minrate=600', 'body=60,minrate=600']} | ||
end | ||
it { is_expected.to contain_class("apache::params") } | ||
it { is_expected.to contain_apache__mod('reqtimeout') } | ||
it { is_expected.to contain_file('reqtimeout.conf').with_content(/^RequestReadTimeout header=20-60,minrate=600\nRequestReadTimeout body=60,minrate=600$/) } | ||
end | ||
context "passing timeouts => 'header=20-60,minrate=600'" do | ||
let :params do | ||
{:timeouts => 'header=20-60,minrate=600'} | ||
end | ||
it { is_expected.to contain_class("apache::params") } | ||
it { is_expected.to contain_apache__mod('reqtimeout') } | ||
it { is_expected.to contain_file('reqtimeout.conf').with_content(/^RequestReadTimeout header=20-60,minrate=600$/) } | ||
end | ||
end | ||
context "on a FreeBSD OS" do | ||
let :facts do | ||
{ | ||
:osfamily => 'FreeBSD', | ||
:operatingsystemrelease => '9', | ||
:concat_basedir => '/dne', | ||
:operatingsystem => 'FreeBSD', | ||
:id => 'root', | ||
:kernel => 'FreeBSD', | ||
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', | ||
} | ||
end | ||
context "passing no parameters" do | ||
it { is_expected.to contain_class("apache::params") } | ||
it { is_expected.to contain_apache__mod('reqtimeout') } | ||
it { is_expected.to contain_file('reqtimeout.conf').with_content(/^RequestReadTimeout header=20-40,minrate=500\nRequestReadTimeout body=10,minrate=500$/) } | ||
end | ||
context "passing timeouts => ['header=20-60,minrate=600', 'body=60,minrate=600']" do | ||
let :params do | ||
{:timeouts => ['header=20-60,minrate=600', 'body=60,minrate=600']} | ||
end | ||
it { is_expected.to contain_class("apache::params") } | ||
it { is_expected.to contain_apache__mod('reqtimeout') } | ||
it { is_expected.to contain_file('reqtimeout.conf').with_content(/^RequestReadTimeout header=20-60,minrate=600\nRequestReadTimeout body=60,minrate=600$/) } | ||
end | ||
context "passing timeouts => 'header=20-60,minrate=600'" do | ||
let :params do | ||
{:timeouts => 'header=20-60,minrate=600'} | ||
end | ||
it { is_expected.to contain_class("apache::params") } | ||
it { is_expected.to contain_apache__mod('reqtimeout') } | ||
it { is_expected.to contain_file('reqtimeout.conf').with_content(/^RequestReadTimeout header=20-60,minrate=600$/) } | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
RequestReadTimeout header=20-40,minrate=500 | ||
RequestReadTimeout body=10,minrate=500 | ||
<% Array(@timeouts).each do |timeout| -%> | ||
RequestReadTimeout <%= timeout %> | ||
<%- end -%> |