Link failure test scenario
refs #1661
Change-Id: I0cc2e66ea6fb1ec1ebf4517fd4cd4072fa9f231e
diff --git a/test_linkfail/ping.sh b/test_linkfail/ping.sh
new file mode 100755
index 0000000..6b741eb
--- /dev/null
+++ b/test_linkfail/ping.sh
@@ -0,0 +1,13 @@
+#!/bin/bash
+DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+source ../multi-host.conf
+
+LOGPREFIX=$1
+
+ndnping -c 25 /B &> logs/${LOGPREFIX}_ping_A.log
+
+LOSS=$(sed -n 's/.*Packet Loss=\([^,]*\).*/\1/p' logs/${LOGPREFIX}_ping_A.log)
+MAXRTT=$(sed -n 's/Round Trip Time.* = (\([^)]*\).*/\1/p' logs/${LOGPREFIX}_ping_A.log | cut -d/ -f2)
+
+[[ $LOSS == '0%' ]] && [[ $(echo $MAXRTT | sed 's/\..*//') -le 100 ]]
+