summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorAdam Gandelman <adamg@ubuntu.com>2015-03-05 17:20:03 -0800
committerAdam Gandelman <adamg@ubuntu.com>2015-03-09 13:45:20 -0700
commitd76862b1869ea529da1e149f4e3a00cc5fb9eda6 (patch)
tree6422260a647a7ada7862f28ace3e27d04bab2c2b /tools
parentfd6f36474bf0aa642f6706d72ccf831937754314 (diff)
downloadpython-ironicclient-d76862b1869ea529da1e149f4e3a00cc5fb9eda6.tar.gz
Adds basic ironicclient functional testing
This moves unit tests to ironicclient/tests/unit and adds a new test directory at ironicclient/tests/functional. These are meant to be functional tests that are run against a living cloud (presumably deployed by devstack as part of a gating job). They depend on a test.conf to exist that contains admin user credentials for said cloud. This includes a simple run_functional.sh script that is meant to create that and serve as the entry point for running the tests from a devstack post_test_hook. Change-Id: I11570c3e22e4f80b94d0643dca6ed8231217c877
Diffstat (limited to 'tools')
-rwxr-xr-xtools/run_functional.sh26
1 files changed, 26 insertions, 0 deletions
diff --git a/tools/run_functional.sh b/tools/run_functional.sh
new file mode 100755
index 0000000..4ac6c91
--- /dev/null
+++ b/tools/run_functional.sh
@@ -0,0 +1,26 @@
+#!/bin/bash
+
+FUNC_TEST_DIR=$(dirname $0)/../ironicclient/tests/functional/
+CONFIG_FILE=$FUNC_TEST_DIR/test.conf
+
+if [[ -n "$OS_AUTH_TOKEN" ]] && [[ -n "$IRONIC_URL" ]]; then
+cat <<END >$CONFIG_FILE
+[functional]
+api_version = 1
+auth_strategy=noauth
+os_auth_token=$OS_AUTH_TOKEN
+ironic_url=$IRONIC_URL
+END
+else
+cat <<END >$CONFIG_FILE
+[functional]
+api_version = 1
+os_auth_url=$OS_AUTH_URL
+os_username=$OS_USERNAME
+os_password=$OS_PASSWORD
+os_tenant_name=$OS_TENANT_NAME
+os_service_type=baremetal
+os_endpoint_type=public
+END
+fi
+tox -e functional