Skip to content

Commit

Permalink
Acceptance tests (voxpupuli#381)
Browse files Browse the repository at this point in the history
Refactoring of acceptance tests as part of voxpupuli#351.
  • Loading branch information
dallinb committed Apr 24, 2017
1 parent dafb845 commit 6948004
Show file tree
Hide file tree
Showing 25 changed files with 724 additions and 940 deletions.
4 changes: 3 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ AllCops:
- 'vendor/**/*'
Metrics/BlockLength:
Enabled: false
Metrics/ClassLength:
Enabled: false
Metrics/LineLength:
Enabled: false
Style/FrozenStringLiteralComment:
Metrics/MethodLength:
Enabled: false
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
env:
- "PUPPET_VERSION='~> 4.5' BEAKER_set=centos6"
- "PUPPET_VERSION='~> 4.5' BEAKER_set=centos6_2"
- "PUPPET_VERSION='~> 4.5' BEAKER_set=centos6_3"
- "PUPPET_VERSION='~> 4.5' BEAKER_set=centos7"
- "PUPPET_VERSION='~> 4.5' BEAKER_set=debian7"
- "PUPPET_VERSION='~> 4.5' BEAKER_set=debian8"
Expand All @@ -22,7 +23,7 @@ script:
- "bundle exec rake lint"
- "bundle exec rake validate"
- "bundle exec rake spec SPEC_OPTS='--format documentation'"
- travis_wait 40 "bundle exec rake acceptance"
- "bundle exec rake acceptance"
notifications:
email: false
matrix:
Expand Down
36 changes: 8 additions & 28 deletions spec/acceptance/bootstrap_spec.rb
Original file line number Diff line number Diff line change
@@ -1,33 +1,13 @@
require 'spec_helper_acceptance'

describe 'Bootstrap' do
bootstrap_pp = <<-EOS
case downcase($::operatingsystem) {
'centos': {
if $::operatingsystemmajrelease == 6 {
exec { '/bin/cp /opt/rh/ruby200/enable /etc/profile.d/ruby.sh': } ->
exec { '/bin/rm /usr/bin/ruby /usr/bin/gem': } ->
exec { '/usr/sbin/alternatives --install /usr/bin/ruby ruby /opt/rh/ruby200/root/usr/bin/ruby 1000': } ->
exec { '/usr/sbin/alternatives --install /usr/bin/gem gem /opt/rh/ruby200/root/usr/bin/gem 1000': }
}
}
'ubuntu': {
if $::operatingsystemmajrelease == 12.04 {
package {'python-software-properties':} ->
exec {'/usr/bin/apt-add-repository ppa:brightbox/ruby-ng':} ->
exec {'/usr/bin/apt-get update': } ->
package {'ruby2.0': } ->
exec { '/bin/rm /usr/bin/ruby': } ->
exec { '/usr/sbin/update-alternatives --install /usr/bin/ruby ruby /usr/bin/ruby2.0 1000': }
}
}
}
EOS
osfamily = fact('osfamily')
roles = hosts[0]['roles']
t = TestManifests.new(roles, 0)
bootstrap_pp = t.bootstrap_pp()

describe '########### Node specific manifest.' do
it 'should work with no errors' do
apply_manifest(bootstrap_pp, catch_failures: true)
shell('[ -d /opt/rh/ruby200 ] && /usr/bin/gem install puppet -v 3.8.7 --no-rdoc --no-ri; true')
end
describe 'Test Entry Criteria' do
it "Should work with no errors (#{osfamily})" do
apply_manifest(bootstrap_pp, catch_failures: true)
shell('[ -d /opt/rh/ruby200 ] && /usr/bin/gem install puppet -v 3.8.7 --no-rdoc --no-ri; true')
end
end

0 comments on commit 6948004

Please sign in to comment.