forked from eperdeme/puppet-iis_rewrite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
spec_helper_acceptance.rb
49 lines (31 loc) · 1.31 KB
/
spec_helper_acceptance.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
require 'beaker-rspec/spec_helper'
require 'beaker-rspec/helpers/serverspec'
hosts.each do |host|
if host['platform'] =~ /windows/
include Serverspec::Helper::Windows
include Serverspec::Helper::WinRM
end
version = ENV['PUPPET_GEM_VERSION']
install_puppet(:version => version)
end
Spec.configure do |c|
proj_root = File.expand_path(File.join(File.dirname(__FILE__), '..'))
c.formatter = :documentation
c.before :suite do
#The gets around a bug where windows can't validate the cert when using https
forge_repo = '--module_repository=http://forge.puppetlabs.com'
hosts.each do |host|
c.host = host
if host['platform'] =~ /windows/
endpoint = "http://127.0.0.1:5985/wsman"
c.winrm = ::WinRM::WinRMWebService.new(endpoint, :ssl, :user => 'vagrant', :pass => 'vagrant', :basic_auth_only => true)
c.winrm.set_timeout 300
end
path = (File.expand_path(File.dirname(__FILE__)+'/../')).split('/')
name = path[path.length-1].split('-')[1]
copy_module_to(host, :source => proj_root, :module_name => name)
on host, puppet('module','install', forge_repo, "puppetlabs-stdlib"), { :acceptable_exit_codes => [0,1] }
on host, puppet('module','install', forge_repo, "opentable-download_file"), { :acceptable_exit_codes => [0,1] }
end
end
end