From 79ac06cc4b5565f7333d4be0f23292afbe7184cc Mon Sep 17 00:00:00 2001 From: Davanum Srinivas Date: Sun, 5 Apr 2015 21:12:56 -0400 Subject: [PATCH] Add tox functional target Create a formal tox target for functional tests. Also we should not be overriding the user's localrc. Closes-Bug: #1440125 Change-Id: Ide639ea89050cf3e1f1e9e40c687d506998f7587 --- devstack/settings | 7 ------- magnum/tests/contrib/post_test_hook.sh | 21 ++++++++++++--------- tox.ini | 6 ++++++ 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/devstack/settings b/devstack/settings index e67e647b81..58feda31b9 100644 --- a/devstack/settings +++ b/devstack/settings @@ -13,13 +13,6 @@ TENANT_VLAN_RANGE= PHYSICAL_NETWORK=public OVS_PHYSICAL_BRIDGE=br-ex -# Credentials -ADMIN_PASSWORD=password -DATABASE_PASSWORD=password -RABBIT_PASSWORD=password -SERVICE_PASSWORD=password -SERVICE_TOKEN=password - enable_service rabbit # Enable Neutron which is required by Magnum and disable nova-network. diff --git a/magnum/tests/contrib/post_test_hook.sh b/magnum/tests/contrib/post_test_hook.sh index 4874f1b5cb..de3d5f1a70 100755 --- a/magnum/tests/contrib/post_test_hook.sh +++ b/magnum/tests/contrib/post_test_hook.sh @@ -32,20 +32,23 @@ echo_summary "magnum's post_test_hook.sh was called..." sudo pip install -r test-requirements.txt -# Try a command line as a sanity check -source ../devstack/accrc/admin/admin +# Get admin credentials +pushd ../devstack +source openrc admin admin +popd echo_summary "Running bay-list" magnum --debug bay-list -sudo OS_STDOUT_CAPTURE=-1 OS_STDERR_CAPTURE=-1 OS_TEST_TIMEOUT=500 OS_TEST_LOCK_PATH=${TMPDIR:-'/tmp'} \ - python -m subunit.run discover -t ./ ./magnum/tests/functional | subunit-2to1 | tools/colorizer.py -RETVAL=$? - -# Restore xtrace -$XTRACE +# Run functional tests +echo "Running magnum functional test suite" +sudo -H -u stack tox -e functional +EXIT_CODE=$? # Save the logs sudo mv ../logs/* /opt/stack/logs/ -exit $RETVAL \ No newline at end of file +# Restore xtrace +$XTRACE + +exit $EXIT_CODE \ No newline at end of file diff --git a/tox.ini b/tox.ini index c21b2cdafc..508df8019f 100644 --- a/tox.ini +++ b/tox.ini @@ -12,6 +12,12 @@ deps = -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt commands = python setup.py testr --slowest --testr-args='{posargs}' +[testenv:functional] +setenv = OS_TEST_PATH=./magnum/tests/functional + OS_TEST_TIMEOUT=500 +deps = + {[testenv]deps} + [testenv:pep8] commands = flake8