Merge "Fix curl issue when SERVICE_HOST is defined to IPv6 address"
This commit is contained in:
commit
473d83d57b
@ -36,7 +36,7 @@ source $TOP_DIR/exerciserc
|
|||||||
is_service_enabled horizon || exit 55
|
is_service_enabled horizon || exit 55
|
||||||
|
|
||||||
# can we get the front page
|
# can we get the front page
|
||||||
curl http://$SERVICE_HOST 2>/dev/null | grep -q '<h3.*>Log In</h3>' || die $LINENO "Horizon front page not functioning!"
|
$CURL_GET http://$SERVICE_HOST 2>/dev/null | grep -q '<h3.*>Log In</h3>' || die $LINENO "Horizon front page not functioning!"
|
||||||
|
|
||||||
set +o xtrace
|
set +o xtrace
|
||||||
echo "*********************************************************************"
|
echo "*********************************************************************"
|
||||||
|
@ -35,7 +35,7 @@ source $TOP_DIR/exerciserc
|
|||||||
|
|
||||||
is_service_enabled sahara || exit 55
|
is_service_enabled sahara || exit 55
|
||||||
|
|
||||||
curl http://$SERVICE_HOST:8386/ 2>/dev/null | grep -q 'Auth' || die $LINENO "Sahara API isn't functioning!"
|
$CURL_GET http://$SERVICE_HOST:8386/ 2>/dev/null | grep -q 'Auth' || die $LINENO "Sahara API isn't functioning!"
|
||||||
|
|
||||||
set +o xtrace
|
set +o xtrace
|
||||||
echo "*********************************************************************"
|
echo "*********************************************************************"
|
||||||
|
@ -35,7 +35,7 @@ source $TOP_DIR/exerciserc
|
|||||||
|
|
||||||
is_service_enabled zaqar-server || exit 55
|
is_service_enabled zaqar-server || exit 55
|
||||||
|
|
||||||
curl http://$SERVICE_HOST:8888/v1/ 2>/dev/null | grep -q 'queue_name' || die $LINENO "Zaqar API not functioning!"
|
$CURL_GET http://$SERVICE_HOST:8888/v1/ 2>/dev/null | grep -q 'queue_name' || die $LINENO "Zaqar API not functioning!"
|
||||||
|
|
||||||
set +o xtrace
|
set +o xtrace
|
||||||
echo "*********************************************************************"
|
echo "*********************************************************************"
|
||||||
|
@ -325,13 +325,15 @@ function use_database {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#Macro for curl statements. curl requires -g option for literal IPv6 addresses.
|
||||||
|
CURL_GET="${CURL_GET:-curl -g}"
|
||||||
|
|
||||||
# Wait for an HTTP server to start answering requests
|
# Wait for an HTTP server to start answering requests
|
||||||
# wait_for_service timeout url
|
# wait_for_service timeout url
|
||||||
function wait_for_service {
|
function wait_for_service {
|
||||||
local timeout=$1
|
local timeout=$1
|
||||||
local url=$2
|
local url=$2
|
||||||
timeout $timeout sh -c "while ! curl -k --noproxy '*' -s $url >/dev/null; do sleep 1; done"
|
timeout $timeout sh -c "while ! $CURL_GET -k --noproxy '*' -s $url >/dev/null; do sleep 1; done"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -340,7 +340,7 @@ function start_ceilometer {
|
|||||||
# only die on API if it was actually intended to be turned on
|
# only die on API if it was actually intended to be turned on
|
||||||
if is_service_enabled ceilometer-api; then
|
if is_service_enabled ceilometer-api; then
|
||||||
echo "Waiting for ceilometer-api to start..."
|
echo "Waiting for ceilometer-api to start..."
|
||||||
if ! timeout $SERVICE_TIMEOUT sh -c "while ! curl --noproxy '*' -s http://localhost:8777/v2/ >/dev/null; do sleep 1; done"; then
|
if ! wait_for_service $SERVICE_TIMEOUT $CEILOMETER_SERVICE_PROTOCOL://$CEILOMETER_SERVICE_HOST:$CEILOMETER_SERVICE_PORT/v2/; then
|
||||||
die $LINENO "ceilometer-api did not start"
|
die $LINENO "ceilometer-api did not start"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
@ -564,7 +564,7 @@ function start_keystone {
|
|||||||
# Check that the keystone service is running. Even if the tls tunnel
|
# Check that the keystone service is running. Even if the tls tunnel
|
||||||
# should be enabled, make sure the internal port is checked using
|
# should be enabled, make sure the internal port is checked using
|
||||||
# unencryted traffic at this point.
|
# unencryted traffic at this point.
|
||||||
if ! timeout $SERVICE_TIMEOUT sh -c "while ! curl --noproxy '*' -k -s $auth_protocol://$KEYSTONE_SERVICE_HOST:$service_port/v$IDENTITY_API_VERSION/ >/dev/null; do sleep 1; done"; then
|
if ! wait_for_service $SERVICE_TIMEOUT $auth_protocol://$KEYSTONE_SERVICE_HOST:$service_port/v$IDENTITY_API_VERSION/; then
|
||||||
die $LINENO "keystone did not start"
|
die $LINENO "keystone did not start"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user