3 describe 'apache::mod::event', :type => :class do
5 'class { "apache": mpm_module => false, }'
7 context "on a FreeBSD OS" do
10 :osfamily => 'FreeBSD',
11 :operatingsystemrelease => '9',
12 :concat_basedir => '/dne',
13 :operatingsystem => 'FreeBSD',
16 :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
20 it { is_expected.to contain_class("apache::params") }
21 it { is_expected.not_to contain_apache__mod('event') }
22 it { is_expected.to contain_file("/usr/local/etc/apache24/Modules/event.conf").with_ensure('file') }
24 context "on a Gentoo OS" do
27 :osfamily => 'Gentoo',
28 :operatingsystem => 'Gentoo',
29 :operatingsystemrelease => '3.16.1-gentoo',
30 :concat_basedir => '/dne',
33 :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin',
37 it { is_expected.to contain_class("apache::params") }
38 it { is_expected.not_to contain_apache__mod('event') }
39 it { is_expected.to contain_file("/etc/apache2/modules.d/event.conf").with_ensure('file') }
41 context "on a Debian OS" do
44 :lsbdistcodename => 'squeeze',
45 :osfamily => 'Debian',
46 :operatingsystemrelease => '6',
47 :concat_basedir => '/dne',
48 :operatingsystem => 'Debian',
51 :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
57 it { is_expected.to contain_class("apache::params") }
58 it { is_expected.not_to contain_apache__mod('event') }
59 it { is_expected.to contain_file("/etc/apache2/mods-available/event.conf").with_ensure('file') }
60 it { is_expected.to contain_file("/etc/apache2/mods-enabled/event.conf").with_ensure('link') }
62 context "Test mpm_event params" do
68 :minsparethreads => '3',
69 :maxsparethreads => '4',
70 :threadsperchild => '5',
71 :maxrequestsperchild => '6',
73 :listenbacklog => '8',
74 :maxrequestworkers => '9',
75 :maxconnectionsperchild => '10',
79 it { is_expected.to contain_file("/etc/apache2/mods-available/event.conf").with_ensure('file').with_content(/^\s*ServerLimit\s*0/) }
80 it { is_expected.to contain_file("/etc/apache2/mods-available/event.conf").with_ensure('file').with_content(/^\s*StartServers\s*1/) }
81 it { is_expected.to contain_file("/etc/apache2/mods-available/event.conf").with_ensure('file').with_content(/^\s*MaxClients\s*2/) }
82 it { is_expected.to contain_file("/etc/apache2/mods-available/event.conf").with_ensure('file').with_content(/^\s*MinSpareThreads\s*3/) }
83 it { is_expected.to contain_file("/etc/apache2/mods-available/event.conf").with_ensure('file').with_content(/^\s*MaxSpareThreads\s*4/) }
84 it { is_expected.to contain_file("/etc/apache2/mods-available/event.conf").with_ensure('file').with_content(/^\s*ThreadsPerChild\s*5/) }
85 it { is_expected.to contain_file("/etc/apache2/mods-available/event.conf").with_ensure('file').with_content(/^\s*MaxRequestsPerChild\s*6/) }
86 it { is_expected.to contain_file("/etc/apache2/mods-available/event.conf").with_ensure('file').with_content(/^\s*ThreadLimit\s*7/) }
87 it { is_expected.to contain_file("/etc/apache2/mods-available/event.conf").with_ensure('file').with_content(/^\s*ListenBacklog\s*8/) }
88 it { is_expected.to contain_file("/etc/apache2/mods-available/event.conf").with_ensure('file').with_content(/^\s*MaxRequestWorkers\s*9/) }
89 it { is_expected.to contain_file("/etc/apache2/mods-available/event.conf").with_ensure('file').with_content(/^\s*MaxConnectionsPerChild\s*10/) }
92 context "with Apache version < 2.4" do
95 :apache_version => '2.2',
99 it { is_expected.not_to contain_file("/etc/apache2/mods-available/event.load") }
100 it { is_expected.not_to contain_file("/etc/apache2/mods-enabled/event.load") }
102 it { is_expected.to contain_package("apache2-mpm-event") }
105 context "with Apache version >= 2.4" do
108 :apache_version => '2.4',
112 it { is_expected.to contain_file("/etc/apache2/mods-available/event.load").with({
114 'content' => "LoadModule mpm_event_module /usr/lib/apache2/modules/mod_mpm_event.so\n"
117 it { is_expected.to contain_file("/etc/apache2/mods-enabled/event.load").with_ensure('link') }
120 context "on a RedHat OS" do
123 :osfamily => 'RedHat',
124 :operatingsystemrelease => '6',
125 :concat_basedir => '/dne',
126 :operatingsystem => 'RedHat',
129 :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
134 context "with Apache version >= 2.4" do
137 :apache_version => '2.4',
141 it { is_expected.to contain_class("apache::params") }
142 it { is_expected.not_to contain_apache__mod('worker') }
143 it { is_expected.not_to contain_apache__mod('prefork') }
145 it { is_expected.to contain_file("/etc/httpd/conf.d/event.conf").with_ensure('file') }
147 it { is_expected.to contain_file("/etc/httpd/conf.d/event.load").with({
149 'content' => "LoadModule mpm_event_module modules/mod_mpm_event.so\n",