summaryrefslogtreecommitdiffhomepage
path: root/test/scenario_test/run_all_tests.sh
diff options
context:
space:
mode:
Diffstat (limited to 'test/scenario_test/run_all_tests.sh')
-rwxr-xr-xtest/scenario_test/run_all_tests.sh32
1 files changed, 26 insertions, 6 deletions
diff --git a/test/scenario_test/run_all_tests.sh b/test/scenario_test/run_all_tests.sh
index 700c35ee..84f0fcad 100755
--- a/test/scenario_test/run_all_tests.sh
+++ b/test/scenario_test/run_all_tests.sh
@@ -29,8 +29,6 @@ fi
cd $GOBGP/test/scenario_test
-PIDS=()
-
# route server malformed message test
sudo -E python route_server_malformed_test.py --gobgp-image $GOBGP_IMAGE --go-path $GOROOT/bin -s --with-xunit --xunit-file=${WS}/nosetest_malformed.xml
RET1=$?
@@ -39,13 +37,35 @@ if [ $RET1 != 0 ]; then
fi
# route server policy test
-NUM=`sudo -E python route_server_policy_test.py -s 2>1 | awk '/invalid/{print $NF}'`
-for (( i = 1; i < $NUM; ++i ))
+NUM=$(sudo -E python route_server_policy_test.py -s 2> /dev/null | awk '/invalid/{print $NF}')
+PARALLEL_NUM=4
+for (( i = 0; i < $(( NUM / PARALLEL_NUM + 1)); ++i ))
do
- sudo -E python route_server_policy_test.py --gobgp-image $GOBGP_IMAGE --test-prefix p$i --test-index $i -s -x --with-xunit --xunit-file=${WS}/nosetest_policy${i}.xml &
- PIDS=("${PIDS[@]}" $!)
+ sudo docker rm -f $(sudo docker ps -a -q)
+
+ PIDS=()
+ for (( j = $((PARALLEL_NUM * $i + 1)); j < $((PARALLEL_NUM * ($i+1) + 1)); ++j))
+ do
+ if [ $j -eq $NUM ]; then
+ break
+ fi
+ sudo -E python route_server_policy_test.py --gobgp-image $GOBGP_IMAGE --test-prefix p$j --test-index $j -s -x --gobgp-log-level debug &
+ PIDS=("${PIDS[@]}" $!)
+ sleep 4
+ done
+
+ for (( j = 0; j < ${#PIDS[@]}; ++j ))
+ do
+ wait ${PIDS[$j]}
+ if [ $? != 0 ]; then
+ exit 1
+ fi
+ done
+
done
+PIDS=()
+
# route server test
sudo -E python route_server_test.py --gobgp-image $GOBGP_IMAGE --test-prefix rs -s -x --with-xunit --xunit-file=${WS}/nosetest.xml &
PIDS=("${PIDS[@]}" $!)