summaryrefslogtreecommitdiff
path: root/functional/harpoon.sh
diff options
context:
space:
mode:
authorSteve Martinelli <stevemar@ca.ibm.com>2014-09-19 02:42:55 +0000
committerSteve Martinelli <stevemar@ca.ibm.com>2014-10-01 19:46:07 -0400
commit742982af4bb94b73a78c06688732acf1c8127f8a (patch)
tree0c84f0dbcb181e044c440bf7411811b014d72495 /functional/harpoon.sh
parent02320a5a2437acdc501a003cca53310a444e4b4e (diff)
downloadpython-openstackclient-742982af4bb94b73a78c06688732acf1c8127f8a.tar.gz
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
Diffstat (limited to 'functional/harpoon.sh')
-rwxr-xr-xfunctional/harpoon.sh30
1 files changed, 30 insertions, 0 deletions
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