Skip to content

(FM-5041) Install PE License for Acceptance Testing #158

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 5, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 20 additions & 19 deletions spec/spec_helper_acceptance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

19 changes: 19 additions & 0 deletions spec/sql_testing_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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