Add beaker framework.
This prepares the module for beaker acceptance tests.
This commit is contained in:
parent
e467d8f084
commit
9a3107fed1
10 changed files with 116 additions and 0 deletions
12
spec/acceptance/nodesets/centos-64-x64-pe.yml
Normal file
12
spec/acceptance/nodesets/centos-64-x64-pe.yml
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
HOSTS:
|
||||||
|
centos-64-x64:
|
||||||
|
roles:
|
||||||
|
- master
|
||||||
|
- database
|
||||||
|
- dashboard
|
||||||
|
platform: el-6-x86_64
|
||||||
|
box : centos-64-x64-vbox4210-nocm
|
||||||
|
box_url : http://puppet-vagrant-boxes.puppetlabs.com/centos-64-x64-vbox4210-nocm.box
|
||||||
|
hypervisor : vagrant
|
||||||
|
CONFIG:
|
||||||
|
type: pe
|
10
spec/acceptance/nodesets/centos-64-x64.yml
Normal file
10
spec/acceptance/nodesets/centos-64-x64.yml
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
HOSTS:
|
||||||
|
centos-64-x64:
|
||||||
|
roles:
|
||||||
|
- master
|
||||||
|
platform: el-6-x86_64
|
||||||
|
box : centos-64-x64-vbox4210-nocm
|
||||||
|
box_url : http://puppet-vagrant-boxes.puppetlabs.com/centos-64-x64-vbox4210-nocm.box
|
||||||
|
hypervisor : vagrant
|
||||||
|
CONFIG:
|
||||||
|
type: foss
|
10
spec/acceptance/nodesets/centos-65-x64.yml
Normal file
10
spec/acceptance/nodesets/centos-65-x64.yml
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
HOSTS:
|
||||||
|
centos-65-x64:
|
||||||
|
roles:
|
||||||
|
- master
|
||||||
|
platform: el-6-x86_64
|
||||||
|
box : centos-65-x64-vbox436-nocm
|
||||||
|
box_url : http://puppet-vagrant-boxes.puppetlabs.com/centos-65-x64-virtualbox-nocm.box
|
||||||
|
hypervisor : vagrant
|
||||||
|
CONFIG:
|
||||||
|
type: foss
|
1
spec/acceptance/nodesets/default.yml
Symbolic link
1
spec/acceptance/nodesets/default.yml
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
centos-64-x64.yml
|
10
spec/acceptance/nodesets/fedora-18-x64.yml
Normal file
10
spec/acceptance/nodesets/fedora-18-x64.yml
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
HOSTS:
|
||||||
|
fedora-18-x64:
|
||||||
|
roles:
|
||||||
|
- master
|
||||||
|
platform: fedora-18-x86_64
|
||||||
|
box : fedora-18-x64-vbox4210-nocm
|
||||||
|
box_url : http://puppet-vagrant-boxes.puppetlabs.com/fedora-18-x64-vbox4210-nocm.box
|
||||||
|
hypervisor : vagrant
|
||||||
|
CONFIG:
|
||||||
|
type: foss
|
10
spec/acceptance/nodesets/sles-11-x64.yml
Normal file
10
spec/acceptance/nodesets/sles-11-x64.yml
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
HOSTS:
|
||||||
|
sles-11-x64.local:
|
||||||
|
roles:
|
||||||
|
- master
|
||||||
|
platform: sles-11-x64
|
||||||
|
box : sles-11sp1-x64-vbox4210-nocm
|
||||||
|
box_url : http://puppet-vagrant-boxes.puppetlabs.com/sles-11sp1-x64-vbox4210-nocm.box
|
||||||
|
hypervisor : vagrant
|
||||||
|
CONFIG:
|
||||||
|
type: foss
|
10
spec/acceptance/nodesets/ubuntu-server-10044-x64.yml
Normal file
10
spec/acceptance/nodesets/ubuntu-server-10044-x64.yml
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
HOSTS:
|
||||||
|
ubuntu-server-10044-x64:
|
||||||
|
roles:
|
||||||
|
- master
|
||||||
|
platform: ubuntu-10.04-amd64
|
||||||
|
box : ubuntu-server-10044-x64-vbox4210-nocm
|
||||||
|
box_url : http://puppet-vagrant-boxes.puppetlabs.com/ubuntu-server-10044-x64-vbox4210-nocm.box
|
||||||
|
hypervisor : vagrant
|
||||||
|
CONFIG:
|
||||||
|
type: foss
|
10
spec/acceptance/nodesets/ubuntu-server-12042-x64.yml
Normal file
10
spec/acceptance/nodesets/ubuntu-server-12042-x64.yml
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
HOSTS:
|
||||||
|
ubuntu-server-12042-x64:
|
||||||
|
roles:
|
||||||
|
- master
|
||||||
|
platform: ubuntu-12.04-amd64
|
||||||
|
box : ubuntu-server-12042-x64-vbox4210-nocm
|
||||||
|
box_url : http://puppet-vagrant-boxes.puppetlabs.com/ubuntu-server-12042-x64-vbox4210-nocm.box
|
||||||
|
hypervisor : vagrant
|
||||||
|
CONFIG:
|
||||||
|
type: foss
|
10
spec/acceptance/unsupported_spec.rb
Normal file
10
spec/acceptance/unsupported_spec.rb
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
require 'spec_helper_acceptance'
|
||||||
|
|
||||||
|
describe 'unsupported distributions and OSes', :if => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
|
||||||
|
it 'should fail' do
|
||||||
|
pp = <<-EOS
|
||||||
|
class { 'mysql::server': }
|
||||||
|
EOS
|
||||||
|
expect(apply_manifest(pp, :expect_failures => true).stderr).to match(/unsupported osfamily/i)
|
||||||
|
end
|
||||||
|
end
|
33
spec/spec_helper_acceptance.rb
Normal file
33
spec/spec_helper_acceptance.rb
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
require 'beaker-rspec'
|
||||||
|
|
||||||
|
UNSUPPORTED_PLATFORMS = []
|
||||||
|
|
||||||
|
unless ENV['RS_PROVISION'] == 'no'
|
||||||
|
hosts.each do |host|
|
||||||
|
# Install Puppet
|
||||||
|
if host.is_pe?
|
||||||
|
install_pe
|
||||||
|
else
|
||||||
|
install_package host, 'rubygems'
|
||||||
|
on host, 'gem install puppet --no-ri --no-rdoc'
|
||||||
|
on host, "mkdir -p #{host['distmoduledir']}"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
RSpec.configure do |c|
|
||||||
|
# Project root
|
||||||
|
proj_root = File.expand_path(File.join(File.dirname(__FILE__), '..'))
|
||||||
|
|
||||||
|
# Readable test descriptions
|
||||||
|
c.formatter = :documentation
|
||||||
|
|
||||||
|
# Configure all nodes in nodeset
|
||||||
|
c.before :suite do
|
||||||
|
# Install module and dependencies
|
||||||
|
puppet_module_install(:source => proj_root, :module_name => 'stdlib')
|
||||||
|
hosts.each do |host|
|
||||||
|
shell('/bin/touch /etc/puppet/hiera.yaml')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in a new issue