module-puppetdb/spec/system/basic_spec.rb
Ken Barber 603df7381d (GH-93) Switch to using puppetlabs-postgresql 3.x
This updates the module to be able to use puppetlabs-postgresql.

Since this change is a major change, it marks this patch as a breaking change.

I have prepared a suitable amount of upgrade notes for upgrading to this later
version of the module plus removed anything marked deprecated.

As cleanup, I've removed the troublesome 'tests' directory in favour of good
README.md documentation. I've also removed any puppet docs from each module
until such times as puppet docs become automated through the forge. This is
just to avoid contributors having to double their efforts - the README.md
is the authority now.

Signed-off-by: Ken Barber <ken@bob.sh>
2013-10-21 18:43:41 +01:00

69 lines
1.6 KiB
Ruby

require 'spec_helper_system'
describe 'basic tests:' do
it 'make sure we have copied the module across' do
# No point diagnosing any more if the module wasn't copied properly
shell("ls /etc/puppet/modules/puppetdb") do |r|
r[:exit_code].should == 0
r[:stdout].should =~ /Modulefile/
r[:stderr].should == ''
end
end
it 'make sure a puppet agent has ran' do
puppet_agent do |r|
r[:stderr].should == ''
r[:exit_code].should == 0
end
end
describe 'single node setup' do
let(:pp) do
pp = <<-EOS
# Single node setup
class { 'puppetdb': }
class { 'puppetdb::master::config': }
EOS
end
it 'make sure it runs without error' do
shell('puppet module install puppetlabs/stdlib')
shell('puppet module install puppetlabs/postgresql --version 3.0.0')
shell('puppet module install puppetlabs/firewall')
shell('puppet module install puppetlabs/inifile')
puppet_apply(pp) do |r|
r[:exit_code].should_not eq(1)
end
end
it 'should be idempotent' do
puppet_apply(:code => pp, :debug => true) do |r|
r[:exit_code].should == 0
end
end
end
describe 'enabling report processor' do
let(:pp) do
pp = <<-EOS
class { 'puppetdb::master::config':
manage_report_processor => true,
enable_reports => true
}
EOS
end
it 'should add the puppetdb report processor to puppet.conf' do
puppet_apply(pp) do |r|
r[:exit_code].should_not eq(1)
end
shell("cat /etc/puppet/puppet.conf") do |r|
r[:stdout].should =~ /^reports\s*=\s*([^,]+,)*puppetdb(,[^,]+)*$/
end
end
end
end