Merge "Allow executing ODL test as many times as wanted on the same env"
authorMorgan Richomme <morgan.richomme@orange.com>
Tue, 26 Jan 2016 13:32:01 +0000 (13:32 +0000)
committerGerrit Code Review <gerrit@172.30.200.206>
Tue, 26 Jan 2016 13:32:02 +0000 (13:32 +0000)
testcases/Controllers/ODL/CI/start_tests.sh

index a2fd012..4d60022 100755 (executable)
@@ -53,14 +53,15 @@ PASS=${PASS:-'octopus'}
 NEUTRON_IP=${NEUTRON_IP:-192.168.0.68}
 set +x
 
-
+init_file=${REPO_DIR}/test/csit/suites/openstack/neutron/__init__.robot
 # Change openstack password for admin tenant in neutron suite
-sed -i "s/\"password\": \".*\"/\"password\": \"${PASS}\"/" ${REPO_DIR}/test/csit/suites/openstack/neutron/__init__.robot
+sed -i "s/\"password\": \".*\"/\"password\": \"${PASS}\"/" $init_file
 
 # Add Start Suite and Teardown Suite
-sed -i "/^Documentation.*/a Suite Teardown     Stop Suite" ${REPO_DIR}/test/csit/suites/openstack/neutron/__init__.robot
-sed -i "/^Documentation.*/a Suite Setup        Start Suite" ${REPO_DIR}/test/csit/suites/openstack/neutron/__init__.robot
-
+if [[ ! `grep 'Suite Teardown' ${init_file}` ]]; then
+    sed -i "/^Documentation.*/a Suite Teardown     Stop Suite" $init_file
+    sed -i "/^Documentation.*/a Suite Setup        Start Suite" $init_file
+fi
 
 # add custom tests to suite, if there are more custom tests needed this will be reworked
 echo -e "${green}Copy custom tests to suite.${nc}"