Skip to content

Commit 810c2d8

Browse files
committed
Merge pull request #158 from cowofevil/maint/master/FM-5041/install_pe_license
(FM-5041) Install PE License for Acceptance Testing
2 parents b532b89 + 07847ed commit 810c2d8

File tree

2 files changed

+39
-19
lines changed

2 files changed

+39
-19
lines changed

spec/spec_helper_acceptance.rb

+20-19
Original file line numberDiff line numberDiff line change
@@ -18,37 +18,38 @@
1818
end
1919
end
2020

21+
# Install PE
2122
run_puppet_install_helper
2223

24+
# Install PE License onto Master
25+
install_pe_license(master)
26+
2327
unless ENV['MODULE_provision'] == 'no'
2428
agents.each do |agent|
2529
# Emit CommonProgramFiles environment variable
2630
program_files = agent.get_env_var('ProgramFiles').split('=')[1]
2731
agent.add_env_var('CommonProgramFiles', "#{program_files}\\Common Files")
2832

29-
# Install sqlserver module to agent
30-
result = on agent, "echo #{agent['distmoduledir']}"
31-
target = result.raw_output.chomp
32-
proj_root = File.expand_path(File.join(File.dirname(__FILE__), '..'))
33-
exec_puppet = <<-EOS
34-
exec{'Download':
35-
command => 'powershell.exe -command "Invoke-WebRequest https://forgeapi.puppetlabs.com"',
36-
path => ['c:\\windows\\sysnative\\WindowsPowershell\\v1.0','c:\\windows\\system32\\WindowsPowershell\\v1.0'],
37-
}
38-
EOS
39-
apply_manifest_on(agent, exec_puppet)
40-
%w(puppetlabs/stdlib cyberious/pget).each do |dep|
41-
on agent, puppet("module install #{dep}")
33+
# Install Forge certs to allow for PMT installation.
34+
install_ca_certs(agent)
35+
36+
# Install test helper modules onto agent.
37+
%w(puppetlabs-mount_iso cyberious-pget).each do |dep|
38+
on(agent, puppet("module install #{dep}"))
4239
end
43-
on agent, "git clone https://github.com/puppetlabs/puppetlabs-mount_iso #{target}/mount_iso"
4440

45-
install_ca_certs(agent)
41+
# Determine root path of local module source.
42+
proj_root = File.expand_path(File.join(File.dirname(__FILE__), '..'))
4643

47-
# in CI install from staging forge, otherwise from local
44+
# In CI install from staging forge, otherwise from local
4845
staging = { :module_name => 'puppetlabs-sqlserver' }
49-
local = { :module_name => 'sqlserver', :proj_root => proj_root, :target_module_path => target }
46+
local = { :module_name => 'sqlserver', :source => proj_root }
5047

51-
install_dev_puppet_module_on(agent, options[:forge_host] ? staging : local)
48+
# Install sqlserver dependencies.
49+
on(agent, puppet('module install puppetlabs-stdlib'))
50+
51+
# Install sqlserver module from local source.
52+
# See FM-5062 for more details.
53+
copy_module_to(agent, local)
5254
end
5355
end
54-

spec/sql_testing_helpers.rb

+19
Original file line numberDiff line numberDiff line change
@@ -235,3 +235,22 @@ def install_ca_certs(host)
235235
on host, "chmod 644 equifax.pem"
236236
on host, "cmd /c certutil -v -addstore Root `cygpath -w equifax.pem`"
237237
end
238+
239+
def install_pe_license(host)
240+
# Init
241+
license = <<-EOF
242+
#######################
243+
# Begin License File #
244+
#######################
245+
# PUPPET ENTERPRISE LICENSE - Puppet Labs
246+
to: qa
247+
nodes: 100
248+
start: 2016-03-31
249+
end: 2026-03-31
250+
#####################
251+
# End License File #
252+
#####################
253+
EOF
254+
255+
create_remote_file(host, '/etc/puppetlabs/license.key', license)
256+
end

0 commit comments

Comments
 (0)