summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYongqin Liu <yongqin.liu@linaro.org>2016-05-16 10:20:32 +0800
committerMilosz Wasilewski <milosz.wasilewski@linaro.org>2016-06-10 11:02:33 +0000
commit2ac45d9ead27ad2934c3bfb74ca6b4ee39d53389 (patch)
tree2f42b7dd539089bc6ed18266ceceb20f67c0c2c5
parentbf86b7f900f5a01590284e92f802a86bdd450356 (diff)
android multinode-target.yaml: add check for ip before send ip to host
Since there are adbd restart instructions there, and this will cause the dhcpd_eth0 restarted, so we need to wait for the IP available via ping before run the lava-send command Change-Id: I1e5ac7b2fba3b84aa2b8c317438a1fa35d0365b2 Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
-rw-r--r--android/multinode-target.yaml3
-rwxr-xr-xandroid/scripts/wait_via_ping.sh28
2 files changed, 31 insertions, 0 deletions
diff --git a/android/multinode-target.yaml b/android/multinode-target.yaml
index 9d49164..8119a08 100644
--- a/android/multinode-target.yaml
+++ b/android/multinode-target.yaml
@@ -25,6 +25,8 @@ params:
# identification to the host side. Default is ETH
# which means adb-over-ethernet is used
ADB_LINK: "ETH"
+ # timeout value to wait until the ip ia available for ping LAVA_SERVER_IP
+ PING_TIMEOUT: 10
run:
steps:
@@ -45,6 +47,7 @@ run:
- lava-test-case step6-disable-kmsg --shell echo '1 1 1 1' > /proc/sys/kernel/printk
- lava-test-case step7-stop-adbd --shell stop adbd
- lava-test-case step8-start-adbd --shell start adbd
+ - ./android/scripts/wait_via_ping.sh ${LAVA_SERVER_IP} ${PING_TIMEOUT}
- fi
- if [ -z $SERIALNO ] && [ -z $IPADDR ]
- then
diff --git a/android/scripts/wait_via_ping.sh b/android/scripts/wait_via_ping.sh
new file mode 100755
index 0000000..8c373e5
--- /dev/null
+++ b/android/scripts/wait_via_ping.sh
@@ -0,0 +1,28 @@
+#!/system/bin/sh
+
+lava_server_ip=$1
+timeout_val=$2
+
+if [ -z "${lava_server_ip}" ]; then
+ return
+fi
+if [ -z "${timeout_val}" ]; then
+ timeout_val=10
+fi
+
+echo "Timeout value is ${timeout_val}"
+sleep 5
+ping_count=0
+echo "ping start: $(date)"
+while ! LC_ALL=C ping -W1 -c1 ${lava_server_ip} ; do
+ sleep 1
+ ping_count=$((ping_count + 1))
+ if [ $ping_count -ge ${timeout_val} ]; then
+ exit 1
+ fi
+done
+# see how long it will take for the ip to available
+echo "ping finished: $(date)"
+ifconfig
+
+exit 0