Skip to content

Commit

Permalink
add ubuntu compatibility to rspec-system tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Joshua Hoblitt committed Dec 21, 2013
1 parent 5791a6c commit a81c8a4
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 7 deletions.
4 changes: 4 additions & 0 deletions .nodeset.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ sets:
nodes:
'main.vm':
prefab: 'debian-607-x64'
'ubuntu-server-12042-x64':
nodes:
"main.vm":
prefab: 'ubuntu-server-12042-x64'
9 changes: 7 additions & 2 deletions spec/system/gmetad_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,21 @@

describe 'ganglia::gmetad class' do
case node.facts['osfamily']
when 'RedHat', 'Debian'
when 'RedHat'
package_name = 'ganglia-gmetad'
service_name = 'gmetad'
when 'Debian'
package_name = 'gmetad'
service_name = 'gmetad'
end

describe 'running puppet code' do
# Using puppet_apply as a helper
it 'should work with no errors' do
pp = <<-EOS
class { 'epel': } ->
if $::osfamily == 'RedHat' {
class { 'epel': } -> Class['ganglia::gmetad']
}
class { 'ganglia::gmetad': }
EOS

Expand Down
18 changes: 15 additions & 3 deletions spec/system/gmond_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,25 @@

describe 'ganglia::gmond class' do
case node.facts['osfamily']
when 'RedHat', 'Debian'
when 'RedHat'
package_name = 'ganglia-gmond'
service_name = 'gmond'
daemon_name = 'gmond'
when 'Debian'
# Amazingly, the init script is named ganglia-monitor while the daemon runs
# with the executable name of gmond.
package_name = 'ganglia-monitor'
service_name = 'ganglia-monitor'
daemon_name = 'gmond'
end

describe 'running puppet code' do
# Using puppet_apply as a helper
it 'should work with no errors' do
pp = <<-EOS
class { 'epel': } ->
if $::osfamily == 'RedHat' {
class { 'epel': } -> Class['ganglia::gmond']
}
class { 'ganglia::gmond': }
EOS

Expand All @@ -29,7 +38,10 @@ class { 'ganglia::gmond': }
end

describe service(service_name) do
it { should be_running }
it { should be_enabled }
end

describe service(daemon_name) do
it { should be_running }
end
end
8 changes: 6 additions & 2 deletions spec/system/web_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,19 @@

describe 'ganglia::web class' do
case node.facts['osfamily']
when 'RedHat', 'Debian'
when 'RedHat'
package_name = 'ganglia-web'
when 'Debian'
package_name = 'ganglia-webfrontend'
end

describe 'running puppet code' do
# Using puppet_apply as a helper
it 'should work with no errors' do
pp = <<-EOS
class { 'epel': } ->
if $::osfamily == 'RedHat' {
class { 'epel': } -> Class['ganglia::web']
}
class { 'ganglia::web': }
EOS

Expand Down

0 comments on commit a81c8a4

Please sign in to comment.