Skip to content

(BKR-914) Add workaround for beaker bug BKR-914 #184

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
Aug 17, 2016
Merged
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
26 changes: 24 additions & 2 deletions spec/spec_helper_acceptance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,30 @@
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")
common_program_files = agent.get_env_var('CommonProgramFiles')

# Workarounds due to BKR-914
# - newline chars indicate matching more than one env var
# - env var key matching is very loose. e.g. CommonProgramFiles(x86) can be returned
common_program_files = "" if common_program_files.include?("\n")
common_program_files = "" unless common_program_files.start_with?("CommonProgramFiles=")
# If the env var is not found use a workaround to inject regex into the grep call
common_program_files = agent.get_env_var('^CommonProgramFiles=') if common_program_files == ""

if common_program_files == ""
program_files = agent.get_env_var('PROGRAMFILES')

# Workarounds due to BKR-914
# - newline chars indicate matching more than one env var
# - env var key matching is very loose. e.g. ProgramFiles(x86) can be returned
program_files = "" if program_files.include?("\n")
program_files = "" unless program_files.start_with?("PROGRAMFILES=")
# If the env var is not found use a workaround to inject regex into the grep call
program_files = agent.get_env_var('^PROGRAMFILES=') if program_files == ""

program_files = program_files.split('=')[1]
agent.add_env_var('CommonProgramFiles', "#{program_files}\\Common Files")
end

# Install Forge certs to allow for PMT installation.
install_ca_certs(agent)
Expand Down