diff --git a/spec/spec_helper_acceptance.rb b/spec/spec_helper_acceptance.rb index 51578418..15454ef2 100644 --- a/spec/spec_helper_acceptance.rb +++ b/spec/spec_helper_acceptance.rb @@ -18,37 +18,38 @@ end end +# Install PE run_puppet_install_helper +# Install PE License onto Master +install_pe_license(master) + unless ENV['MODULE_provision'] == 'no' agents.each do |agent| # Emit CommonProgramFiles environment variable program_files = agent.get_env_var('ProgramFiles').split('=')[1] agent.add_env_var('CommonProgramFiles', "#{program_files}\\Common Files") - # Install sqlserver module to agent - result = on agent, "echo #{agent['distmoduledir']}" - target = result.raw_output.chomp - proj_root = File.expand_path(File.join(File.dirname(__FILE__), '..')) - exec_puppet = <<-EOS - exec{'Download': - command => 'powershell.exe -command "Invoke-WebRequest https://forgeapi.puppetlabs.com"', - path => ['c:\\windows\\sysnative\\WindowsPowershell\\v1.0','c:\\windows\\system32\\WindowsPowershell\\v1.0'], - } - EOS - apply_manifest_on(agent, exec_puppet) - %w(puppetlabs/stdlib cyberious/pget).each do |dep| - on agent, puppet("module install #{dep}") + # Install Forge certs to allow for PMT installation. + install_ca_certs(agent) + + # Install test helper modules onto agent. + %w(puppetlabs-mount_iso cyberious-pget).each do |dep| + on(agent, puppet("module install #{dep}")) end - on agent, "git clone https://github.com/puppetlabs/puppetlabs-mount_iso #{target}/mount_iso" - install_ca_certs(agent) + # Determine root path of local module source. + proj_root = File.expand_path(File.join(File.dirname(__FILE__), '..')) - # in CI install from staging forge, otherwise from local + # In CI install from staging forge, otherwise from local staging = { :module_name => 'puppetlabs-sqlserver' } - local = { :module_name => 'sqlserver', :proj_root => proj_root, :target_module_path => target } + local = { :module_name => 'sqlserver', :source => proj_root } - install_dev_puppet_module_on(agent, options[:forge_host] ? staging : local) + # Install sqlserver dependencies. + on(agent, puppet('module install puppetlabs-stdlib')) + + # Install sqlserver module from local source. + # See FM-5062 for more details. + copy_module_to(agent, local) end end - diff --git a/spec/sql_testing_helpers.rb b/spec/sql_testing_helpers.rb index ec164d0b..a9eeb426 100644 --- a/spec/sql_testing_helpers.rb +++ b/spec/sql_testing_helpers.rb @@ -235,3 +235,22 @@ def install_ca_certs(host) on host, "chmod 644 equifax.pem" on host, "cmd /c certutil -v -addstore Root `cygpath -w equifax.pem`" end + +def install_pe_license(host) + # Init + license = <<-EOF +####################### +# Begin License File # +####################### +# PUPPET ENTERPRISE LICENSE - Puppet Labs +to: qa +nodes: 100 +start: 2016-03-31 +end: 2026-03-31 +##################### +# End License File # +##################### +EOF + + create_remote_file(host, '/etc/puppetlabs/license.key', license) +end