From 69441298e91b8d7c91d3eb9ff1ff4d0a64dd47f4 Mon Sep 17 00:00:00 2001 From: Aleksander Mistewicz Date: Mon, 22 Aug 2016 11:22:56 +0200 Subject: [PATCH] Unify odroid and minnow sleep values Sleep values are now stored in: tct/common.sh Test results are now comparable. Change-Id: I32b08ae0b959b01d417665e8b0c487d09917d4f4 Signed-off-by: Aleksander Mistewicz --- tct/common.sh | 6 ++++++ tct/minnow_prepare_flash_conf.sh | 15 ++++++--------- tct/odroid_prepare_flash_conf.sh | 10 ++++++---- 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/tct/common.sh b/tct/common.sh index b9eede5..f2800fb 100755 --- a/tct/common.sh +++ b/tct/common.sh @@ -26,3 +26,9 @@ die() { printf >&2 -- '%s\n' "$1" exit "${2:-1}" } + +# INIT_SLEEP <= RESTART_SLEEP <= MAX_SLEEP +INC_SLEEP=10 +INIT_SLEEP=60 +RESTART_SLEEP=80 +MAX_SLEEP=120 diff --git a/tct/minnow_prepare_flash_conf.sh b/tct/minnow_prepare_flash_conf.sh index e4b14d1..8482f2f 100755 --- a/tct/minnow_prepare_flash_conf.sh +++ b/tct/minnow_prepare_flash_conf.sh @@ -67,22 +67,24 @@ restart_device "${SDMUX}" echo "### conf ###" CONNECT_CNT=0 -SLEEP=30 +SLEEP=${INIT_SLEEP} + +sleep "${SLEEP}" while ! ping -c 1 "${IP}" -W 1 | grep -q icmp_seq do printf "," - if [ ${SLEEP} -ge 150 ] + if [ ${SLEEP} -ge ${MAX_SLEEP} ] then die "Timeout: host not found in the network!" fi - if [ ${SLEEP} -ge 90 ] + if [ ${SLEEP} -ge ${RESTART_SLEEP} ] then echo "Restarting MINNOW" >&2 restart_device "${SDMUX}" fi sleep "${SLEEP}" - SLEEP=$((SLEEP+20)) + SLEEP=$((SLEEP+INC_SLEEP)) CONNECT_CNT=$((CONNECT_CNT+1)) done @@ -100,13 +102,8 @@ do SLEEP=$((SLEEP+10)) CONNECT_CNT=$((CONNECT_CNT+1)) done - printf "\n" -sleep 4 - -SLEEP=10 - copy_ssh "${IP}" "${TESTLAB_SCRIPTS}/run/smoke_tests.sh" run_smoke_ssh "${IP}" diff --git a/tct/odroid_prepare_flash_conf.sh b/tct/odroid_prepare_flash_conf.sh index 5a2d4b2..ed74a29 100755 --- a/tct/odroid_prepare_flash_conf.sh +++ b/tct/odroid_prepare_flash_conf.sh @@ -73,22 +73,24 @@ echo "### conf ###" CONNECT_CNT=0 sdb start-server -SLEEP=10 +SLEEP=${INIT_SLEEP} + +sleep "${SLEEP}" while [ -z "$(sdb devices | awk -v SDMUX="${SDMUX}" '$1 == SDMUX {print $1}')" ] do printf "." - if [ ${SLEEP} -ge 120 ] + if [ ${SLEEP} -ge ${MAX_SLEEP} ] then die "Timeout: sdb device not found!" >&2 fi - if [ ${SLEEP} -ge 60 ] + if [ ${SLEEP} -ge ${RESTART_SLEEP} ] then echo "Restarting ODROID" >&2 restart_device "${SDMUX}" fi sleep "${SLEEP}" - SLEEP=$((SLEEP+10)) + SLEEP=$((SLEEP+INC_SLEEP)) CONNECT_CNT=$((CONNECT_CNT+1)) done -- 2.7.4