basic_spec.rb 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. require 'spec_helper_acceptance'
  2. describe 'basic tests:' do
  3. it 'make sure we have copied the module across' do
  4. # No point diagnosing any more if the module wasn't copied properly
  5. shell("ls /etc/puppet/modules/puppetdb") do |r|
  6. r.exit_code.should == 0
  7. r.stdout.should =~ /Modulefile/
  8. r.stderr.should == ''
  9. end
  10. end
  11. describe 'single node setup' do
  12. pp = <<-EOS
  13. # Single node setup
  14. class { 'ntp': panic => false } ->
  15. class { 'puppetdb': disable_ssl => true, } ->
  16. class { 'puppetdb::master::config': puppetdb_port => '8080', puppetdb_server => 'localhost' }
  17. EOS
  18. it 'make sure it runs without error' do
  19. apply_manifest(pp, :catch_errors => true)
  20. apply_manifest(pp, :catch_changes => true)
  21. end
  22. end
  23. describe 'enabling report processor' do
  24. pp = <<-EOS
  25. class { 'ntp': panic => false } ->
  26. class { 'puppetdb': disable_ssl => true, } ->
  27. class { 'puppetdb::master::config':
  28. puppetdb_port => '8080',
  29. manage_report_processor => true,
  30. enable_reports => true,
  31. puppetdb_server => 'localhost'
  32. }
  33. EOS
  34. it 'should add the puppetdb report processor to puppet.conf' do
  35. apply_manifest(pp, :catch_errors => true)
  36. apply_manifest(pp, :catch_changes => true)
  37. shell('cat /etc/puppet/puppet.conf') do |r|
  38. expect(r.stdout).to match(/^reports\s*=\s*([^,]+,)*puppetdb(,[^,]+)*$/)
  39. end
  40. end
  41. end
  42. end