python-ironicclient/tools/run_functional.sh
Adam Gandelman d76862b186 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
2015-03-09 13:45:20 -07:00

27 lines
544 B
Bash
Executable File

#!/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