Skip to content

Commit

Permalink
PE-19888 Add workaround for 2016.1.1 console status check error
Browse files Browse the repository at this point in the history
There is a known bug in 2016.1.1, PE-14857 which causes console status
check failure. This fix add workaround for that issue to resolve the
2016.1.1 install failure in CI
  • Loading branch information
shaigy committed Mar 20, 2017
1 parent f22ac7f commit ed002c9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/beaker-pe/install/pe_utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -838,9 +838,10 @@ def check_console_status_endpoint(host)
return true if version_is_less(host['pe_ver'], '2015.2.0')

attempts_limit = options[:pe_console_status_attempts] || 9
query_params = (host['pe_ver'] == '2016.1.1' ? '?level=critical' : '')
step 'Check Console Status Endpoint' do
match = repeat_fibonacci_style_for(attempts_limit) do
output = on(host, "curl -s -k https://localhost:4433/status/v1/services --cert /etc/puppetlabs/puppet/ssl/certs/#{host}.pem --key /etc/puppetlabs/puppet/ssl/private_keys/#{host}.pem --cacert /etc/puppetlabs/puppet/ssl/certs/ca.pem", :accept_all_exit_codes => true)
output = on(host, "curl -s -k https://localhost:4433/status/v1/services#{query_params} --cert /etc/puppetlabs/puppet/ssl/certs/#{host}.pem --key /etc/puppetlabs/puppet/ssl/private_keys/#{host}.pem --cacert /etc/puppetlabs/puppet/ssl/certs/ca.pem", :accept_all_exit_codes => true)
begin
output = JSON.parse(output.stdout)
match = output['classifier-service']['state'] == 'running'
Expand Down
8 changes: 8 additions & 0 deletions spec/beaker-pe/install/pe_utils_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1388,6 +1388,7 @@ def slice_installer_options(host)

describe '#check_console_status_endpoint' do

let(:host) { unixhost }
it 'does not do anything if version is less than 2015.2.0' do
allow(subject).to receive(:version_is_less).and_return(true)

Expand All @@ -1406,6 +1407,13 @@ def slice_installer_options(host)
expect(subject).to receive(:repeat_fibonacci_style_for).with(attempts)
subject.check_console_status_endpoint({})
end
it 'adds query param to curling url for pe version 2016.1.1' do
host[:pe_ver] = '2016.1.1'
allow(subject).to receive(:options).and_return({})
allow(subject).to receive(:version_is_less).and_return(false)
expect(subject).to receive(:on).with( anything, /.*services?level=critical.*/, anything)
subject.check_console_status_endpoint(host)
end

it 'yields false to repeat_fibonacci_style_for when conditions are not true' do
allow(subject).to receive(:options).and_return({})
Expand Down

0 comments on commit ed002c9

Please sign in to comment.