diff options
author | Peter Bandzi <pbandzi@cisco.com> | 2015-05-06 09:42:46 +0200 |
---|---|---|
committer | Peter Bandzi <pbandzi@cisco.com> | 2015-05-06 09:54:48 +0200 |
commit | bc49f02d832f2bf3d2e835583c1b8e3420fa4329 (patch) | |
tree | de3dac576728f49f721e5537729871cdaa10af8d /testcases/Controllers/ODL/CI/start_tests.sh | |
parent | 1c9672d21d592ef88c53d5836e3d575872d4b9bd (diff) |
Script for creating virtual environment added.
Plus start_test script fixes
JIRA: FUNCTEST-5
Change-Id: I015e3d8bfa7311437ca702f97c79d9e0bf3684ea
Signed-off-by: Peter Bandzi <pbandzi@cisco.com>
Diffstat (limited to 'testcases/Controllers/ODL/CI/start_tests.sh')
-rw-r--r-- | testcases/Controllers/ODL/CI/start_tests.sh | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/testcases/Controllers/ODL/CI/start_tests.sh b/testcases/Controllers/ODL/CI/start_tests.sh index e2f94a65a..367a075f7 100644 --- a/testcases/Controllers/ODL/CI/start_tests.sh +++ b/testcases/Controllers/ODL/CI/start_tests.sh @@ -1,10 +1,13 @@ #!/bin/bash # Script requires that test environment is created already # it includes python2.7 virtual env with robot packages and git +# use create_env.sh script for creating python virtualenv +BASEDIR=`dirname $0` # Colors green='\033[0;32m' light_green='\033[1;32m' +red='\033[1;31m' nc='\033[0m' # No Color usage="Script for starting ODL tests. Tests to be executed are specified in test_list.txt file. @@ -14,7 +17,7 @@ usage: where: -h show this help text - var one of the following: OSTACK_IP, ODL_PORT, USER, PASS, PATH_TO_VENV + var one of the following: OSTACK_IP, ODL_PORT, USR_NAME, USR_PASSWORD value new value for var example: @@ -35,11 +38,10 @@ done echo -e "${green}Current environment parameters for ODL suite.${nc}" # Following vars might be also specified as CLI params set -x -PATH_TO_VENV=${PATH_TO_VENV:-~/.virtualenvs/robot/bin/activate} OSTACK_IP=${OSTACK_IP:-'oscontrol'} ODL_PORT=${ODL_PORT:-8081} USR_NAME=${USR_NAME:-'admin'} -PASS=${PASS:-'octopus'} +USR_PASSWORD=${USR_PASSWORD:-'octopus'} set +x echo -e "${green}Cloning ODL integration git repo.${nc}" @@ -53,14 +55,19 @@ else fi # Change openstack password for admin tenant in neutron suite -sed -i "s/\"password\": \"admin\"/\"password\": \"${PASS}\"/" integration/test/csit/suites/openstack/neutron/__init__.robot +sed -i "s/\"password\": \"admin\"/\"password\": \"${USR_PASSWORD}\"/" integration/test/csit/suites/openstack/neutron/__init__.robot -echo -e "${green}Activate python virtual env.${nc}" -source $PATH_TO_VENV +if source $BASEDIR/venv/bin/activate; then + echo -e "${green}Python virtualenv activated.${nc}" +else + echo -e "${red}ERROR${nc}" + exit 1 +fi # List of tests are specified in test_list.txt # those are relative paths to test directories from integartion suite echo -e "${green}Executing chosen tests.${nc}" +test_num=1 while read line do # skip comments @@ -70,6 +77,11 @@ do echo -e "${light_green}Starting test: $line ${nc}" pybot -v OPENSTACK:${OSTACK_IP} -v PORT:${ODL_PORT} -v CONTROLLER:${OSTACK_IP} $line + mkdir -p $BASEDIR/logs/${test_num} + mv log.html $BASEDIR/logs/${test_num}/ + mv report.html $BASEDIR/logs/${test_num}/ + mv output.xml $BASEDIR/logs/${test_num}/ + ((test_num++)) done < test_list.txt echo -e "${green}Deactivate venv.${nc}" |