spec_helper_acceptance.rb 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. require 'beaker-rspec'
  2. # Install Puppet
  3. unless ENV['RS_PROVISION'] == 'no'
  4. # This will install the latest available package on el and deb based
  5. # systems fail on windows and osx, and install via gem on other *nixes
  6. foss_opts = { :default_action => 'gem_install' }
  7. if default.is_pe?; then install_pe; else install_puppet( foss_opts ); end
  8. hosts.each do |host|
  9. on host, "mkdir -p #{host['distmoduledir']}"
  10. end
  11. end
  12. UNSUPPORTED_PLATFORMS = ['RedHat','Suse','windows','AIX','Solaris']
  13. RSpec.configure do |c|
  14. # Project root
  15. proj_root = File.expand_path(File.join(File.dirname(__FILE__), '..'))
  16. # Readable test descriptions
  17. c.formatter = :documentation
  18. # Configure all nodes in nodeset
  19. c.before :suite do
  20. # Install module and dependencies
  21. hosts.each do |host|
  22. copy_module_to(host, :source => proj_root, :module_name => 'apt')
  23. shell("/bin/touch #{default['puppetpath']}/hiera.yaml")
  24. on host, puppet('module install puppetlabs-stdlib --version 4.5.0'), { :acceptable_exit_codes => [0,1] }
  25. end
  26. end
  27. end