Skip to content

Commit 4a46142

Browse files
author
Ashley Penney
committed
Merge pull request #234 from apenney/add-beaker
Add beaker framework.
2 parents e467d8f + 9a3107f commit 4a46142

10 files changed

+116
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
HOSTS:
2+
centos-64-x64:
3+
roles:
4+
- master
5+
- database
6+
- dashboard
7+
platform: el-6-x86_64
8+
box : centos-64-x64-vbox4210-nocm
9+
box_url : http://puppet-vagrant-boxes.puppetlabs.com/centos-64-x64-vbox4210-nocm.box
10+
hypervisor : vagrant
11+
CONFIG:
12+
type: pe
+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
HOSTS:
2+
centos-64-x64:
3+
roles:
4+
- master
5+
platform: el-6-x86_64
6+
box : centos-64-x64-vbox4210-nocm
7+
box_url : http://puppet-vagrant-boxes.puppetlabs.com/centos-64-x64-vbox4210-nocm.box
8+
hypervisor : vagrant
9+
CONFIG:
10+
type: foss
+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
HOSTS:
2+
centos-65-x64:
3+
roles:
4+
- master
5+
platform: el-6-x86_64
6+
box : centos-65-x64-vbox436-nocm
7+
box_url : http://puppet-vagrant-boxes.puppetlabs.com/centos-65-x64-virtualbox-nocm.box
8+
hypervisor : vagrant
9+
CONFIG:
10+
type: foss

spec/acceptance/nodesets/default.yml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
centos-64-x64.yml
+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
HOSTS:
2+
fedora-18-x64:
3+
roles:
4+
- master
5+
platform: fedora-18-x86_64
6+
box : fedora-18-x64-vbox4210-nocm
7+
box_url : http://puppet-vagrant-boxes.puppetlabs.com/fedora-18-x64-vbox4210-nocm.box
8+
hypervisor : vagrant
9+
CONFIG:
10+
type: foss
+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
HOSTS:
2+
sles-11-x64.local:
3+
roles:
4+
- master
5+
platform: sles-11-x64
6+
box : sles-11sp1-x64-vbox4210-nocm
7+
box_url : http://puppet-vagrant-boxes.puppetlabs.com/sles-11sp1-x64-vbox4210-nocm.box
8+
hypervisor : vagrant
9+
CONFIG:
10+
type: foss
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
HOSTS:
2+
ubuntu-server-10044-x64:
3+
roles:
4+
- master
5+
platform: ubuntu-10.04-amd64
6+
box : ubuntu-server-10044-x64-vbox4210-nocm
7+
box_url : http://puppet-vagrant-boxes.puppetlabs.com/ubuntu-server-10044-x64-vbox4210-nocm.box
8+
hypervisor : vagrant
9+
CONFIG:
10+
type: foss
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
HOSTS:
2+
ubuntu-server-12042-x64:
3+
roles:
4+
- master
5+
platform: ubuntu-12.04-amd64
6+
box : ubuntu-server-12042-x64-vbox4210-nocm
7+
box_url : http://puppet-vagrant-boxes.puppetlabs.com/ubuntu-server-12042-x64-vbox4210-nocm.box
8+
hypervisor : vagrant
9+
CONFIG:
10+
type: foss

spec/acceptance/unsupported_spec.rb

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
require 'spec_helper_acceptance'
2+
3+
describe 'unsupported distributions and OSes', :if => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
4+
it 'should fail' do
5+
pp = <<-EOS
6+
class { 'mysql::server': }
7+
EOS
8+
expect(apply_manifest(pp, :expect_failures => true).stderr).to match(/unsupported osfamily/i)
9+
end
10+
end

spec/spec_helper_acceptance.rb

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
require 'beaker-rspec'
2+
3+
UNSUPPORTED_PLATFORMS = []
4+
5+
unless ENV['RS_PROVISION'] == 'no'
6+
hosts.each do |host|
7+
# Install Puppet
8+
if host.is_pe?
9+
install_pe
10+
else
11+
install_package host, 'rubygems'
12+
on host, 'gem install puppet --no-ri --no-rdoc'
13+
on host, "mkdir -p #{host['distmoduledir']}"
14+
end
15+
end
16+
end
17+
18+
RSpec.configure do |c|
19+
# Project root
20+
proj_root = File.expand_path(File.join(File.dirname(__FILE__), '..'))
21+
22+
# Readable test descriptions
23+
c.formatter = :documentation
24+
25+
# Configure all nodes in nodeset
26+
c.before :suite do
27+
# Install module and dependencies
28+
puppet_module_install(:source => proj_root, :module_name => 'stdlib')
29+
hosts.each do |host|
30+
shell('/bin/touch /etc/puppet/hiera.yaml')
31+
end
32+
end
33+
end

0 commit comments

Comments
 (0)