From b5a40830c4945dcf6809773bd099e819a3857ec3 Mon Sep 17 00:00:00 2001 From: Viktor Tikkanen Date: Fri, 22 Jan 2016 12:25:41 +0200 Subject: Added --no-clean option for run_tests.sh Previously all the OpenStack resources (networks, VMs etc.) created by user were deleted after executing tempest, vims and rally test cases with run_tests.sh script. New --no-clean option can be used for preserving resources created by user so that the tests can be run also in setups with deployed stacks. Change-Id: I8c9505acf955c54b2b837d8ca916dc729c97bbca Signed-off-by: Viktor Tikkanen (cherry picked from commit dce18f616c5c0bf019f72c68c872570f26d2978b) --- docker/run_tests.sh | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'docker') diff --git a/docker/run_tests.sh b/docker/run_tests.sh index 7cb06ab8e..c0bf06a2a 100755 --- a/docker/run_tests.sh +++ b/docker/run_tests.sh @@ -21,6 +21,7 @@ usage: where: -h|--help show this help text -r|--report push results to database (false by default) + -n|--no-clean do not clean OpenStack resources after test run -t|--test run specific set of tests one or more of the following: vping,odl,rally,tempest,vims,onos,promise,ovno. Separated by comma. @@ -35,15 +36,18 @@ examples: # NOTE: Still not 100% working when running the tests offline=false report="" +clean=true # Get the list of runnable tests # Check if we are in CI mode function clean_openstack(){ - echo -e "\n\nCleaning Openstack environment..." - python ${FUNCTEST_REPO_DIR}/testcases/VIM/OpenStack/CI/libraries/clean_openstack.py \ - --debug - echo -e "\n\n" + if [ $clean == true ]; then + echo -e "\n\nCleaning Openstack environment..." + python ${FUNCTEST_REPO_DIR}/testcases/VIM/OpenStack/CI/libraries/clean_openstack.py \ + --debug + echo -e "\n\n" + fi } function run_test(){ @@ -169,6 +173,9 @@ while [[ $# > 0 ]] -r|--report) report="-r" ;; + -n|--no-clean) + clean=false + ;; -t|--test|--tests) TEST="$2" shift -- cgit 1.2.3-korg