Skip to content

Commit d00631c

Browse files
author
Ashley Penney
committed
Merge pull request #791 from mhaskel/rhel7-test-fixes
Mark tests depending on passenger as pending on RHEL7.
2 parents e4e7b5b + b62bb06 commit d00631c

File tree

2 files changed

+113
-107
lines changed

2 files changed

+113
-107
lines changed

spec/acceptance/mod_passenger_spec.rb

+89-87
Original file line numberDiff line numberDiff line change
@@ -130,108 +130,110 @@ class { 'apache::mod::passenger': }
130130
# no fedora 18 passenger package yet, and rhel5 packages only exist for ruby 1.8.5
131131
unless (fact('operatingsystem') == 'Fedora' and fact('operatingsystemrelease').to_f >= 18) or (fact('osfamily') == 'RedHat' and fact('operatingsystemmajrelease') == '5' and fact('rubyversion') != '1.8.5')
132132

133-
context "default passenger config" do
134-
it 'succeeds in puppeting passenger' do
135-
pp = <<-EOS
136-
/* EPEL and passenger repositories */
137-
class { 'epel': }
138-
exec { 'passenger.repo GPG key':
139-
command => '/usr/bin/curl -o /etc/yum.repos.d/RPM-GPG-KEY-stealthymonkeys.asc http://passenger.stealthymonkeys.com/RPM-GPG-KEY-stealthymonkeys.asc',
140-
creates => '/etc/yum.repos.d/RPM-GPG-KEY-stealthymonkeys.asc',
141-
}
142-
file { 'passenger.repo GPG key':
143-
ensure => file,
144-
path => '/etc/yum.repos.d/RPM-GPG-KEY-stealthymonkeys.asc',
145-
require => Exec['passenger.repo GPG key'],
146-
}
147-
epel::rpm_gpg_key { 'passenger.stealthymonkeys.com':
148-
path => '/etc/yum.repos.d/RPM-GPG-KEY-stealthymonkeys.asc',
149-
require => [
150-
Class['epel'],
151-
File['passenger.repo GPG key'],
152-
]
153-
}
154-
$releasever_string = $operatingsystem ? {
155-
'Scientific' => '6',
156-
default => '$releasever',
157-
}
158-
yumrepo { 'passenger':
159-
baseurl => "http://passenger.stealthymonkeys.com/rhel/${releasever_string}/\\$basearch" ,
160-
descr => "Red Hat Enterprise ${releasever_string} - Phusion Passenger",
161-
enabled => 1,
162-
gpgcheck => 1,
163-
gpgkey => 'http://passenger.stealthymonkeys.com/RPM-GPG-KEY-stealthymonkeys.asc',
164-
mirrorlist => 'http://passenger.stealthymonkeys.com/rhel/mirrors',
165-
require => [
166-
Epel::Rpm_gpg_key['passenger.stealthymonkeys.com'],
167-
],
168-
}
169-
/* apache and mod_passenger */
170-
class { 'apache':
133+
if fact('operatingsystem') == 'RedHat' and fact('operatingsystemmajrelease') == '7'
134+
pending('test passenger - RHEL7 packages don\'t exist')
135+
else
136+
context "default passenger config" do
137+
it 'succeeds in puppeting passenger' do
138+
pp = <<-EOS
139+
/* EPEL and passenger repositories */
140+
class { 'epel': }
141+
exec { 'passenger.repo GPG key':
142+
command => '/usr/bin/curl -o /etc/yum.repos.d/RPM-GPG-KEY-stealthymonkeys.asc http://passenger.stealthymonkeys.com/RPM-GPG-KEY-stealthymonkeys.asc',
143+
creates => '/etc/yum.repos.d/RPM-GPG-KEY-stealthymonkeys.asc',
144+
}
145+
file { 'passenger.repo GPG key':
146+
ensure => file,
147+
path => '/etc/yum.repos.d/RPM-GPG-KEY-stealthymonkeys.asc',
148+
require => Exec['passenger.repo GPG key'],
149+
}
150+
epel::rpm_gpg_key { 'passenger.stealthymonkeys.com':
151+
path => '/etc/yum.repos.d/RPM-GPG-KEY-stealthymonkeys.asc',
171152
require => [
172153
Class['epel'],
173-
],
174-
}
175-
class { 'apache::mod::passenger':
176-
require => [
177-
Yumrepo['passenger']
178-
],
179-
}
180-
#{pp_rackapp}
181-
EOS
182-
apply_manifest(pp, :catch_failures => true)
183-
end
154+
File['passenger.repo GPG key'],
155+
]
156+
}
157+
$releasever_string = $operatingsystem ? {
158+
'Scientific' => '6',
159+
default => '$releasever',
160+
}
161+
yumrepo { 'passenger':
162+
baseurl => "http://passenger.stealthymonkeys.com/rhel/${releasever_string}/\\$basearch" ,
163+
descr => "Red Hat Enterprise ${releasever_string} - Phusion Passenger",
164+
enabled => 1,
165+
gpgcheck => 1,
166+
gpgkey => 'http://passenger.stealthymonkeys.com/RPM-GPG-KEY-stealthymonkeys.asc',
167+
mirrorlist => 'http://passenger.stealthymonkeys.com/rhel/mirrors',
168+
require => [
169+
Epel::Rpm_gpg_key['passenger.stealthymonkeys.com'],
170+
],
171+
}
172+
/* apache and mod_passenger */
173+
class { 'apache':
174+
require => [
175+
Class['epel'],
176+
],
177+
}
178+
class { 'apache::mod::passenger':
179+
require => [
180+
Yumrepo['passenger']
181+
],
182+
}
183+
#{pp_rackapp}
184+
EOS
185+
apply_manifest(pp, :catch_failures => true)
186+
end
184187

185-
describe service(service_name) do
186-
it { should be_enabled }
187-
it { should be_running }
188-
end
188+
describe service(service_name) do
189+
it { should be_enabled }
190+
it { should be_running }
191+
end
189192

190-
describe file(conf_file) do
191-
it { should contain "PassengerRoot #{passenger_root}" }
192-
it { should contain "PassengerRuby #{passenger_ruby}" }
193-
it { should contain "PassengerTempDir #{passenger_tempdir}" }
194-
end
193+
describe file(conf_file) do
194+
it { should contain "PassengerRoot #{passenger_root}" }
195+
it { should contain "PassengerRuby #{passenger_ruby}" }
196+
it { should contain "PassengerTempDir #{passenger_tempdir}" }
197+
end
195198

196-
describe file(load_file) do
197-
it { should contain "LoadModule passenger_module #{passenger_module_path}" }
198-
end
199+
describe file(load_file) do
200+
it { should contain "LoadModule passenger_module #{passenger_module_path}" }
201+
end
199202

200-
it 'should output status via passenger-memory-stats' do
201-
shell("/usr/bin/passenger-memory-stats") do |r|
202-
r.stdout.should =~ /Apache processes/
203-
r.stdout.should =~ /Nginx processes/
204-
r.stdout.should =~ /Passenger processes/
205-
r.stdout.should =~ /### Processes: [0-9]+/
206-
r.stdout.should =~ /### Total private dirty RSS: [0-9\.]+ MB/
203+
it 'should output status via passenger-memory-stats' do
204+
shell("/usr/bin/passenger-memory-stats") do |r|
205+
r.stdout.should =~ /Apache processes/
206+
r.stdout.should =~ /Nginx processes/
207+
r.stdout.should =~ /Passenger processes/
208+
r.stdout.should =~ /### Processes: [0-9]+/
209+
r.stdout.should =~ /### Total private dirty RSS: [0-9\.]+ MB/
207210

208-
r.exit_code.should == 0
211+
r.exit_code.should == 0
212+
end
209213
end
210-
end
211214

212-
it 'should output status via passenger-status' do
213-
shell("PASSENGER_TMPDIR=/var/run/rubygem-passenger /usr/bin/passenger-status") do |r|
214-
# spacing may vary
215-
r.stdout.should =~ /[\-]+ General information [\-]+/
216-
r.stdout.should =~ /max[ ]+= [0-9]+/
217-
r.stdout.should =~ /count[ ]+= [0-9]+/
218-
r.stdout.should =~ /active[ ]+= [0-9]+/
219-
r.stdout.should =~ /inactive[ ]+= [0-9]+/
220-
r.stdout.should =~ /Waiting on global queue: [0-9]+/
215+
it 'should output status via passenger-status' do
216+
shell("PASSENGER_TMPDIR=/var/run/rubygem-passenger /usr/bin/passenger-status") do |r|
217+
# spacing may vary
218+
r.stdout.should =~ /[\-]+ General information [\-]+/
219+
r.stdout.should =~ /max[ ]+= [0-9]+/
220+
r.stdout.should =~ /count[ ]+= [0-9]+/
221+
r.stdout.should =~ /active[ ]+= [0-9]+/
222+
r.stdout.should =~ /inactive[ ]+= [0-9]+/
223+
r.stdout.should =~ /Waiting on global queue: [0-9]+/
221224

222-
r.exit_code.should == 0
225+
r.exit_code.should == 0
226+
end
223227
end
224-
end
225228

226-
it 'should answer to passenger.example.com' do
227-
shell("/usr/bin/curl passenger.example.com:80") do |r|
228-
r.stdout.should =~ /^hello <b>world<\/b>$/
229-
r.exit_code.should == 0
229+
it 'should answer to passenger.example.com' do
230+
shell("/usr/bin/curl passenger.example.com:80") do |r|
231+
r.stdout.should =~ /^hello <b>world<\/b>$/
232+
r.exit_code.should == 0
233+
end
230234
end
231235
end
232236
end
233-
234237
end
235-
236238
end
237239
end

spec/acceptance/vhost_spec.rb

+24-20
Original file line numberDiff line numberDiff line change
@@ -814,29 +814,33 @@ class { 'apache': }
814814

815815
# Passenger isn't even in EPEL on el-5
816816
if default['platform'] !~ /^el-5/
817-
describe 'rack_base_uris' do
818-
if fact('osfamily') == 'RedHat'
819-
it 'adds epel' do
820-
pp = "class { 'epel': }"
821-
apply_manifest(pp, :catch_failures => true)
817+
if fact('osfamily') == 'RedHat' and fact('operatingsystemmajrelease') == '7'
818+
pending('Since we don\'t have passenger on RHEL7 rack_base_uris tests will fail')
819+
else
820+
describe 'rack_base_uris' do
821+
if fact('osfamily') == 'RedHat'
822+
it 'adds epel' do
823+
pp = "class { 'epel': }"
824+
apply_manifest(pp, :catch_failures => true)
825+
end
822826
end
823-
end
824827

825-
it 'applies cleanly' do
826-
pp = <<-EOS
827-
class { 'apache': }
828-
host { 'test.server': ip => '127.0.0.1' }
829-
apache::vhost { 'test.server':
830-
docroot => '/tmp',
831-
rack_base_uris => ['/test'],
832-
}
833-
EOS
834-
apply_manifest(pp, :catch_failures => true)
835-
end
828+
it 'applies cleanly' do
829+
pp = <<-EOS
830+
class { 'apache': }
831+
host { 'test.server': ip => '127.0.0.1' }
832+
apache::vhost { 'test.server':
833+
docroot => '/tmp',
834+
rack_base_uris => ['/test'],
835+
}
836+
EOS
837+
apply_manifest(pp, :catch_failures => true)
838+
end
836839

837-
describe file("#{$vhost_dir}/25-test.server.conf") do
838-
it { should be_file }
839-
it { should contain 'RackBaseURI /test' }
840+
describe file("#{$vhost_dir}/25-test.server.conf") do
841+
it { should be_file }
842+
it { should contain 'RackBaseURI /test' }
843+
end
840844
end
841845
end
842846
end

0 commit comments

Comments
 (0)