2015-04-23 19:41:31 -06:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
|
|
|
# This is a script that kicks off a series of functional tests against a
|
|
|
|
# OpenStack devstack cloud. This script is intended to work as a gate
|
|
|
|
# in project-config for the Python SDK.
|
|
|
|
|
|
|
|
DIR=$(cd $(dirname "$0") && pwd)
|
|
|
|
|
|
|
|
echo "Running SDK functional test suite"
|
|
|
|
sudo -H -u stack -i <<!
|
2017-04-29 14:39:35 +00:00
|
|
|
export OS_CLOUD=devstack-admin
|
2015-04-23 19:41:31 -06:00
|
|
|
echo 'Running tests with:'
|
2017-04-29 14:39:35 +00:00
|
|
|
cat /etc/openstack/clouds.yaml
|
2015-05-20 11:06:46 -07:00
|
|
|
|
2015-04-23 19:41:31 -06:00
|
|
|
cd ${DIR}
|
2015-11-25 13:36:55 -07:00
|
|
|
echo '=functional=============================================='
|
2017-04-06 20:20:59 -05:00
|
|
|
if [[ -n "$1" ]]; then
|
|
|
|
tox -e functional -- $1
|
|
|
|
else
|
|
|
|
tox -e functional
|
|
|
|
fi
|
2015-12-08 12:13:42 -07:00
|
|
|
FUNCTIONAL_RESULT=\$?
|
2015-11-25 13:36:55 -07:00
|
|
|
echo '=examples================================================'
|
|
|
|
tox -e examples
|
2015-12-08 12:13:42 -07:00
|
|
|
EXAMPLES_RESULT=\$?
|
2015-11-25 13:36:55 -07:00
|
|
|
echo '========================================================='
|
2015-12-08 12:13:42 -07:00
|
|
|
echo "Functional test result: \$FUNCTIONAL_RESULT"
|
|
|
|
echo "Examples test result: \$EXAMPLES_RESULT"
|
|
|
|
test \$FUNCTIONAL_RESULT == 0 -a \$EXAMPLES_RESULT == 0
|
2015-04-23 19:41:31 -06:00
|
|
|
!
|
|
|
|
# TODO(thowe) For now we are going to ignore tests failures
|
|
|
|
# It is easier to change this script than the gate. The magic
|
|
|
|
# string fro this script should probably specify the -e option
|
|
|
|
# so the script will fail immediately if a command fails.
|
|
|
|
exit 0
|