diff options
author | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2015-08-22 14:12:03 +0900 |
---|---|---|
committer | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2015-08-22 17:48:54 +0900 |
commit | ae1222b0a21201abaca26158ab63732d943c225d (patch) | |
tree | 466d9e1e4bf9e5bd1b33f3e0699d0a5a4c53b116 /test/scenario_test | |
parent | 119137f4fdf4123fcba808d5f736eed4bb1e1968 (diff) |
test: throttle the number of concurrent execution
revert this commit when jenkins server get enough resouce
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'test/scenario_test')
-rwxr-xr-x | test/scenario_test/run_all_tests.sh | 32 |
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[@]}" $!) |