From 742982af4bb94b73a78c06688732acf1c8127f8a Mon Sep 17 00:00:00 2001 From: Steve Martinelli Date: Fri, 19 Sep 2014 02:42:55 +0000 Subject: Add functional tests to osc Create a script that kicks off function tests that exercise openstackclient commands against a cloud. If no keystone/openstack process is detected, a devstack instance is spun up and the tests are run against that. There is also a hook added to tox.ini so that we can run these tests easily from a gate job. Change-Id: I3cc8b2b800de7ca74af506d2c7e8ee481fa985f0 --- functional/harpoon.sh | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100755 functional/harpoon.sh (limited to 'functional/harpoon.sh') diff --git a/functional/harpoon.sh b/functional/harpoon.sh new file mode 100755 index 00000000..76c10ffb --- /dev/null +++ b/functional/harpoon.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +FUNCTIONAL_TEST_DIR=$(cd $(dirname "$0") && pwd) +source $FUNCTIONAL_TEST_DIR/harpoonrc + +OPENSTACKCLIENT_DIR=$FUNCTIONAL_TEST_DIR/.. + +if [[ -z $DEVSTACK_DIR ]]; then + echo "guessing location of devstack" + DEVSTACK_DIR=$OPENSTACKCLIENT_DIR/../devstack +fi + +function setup_credentials { + RC_FILE=$DEVSTACK_DIR/accrc/$HARPOON_USER/$HARPOON_TENANT + source $RC_FILE + echo 'sourcing' $RC_FILE + echo 'running tests with' + env | grep OS +} + +function run_tests { + cd $FUNCTIONAL_TEST_DIR + python -m testtools.run discover + rvalue=$? + cd $OPENSTACKCLIENT_DIR + exit $rvalue +} + +setup_credentials +run_tests -- cgit v1.2.1