forked from redhat-openstack/openstack-puppet-modules
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request redhat-openstack#207 from petems/add_beaker_tests
Basic acceptance test with beaker
- Loading branch information
Showing
5 changed files
with
85 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
require 'spec_helper_acceptance' | ||
|
||
describe 'collectd class' do | ||
|
||
context 'default parameters' do | ||
# Using puppet_apply as a helper | ||
it 'should work idempotently with no errors' do | ||
pp = <<-EOS | ||
class { 'collectd': } | ||
EOS | ||
|
||
# Run it twice and test for idempotency | ||
apply_manifest(pp, :catch_failures => true) | ||
apply_manifest(pp, :catch_changes => true) | ||
end | ||
|
||
describe package('collectd') do | ||
it { should be_installed } | ||
end | ||
|
||
describe service('collectd') do | ||
it { should be_running } | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
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: | ||
log_level: verbose | ||
type: foss |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
HOSTS: | ||
ubuntu-server-12042-x64: | ||
roles: | ||
- master | ||
platform: ubuntu-server-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: | ||
log_level: verbose | ||
type: foss |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
HOSTS: | ||
ubuntu-server-12042-x64: | ||
roles: | ||
- master | ||
platform: ubuntu-server-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: | ||
log_level: verbose | ||
type: foss |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
require 'beaker-rspec/spec_helper' | ||
require 'beaker-rspec/helpers/serverspec' | ||
|
||
hosts.each do |host| | ||
# Install Puppet | ||
install_puppet | ||
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 => 'collectd') | ||
hosts.each do |host| | ||
on host, puppet('module', 'install', 'puppetlabs-stdlib'), { :acceptable_exit_codes => [0] } | ||
on host, puppet('module', 'install', 'puppetlabs-concat'), { :acceptable_exit_codes => [0] } | ||
end | ||
end | ||
end |