summaryrefslogtreecommitdiff
path: root/tools/ci/scripts/runtest.sh
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-06-27 21:58:47 +0300
committerAndrei Karas <akaras@inbox.ru>2017-06-27 22:32:57 +0300
commit25847a08231312f4b0017e88f7eecb49c566c71e (patch)
tree84a53f0779efc9f8229c7f78830d6a43e44e8c2b /tools/ci/scripts/runtest.sh
parentd5575529b244757b4d5d75b196772131d5575e43 (diff)
downloadmanaverse-25847a08231312f4b0017e88f7eecb49c566c71e.tar.gz
manaverse-25847a08231312f4b0017e88f7eecb49c566c71e.tar.bz2
manaverse-25847a08231312f4b0017e88f7eecb49c566c71e.tar.xz
manaverse-25847a08231312f4b0017e88f7eecb49c566c71e.zip
Check for servers list download complete in run tests.
Diffstat (limited to 'tools/ci/scripts/runtest.sh')
-rwxr-xr-xtools/ci/scripts/runtest.sh28
1 files changed, 26 insertions, 2 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 {