diff --git a/spec/acceptance/class_spec.rb b/spec/acceptance/class_spec.rb new file mode 100644 index 000000000..ac16c6344 --- /dev/null +++ b/spec/acceptance/class_spec.rb @@ -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 diff --git a/spec/acceptance/nodesets/centos-64-x64.yml b/spec/acceptance/nodesets/centos-64-x64.yml new file mode 100644 index 000000000..d19aa6951 --- /dev/null +++ b/spec/acceptance/nodesets/centos-64-x64.yml @@ -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 diff --git a/spec/acceptance/nodesets/default.yml b/spec/acceptance/nodesets/default.yml new file mode 100644 index 000000000..b392dab75 --- /dev/null +++ b/spec/acceptance/nodesets/default.yml @@ -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 diff --git a/spec/acceptance/nodesets/ubuntu-server-12042-x64.yml b/spec/acceptance/nodesets/ubuntu-server-12042-x64.yml new file mode 100644 index 000000000..b392dab75 --- /dev/null +++ b/spec/acceptance/nodesets/ubuntu-server-12042-x64.yml @@ -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 diff --git a/spec/spec_helper_acceptance.rb b/spec/spec_helper_acceptance.rb new file mode 100644 index 000000000..22a9a3478 --- /dev/null +++ b/spec/spec_helper_acceptance.rb @@ -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 \ No newline at end of file