diff options
-rwxr-xr-x | docker/run_tests.sh | 7 | ||||
-rwxr-xr-x | testcases/VIM/OpenStack/CI/libraries/check_os.sh | 53 | ||||
-rw-r--r-- | testcases/config_functest.yaml | 2 |
3 files changed, 61 insertions, 1 deletions
diff --git a/docker/run_tests.sh b/docker/run_tests.sh index c75110b3..00d53487 100755 --- a/docker/run_tests.sh +++ b/docker/run_tests.sh @@ -175,6 +175,13 @@ fi info "Sourcing Credentials ${FUNCTEST_CONF_DIR}/openstack.creds to run the tests.." source ${FUNCTEST_CONF_DIR}/openstack.creds +# Check OpenStack +info "Checking that the basic OpenStack services are functional..." +${FUNCTEST_REPO_DIR}/testcases/VIM/OpenStack/CI/libraries/check_os.sh +RETVAL=$? +if [ $RETVAL -ne 0 ]; then + exit 1 +fi # Run tests if [ "${TEST}" != "" ]; then diff --git a/testcases/VIM/OpenStack/CI/libraries/check_os.sh b/testcases/VIM/OpenStack/CI/libraries/check_os.sh new file mode 100755 index 00000000..09d98343 --- /dev/null +++ b/testcases/VIM/OpenStack/CI/libraries/check_os.sh @@ -0,0 +1,53 @@ +#!/bin/bash +# +# Simple script to check the basic OpenStack clients +# +# Author: +# jose.lausuch@ericsson.com +# + +if [ -z $OS_AUTH_URL ];then + echo "ERROR: OS_AUTH_URL environment variable missing... Have you sourced the OpenStack credentials?" + exit 1 +fi + +echo "Checking OpenStack basic services:" + +ip=$(echo $OS_AUTH_URL|sed 's/^.*http\:\/\///'|sed 's/.[^:]*$//') +ip='192.168.123.123' +echo ">>Pinging public keystone endpoint $ip..." +timeout=5 +for i in `seq 1 $timeout`; do + ping -q -c 1 $ip &>/dev/null + RETVAL=$? + if [ $RETVAL -eq 0 ]; then + break + fi +done +if [ $i -eq $timeout ]; then + echo "ERROR: Cannot ping the endpoint $ip defined as env variable OS_AUTH_URL." + echo "OS_AUTH_URL=$OS_AUTH_URL" + exit 1 +fi +echo " ...OK" + +commands=('keystone endpoint-list' 'nova list' 'neutron net-list' \ + 'glance image-list' 'cinder list') +for cmd in "${commands[@]}" +do + service=$(echo $cmd | awk '{print $1}') + echo ">>Checking $service service..." + $cmd &>/dev/null + result=$? + if [ $result -ne 0 ]; + then + + echo "ERROR: Failed execution $cmd. The $service does not seem to be working." + exit 1 + else + echo " ...OK" + fi +done + +echo "OpenStack services are OK." +exit 0 diff --git a/testcases/config_functest.yaml b/testcases/config_functest.yaml index 74af3549..ce56517e 100644 --- a/testcases/config_functest.yaml +++ b/testcases/config_functest.yaml @@ -108,7 +108,7 @@ vIMS: name: "clearwater-opnfv" destination_folder: "opnfv-cloudify-clearwater" url: 'https://github.com/Orange-OpenSource/opnfv-cloudify-clearwater.git' - branch: "master" + branch: "stable" deployment-name: 'clearwater-opnfv' inputs: image_id: '' |