From 25847a08231312f4b0017e88f7eecb49c566c71e Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 27 Jun 2017 21:58:47 +0300 Subject: Check for servers list download complete in run tests. --- tools/ci/scripts/runtest.sh | 28 ++++++++++++++++++++++++++-- tools/ci/scripts/runtests.sh | 6 ++++-- 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/tools/ci/scripts/runtest.sh b/tools/ci/scripts/runtest.sh index 371249c2f..38b0456eb 100755 --- a/tools/ci/scripts/runtest.sh +++ b/tools/ci/scripts/runtest.sh @@ -17,12 +17,36 @@ function check_is_run { fi } +function wait_for_servers_list { + n=0 + while true; do + echo "wait for servers list ${n}" + check_is_run + # check here + grep "Skipping servers list update" "${HOME}/.local/share/mana/manaplus.log" && return + grep "Servers list updated" "${HOME}/.local/share/mana/manaplus.log" && return + grep "Error: servers list updating error" "${HOME}/.local/share/mana/manaplus.log" + if [ "$?" == 0 ]; then + echo "Servers list downloading error" + exit 1 + fi + + if [[ $n -ge 150 ]]; then + break + fi + sleep 5s + n=$((n+1)) + done + echo "Waiting time for servers list update is up" + exit 1 +} + function run { ./src/manaplus --default-cursor --enable-ipc --renderer=0 >logs/run.log 2>&1 & export PID=$! - sleep 30s + sleep 20s echo "pause after run" - sleep 30s + wait_for_servers_list } function kill_app { diff --git a/tools/ci/scripts/runtests.sh b/tools/ci/scripts/runtests.sh index 9e2e913b6..c0958d82f 100755 --- a/tools/ci/scripts/runtests.sh +++ b/tools/ci/scripts/runtests.sh @@ -22,6 +22,8 @@ while true; do rm "/root/.config/mana/mana/config.xml" rm "${HOME}/.config/mana/mana/serverlistplus.xml" rm "/root/.config/mana/mana/serverlistplus.xml" + rm "${HOME}/.local/share/mana/manaplus.log" + rm "/root/.local/share/mana/manaplus.log" ./tools/ci/scripts/runtest.sh if [ "$?" != 0 ]; then exit 1 @@ -37,8 +39,8 @@ echo "existing config runs" n=0 while true; do echo "run test ${n}" - rm "${HOME}/.config/mana/mana/serverlistplus.xml" - rm "/root/.config/mana/mana/serverlistplus.xml" + rm "${HOME}/.local/share/mana/manaplus.log" + rm "/root/.local/share/mana/manaplus.log" ./tools/ci/scripts/runtest.sh if [ "$?" != 0 ]; then exit 1 -- cgit v1.2.3-70-g09d2