1 require 'rspec-system/spec_helper'
2 require 'rspec-system-puppet/helpers'
6 include RSpecSystem::Util
8 def psql(psql_cmd, user = 'postgres', &block)
9 psql = "psql #{psql_cmd}"
10 shell("su #{shellescape(user)} -c #{shellescape(psql)}", &block)
14 include RSpecSystemPuppet::Helpers
16 RSpec.configure do |c|
17 # Project root for the firewall code
18 proj_root = File.expand_path(File.join(File.dirname(__FILE__), '..'))
20 # Enable colour in Jenkins
23 # Include in our local helpers
24 c.include ::LocalHelpers
27 c.include RSpecSystemPuppet::Helpers
28 c.extend RSpecSystemPuppet::Helpers
30 # This is where we 'setup' the nodes before running our tests
35 # Copy this module into the module path of the test node
36 puppet_module_install(:source => proj_root, :module_name => 'postgresql')
37 shell('puppet module install puppetlabs/stdlib')
38 shell('puppet module install puppetlabs/firewall')
39 shell('puppet module install puppetlabs/apt')
40 shell('puppet module install ripienaar/concat')
42 file = Tempfile.new('foo')
49 rcp(:sp => file.path, :dp => '/etc/puppet/hiera.yaml')