summaryrefslogtreecommitdiffstats
path: root/testcases/Controllers/ODL
diff options
context:
space:
mode:
authorjose.lausuch <jose.lausuch@ericsson.com>2016-01-26 14:18:24 +0100
committerMorgan Richomme <morgan.richomme@orange.com>2016-01-26 13:32:09 +0000
commita78ec95be7909a7c7108fc8632c301bb83b44c63 (patch)
tree951a48c32fb04a09248e639fb0c03d9957b9af69 /testcases/Controllers/ODL
parent9492365faf0d6d4901694cdfb04dd7edbf00e8b3 (diff)
Allow executing ODL test as many times as wanted on the same env
Since the script add some lines to the file called __init__.robot every time it executes, the next execution will add it again which is unnecessary and it will fail. This checks if those lines are already present and does nothing if so. Change-Id: If4c2e10bcfcac0b7fde38ff213ea4ade4b83e4f1 Signed-off-by: jose.lausuch <jose.lausuch@ericsson.com> (cherry picked from commit 680847c24a64a3f015b308b7c3fc6c9271b945a2)
Diffstat (limited to 'testcases/Controllers/ODL')
-rwxr-xr-xtestcases/Controllers/ODL/CI/start_tests.sh11
1 files changed, 6 insertions, 5 deletions
diff --git a/testcases/Controllers/ODL/CI/start_tests.sh b/testcases/Controllers/ODL/CI/start_tests.sh
index a2fd01299..4d600224e 100755
--- a/testcases/Controllers/ODL/CI/start_tests.sh
+++ b/testcases/Controllers/ODL/CI/start_tests.sh
@@ -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}"