summaryrefslogtreecommitdiff
path: root/tools/ci/scripts
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
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')
-rwxr-xr-xtools/ci/scripts/runtest.sh28
-rwxr-xr-xtools/ci/scripts/runtests.sh6
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