3 # Simple script to check the basic OpenStack clients
6 # jose.lausuch@ericsson.com
9 if [ -z $OS_AUTH_URL ];then
10 echo "ERROR: OS_AUTH_URL environment variable missing... Have you sourced the OpenStack credentials?"
14 echo "Checking OpenStack basic services:"
16 ip=$(echo $OS_AUTH_URL|sed 's/^.*http\:\/\///'|sed 's/.[^:]*$//')
17 echo ">>Pinging public keystone endpoint $ip..."
19 for i in `seq 1 $timeout`; do
20 ping -q -c 1 $ip &>/dev/null
22 if [ $RETVAL -eq 0 ]; then
26 if [ $i -eq $timeout ]; then
27 echo "ERROR: Cannot ping the endpoint $ip defined as env variable OS_AUTH_URL."
28 echo "OS_AUTH_URL=$OS_AUTH_URL"
33 commands=('keystone endpoint-list' 'nova list' 'neutron net-list' \
34 'glance image-list' 'cinder list')
35 for cmd in "${commands[@]}"
37 service=$(echo $cmd | awk '{print $1}')
38 echo ">>Checking $service service..."
44 echo "ERROR: Failed execution $cmd. The $service does not seem to be working."
51 echo "OpenStack services are OK."