3 describe 'apache::mod::passenger', :type => :class do
7 context "on a Debian OS" do
10 :osfamily => 'Debian',
11 :operatingsystemrelease => '6',
13 :concat_basedir => '/dne',
14 :lsbdistcodename => 'squeeze',
15 :operatingsystem => 'Debian',
18 :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
22 it { is_expected.to contain_class("apache::params") }
23 it { is_expected.to contain_apache__mod('passenger') }
24 it { is_expected.to contain_package("libapache2-mod-passenger") }
25 it { is_expected.to contain_file('zpassenger.load').with({
26 'path' => '/etc/apache2/mods-available/zpassenger.load',
28 it { is_expected.to contain_file('passenger.conf').with({
29 'path' => '/etc/apache2/mods-available/passenger.conf',
31 describe "with passenger_root => '/usr/lib/example'" do
33 { :passenger_root => '/usr/lib/example' }
35 it { is_expected.to contain_file('passenger.conf').with_content(%r{PassengerRoot "/usr/lib/example"}) }
37 describe "with passenger_ruby => /usr/lib/example/ruby" do
39 { :passenger_ruby => '/usr/lib/example/ruby' }
41 it { is_expected.to contain_file('passenger.conf').with_content(%r{PassengerRuby "/usr/lib/example/ruby"}) }
43 describe "with passenger_default_ruby => /usr/lib/example/ruby1.9.3" do
45 { :passenger_ruby => '/usr/lib/example/ruby1.9.3' }
47 it { is_expected.to contain_file('passenger.conf').with_content(%r{PassengerRuby "/usr/lib/example/ruby1.9.3"}) }
49 describe "with passenger_high_performance => on" do
51 { :passenger_high_performance => 'on' }
53 it { is_expected.to contain_file('passenger.conf').with_content(/^ PassengerHighPerformance on$/) }
55 describe "with passenger_pool_idle_time => 1200" do
57 { :passenger_pool_idle_time => 1200 }
59 it { is_expected.to contain_file('passenger.conf').with_content(/^ PassengerPoolIdleTime 1200$/) }
61 describe "with passenger_max_requests => 20" do
63 { :passenger_max_requests => 20 }
65 it { is_expected.to contain_file('passenger.conf').with_content(/^ PassengerMaxRequests 20$/) }
67 describe "with passenger_stat_throttle_rate => 10" do
69 { :passenger_stat_throttle_rate => 10 }
71 it { is_expected.to contain_file('passenger.conf').with_content(/^ PassengerStatThrottleRate 10$/) }
73 describe "with passenger_max_pool_size => 16" do
75 { :passenger_max_pool_size => 16 }
77 it { is_expected.to contain_file('passenger.conf').with_content(/^ PassengerMaxPoolSize 16$/) }
79 describe "with passenger_min_instances => 5" do
81 { :passenger_min_instances => 5 }
83 it { is_expected.to contain_file('passenger.conf').with_content(/^ PassengerMinInstances 5$/) }
85 describe "with rack_autodetect => on" do
87 { :rack_autodetect => 'on' }
89 it { is_expected.to contain_file('passenger.conf').with_content(/^ RackAutoDetect on$/) }
91 describe "with rails_autodetect => on" do
93 { :rails_autodetect => 'on' }
95 it { is_expected.to contain_file('passenger.conf').with_content(/^ RailsAutoDetect on$/) }
97 describe "with passenger_use_global_queue => on" do
99 { :passenger_use_global_queue => 'on' }
101 it { is_expected.to contain_file('passenger.conf').with_content(/^ PassengerUseGlobalQueue on$/) }
103 describe "with passenger_app_env => 'foo'" do
105 { :passenger_app_env => 'foo' }
107 it { is_expected.to contain_file('passenger.conf').with_content(/^ PassengerAppEnv foo$/) }
109 describe "with mod_path => '/usr/lib/foo/mod_foo.so'" do
111 { :mod_path => '/usr/lib/foo/mod_foo.so' }
113 it { is_expected.to contain_file('zpassenger.load').with_content(/^LoadModule passenger_module \/usr\/lib\/foo\/mod_foo\.so$/) }
115 describe "with mod_lib_path => '/usr/lib/foo'" do
117 { :mod_lib_path => '/usr/lib/foo' }
119 it { is_expected.to contain_file('zpassenger.load').with_content(/^LoadModule passenger_module \/usr\/lib\/foo\/mod_passenger\.so$/) }
121 describe "with mod_lib => 'mod_foo.so'" do
123 { :mod_lib => 'mod_foo.so' }
125 it { is_expected.to contain_file('zpassenger.load').with_content(/^LoadModule passenger_module \/usr\/lib\/apache2\/modules\/mod_foo\.so$/) }
127 describe "with mod_id => 'mod_foo'" do
129 { :mod_id => 'mod_foo' }
131 it { is_expected.to contain_file('zpassenger.load').with_content(/^LoadModule mod_foo \/usr\/lib\/apache2\/modules\/mod_passenger\.so$/) }
134 context "with Ubuntu 12.04 defaults" do
137 :osfamily => 'Debian',
138 :operatingsystemrelease => '12.04',
140 :operatingsystem => 'Ubuntu',
141 :lsbdistrelease => '12.04',
142 :concat_basedir => '/dne',
144 :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
149 it { is_expected.to contain_file('passenger.conf').with_content(%r{PassengerRoot "/usr"}) }
150 it { is_expected.to contain_file('passenger.conf').with_content(%r{PassengerRuby "/usr/bin/ruby"}) }
151 it { is_expected.to contain_file('passenger.conf').without_content(/PassengerDefaultRuby/) }
154 context "with Ubuntu 14.04 defaults" do
157 :osfamily => 'Debian',
158 :operatingsystemrelease => '14.04',
159 :operatingsystem => 'Ubuntu',
161 :lsbdistrelease => '14.04',
162 :concat_basedir => '/dne',
164 :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
169 it { is_expected.to contain_file('passenger.conf').with_content(%r{PassengerRoot "/usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini"}) }
170 it { is_expected.to contain_file('passenger.conf').without_content(/PassengerRuby/) }
171 it { is_expected.to contain_file('passenger.conf').with_content(%r{PassengerDefaultRuby "/usr/bin/ruby"}) }
174 context "with Debian 7 defaults" do
177 :osfamily => 'Debian',
178 :operatingsystemrelease => '7.3',
179 :operatingsystem => 'Debian',
181 :lsbdistcodename => 'wheezy',
182 :concat_basedir => '/dne',
184 :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
189 it { is_expected.to contain_file('passenger.conf').with_content(%r{PassengerRoot "/usr"}) }
190 it { is_expected.to contain_file('passenger.conf').with_content(%r{PassengerRuby "/usr/bin/ruby"}) }
191 it { is_expected.to contain_file('passenger.conf').without_content(/PassengerDefaultRuby/) }
194 context "with Debian 8 defaults" do
197 :osfamily => 'Debian',
198 :operatingsystemrelease => '8.0',
199 :operatingsystem => 'Debian',
201 :lsbdistcodename => 'jessie',
202 :concat_basedir => '/dne',
204 :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
209 it { is_expected.to contain_file('passenger.conf').with_content(%r{PassengerRoot "/usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini"}) }
210 it { is_expected.to contain_file('passenger.conf').without_content(/PassengerRuby/) }
211 it { is_expected.to contain_file('passenger.conf').with_content(%r{PassengerDefaultRuby "/usr/bin/ruby"}) }
215 context "on a RedHat OS" do
218 :osfamily => 'RedHat',
219 :operatingsystemrelease => '6',
220 :concat_basedir => '/dne',
221 :operatingsystem => 'RedHat',
224 :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
228 it { is_expected.to contain_class("apache::params") }
229 it { is_expected.to contain_apache__mod('passenger') }
230 it { is_expected.to contain_package("mod_passenger") }
231 it { is_expected.to contain_file('passenger_package.conf').with({
232 'path' => '/etc/httpd/conf.d/passenger.conf',
234 it { is_expected.to contain_file('passenger_package.conf').without_content }
235 it { is_expected.to contain_file('passenger_package.conf').without_source }
236 it { is_expected.to contain_file('zpassenger.load').with({
237 'path' => '/etc/httpd/conf.d/zpassenger.load',
239 it { is_expected.to contain_file('passenger.conf').without_content(/PassengerRoot/) }
240 it { is_expected.to contain_file('passenger.conf').without_content(/PassengerRuby/) }
241 describe "with passenger_root => '/usr/lib/example'" do
243 { :passenger_root => '/usr/lib/example' }
245 it { is_expected.to contain_file('passenger.conf').with_content(/^ PassengerRoot "\/usr\/lib\/example"$/) }
247 describe "with passenger_ruby => /usr/lib/example/ruby" do
249 { :passenger_ruby => '/usr/lib/example/ruby' }
251 it { is_expected.to contain_file('passenger.conf').with_content(/^ PassengerRuby "\/usr\/lib\/example\/ruby"$/) }
254 context "on a FreeBSD OS" do
257 :osfamily => 'FreeBSD',
258 :operatingsystemrelease => '9',
259 :concat_basedir => '/dne',
260 :operatingsystem => 'FreeBSD',
262 :kernel => 'FreeBSD',
263 :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
267 it { is_expected.to contain_class("apache::params") }
268 it { is_expected.to contain_apache__mod('passenger') }
269 it { is_expected.to contain_package("www/rubygem-passenger") }
271 context "on a Gentoo OS" do
274 :osfamily => 'Gentoo',
275 :operatingsystem => 'Gentoo',
276 :operatingsystemrelease => '3.16.1-gentoo',
277 :concat_basedir => '/dne',
280 :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin',
284 it { is_expected.to contain_class("apache::params") }
285 it { is_expected.to contain_apache__mod('passenger') }
286 it { is_expected.to contain_package("www-apache/passenger") }