diff --git a/TESTING.rst b/TESTING.rst index c73003a4525..268d4120fb0 100644 --- a/TESTING.rst +++ b/TESTING.rst @@ -297,10 +297,10 @@ be made about implementation. Only the contract defined by Neutron's REST API should be validated, and all interaction with the daemon should be via a REST client. -neutron/tests/tempest/api was copied from the Tempest project. At the time, there was -an overlap of tests between the Tempest and Neutron repositories. This overlap -was then eliminated by carving out a subset of resources that belong to -Tempest, with the rest in Neutron. +The neutron/tests/tempest/api directory was copied from the Tempest project around +the Kilo timeframe. At the time, there was an overlap of tests between the Tempest +and Neutron repositories. This overlap was then eliminated by carving out a subset +of resources that belong to Tempest, with the rest in Neutron. API tests that belong to Tempest deal with a subset of Neutron's resources: @@ -514,22 +514,15 @@ API Tests +++++++++ To run the api tests, deploy Tempest and Neutron with DevStack and -then run the following command: :: +then run the following command, from the tempest directory: :: - tox -e api + tox -e all-plugin -If tempest.conf cannot be found at the default location used by -DevStack (/opt/stack/tempest/etc) it may be necessary to set -TEMPEST_CONFIG_DIR before invoking tox: :: - - export TEMPEST_CONFIG_DIR=[path to dir containing tempest.conf] - tox -e api - -You may also utilize Neutron's Tempest plugin by going to the Tempest directory -and executing: - -tox -e all-plugin neutron +If you want to limit the amount of tests that you would like to run, you +can do, for instance: :: + export DEVSTACK_GATE_TEMPEST_REGEX="" # e.g. "neutron" + tox -e all-plugin $DEVSTACK_GATE_TEMPEST_REGEX Running Individual Tests ~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/neutron/tests/contrib/post_test_hook.sh b/neutron/tests/contrib/post_test_hook.sh index 201503bb19c..6d9c46e73c9 100644 --- a/neutron/tests/contrib/post_test_hook.sh +++ b/neutron/tests/contrib/post_test_hook.sh @@ -3,7 +3,6 @@ set -xe NEUTRON_DIR="$BASE/new/neutron" -TEMPEST_DIR="$BASE/new/tempest" SCRIPTS_DIR="/usr/os-testr-env/bin/" venv=${1:-"dsvm-functional"} @@ -39,34 +38,24 @@ function generate_testr_results { fi } -if [ "$venv" == "api-pecan" ]; then - # api-pecan is the same as the regular api job - venv='api' -fi - if [[ "$venv" == dsvm-functional* ]] || [[ "$venv" == dsvm-fullstack* ]] then owner=stack sudo_env= log_dir="/tmp/${venv}-logs" -elif [ "$venv" == "api" ] -then - owner=tempest - # Configure the api tests to use the tempest.conf set by devstack. - sudo_env="TEMPEST_CONFIG_DIR=$TEMPEST_DIR/etc" + + # Set owner permissions according to job's requirements. + cd $NEUTRON_DIR + sudo chown -R $owner:stack $NEUTRON_DIR + + # Run tests + echo "Running neutron $venv test suite" + set +e + sudo -H -u $owner $sudo_env tox -e $venv + testr_exit_code=$? + set -e + + # Collect and parse results + generate_testr_results + exit $testr_exit_code fi - -# Set owner permissions according to job's requirements. -cd $NEUTRON_DIR -sudo chown -R $owner:stack $NEUTRON_DIR - -# Run tests -echo "Running neutron $venv test suite" -set +e -sudo -H -u $owner $sudo_env tox -e $venv -testr_exit_code=$? -set -e - -# Collect and parse results -generate_testr_results -exit $testr_exit_code diff --git a/test-requirements.txt b/test-requirements.txt index 1e861f14dda..afe596184eb 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -23,4 +23,3 @@ pylint==1.4.5 # GNU GPL v2 reno>=1.6.2 # Apache2 # Needed to run DB commands in virtualenvs PyMySQL>=0.6.2 # MIT License -tempest>=11.0.0 # Apache-2.0 diff --git a/tox.ini b/tox.ini index 9855785dd90..dbd371a7691 100644 --- a/tox.ini +++ b/tox.ini @@ -17,14 +17,6 @@ commands = # there is also secret magic in ostestr which lets you run in a fail only # mode. To do this define the TRACE_FAILONLY environmental variable. -[testenv:api] -basepython = python2.7 -passenv = {[testenv]passenv} TEMPEST_CONFIG_DIR -setenv = {[testenv]setenv} - OS_TEST_PATH=./neutron/tests/tempest/api - TEMPEST_CONFIG_DIR={env:TEMPEST_CONFIG_DIR:/opt/stack/tempest/etc} - OS_TEST_API_WITH_REST=1 - [testenv:common] # Fake job to define environment variables shared between dsvm/non-dsvm jobs setenv = OS_TEST_TIMEOUT=180