lib/beaker-pe/install/pe_utils.rb in beaker-pe-0.7.0 vs lib/beaker-pe/install/pe_utils.rb in beaker-pe-0.8.0
- old
+ new
@@ -1,10 +1,11 @@
[ 'aio_defaults', 'pe_defaults', 'puppet_utils', 'windows_utils' ].each do |lib|
require "beaker/dsl/install_utils/#{lib}"
end
require "beaker-answers"
require "timeout"
+require "json"
module Beaker
module DSL
module InstallUtils
#
# This module contains methods to help installing/upgrading PE builds - including Higgs installs
@@ -492,10 +493,13 @@
# test we won't fail early in the install process.
if host == database && ! pre30database
sleep_until_puppetdb_started(database)
check_puppetdb_status_endpoint(database)
end
+ if host == dashboard
+ check_console_status_endpoint(host)
+ end
end
end
install_hosts.each do |host|
wait_for_host_in_dashboard(host)
@@ -521,10 +525,13 @@
# running before continuing
if host == database && ! pre30database
sleep_until_puppetdb_started(database)
check_puppetdb_status_endpoint(database)
end
+ if host == dashboard
+ check_console_status_endpoint(host)
+ end
end
end
end
end
@@ -691,9 +698,28 @@
sleep 1
end
end
rescue Timeout::Error
fail_test "PuppetDB took too long to start"
+ end
+
+ def check_console_status_endpoint(host)
+ if version_is_less(host['pe_ver'], '2015.2.0')
+ return true
+ end
+ Timeout.timeout(60) do
+ match = nil
+ while not match
+ 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 = JSON.parse(output.stdout)
+ match = output['classifier-service']['state'] == 'running'
+ match = match && output['rbac-service']['state'] == 'running'
+ match = match && output['activity-service']['state'] == 'running'
+ sleep 1
+ end
+ end
+ rescue Timeout::Error
+ fail_test "Console services took too long to start"
end
#Install PE based upon host configuration and options
#
# @param [Host, Array<Host>] install_hosts One or more hosts to act upon