Link failure test scenario
refs #1661
Change-Id: I0cc2e66ea6fb1ec1ebf4517fd4cd4072fa9f231e
diff --git a/test_linkfail/linkfail.sh b/test_linkfail/linkfail.sh
new file mode 100755
index 0000000..63e834f
--- /dev/null
+++ b/test_linkfail/linkfail.sh
@@ -0,0 +1,23 @@
+#!/bin/bash
+DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+source ../multi-host.conf
+
+# linkfail.sh fail|recover end1 end2
+
+ACT=$1
+END1=$2
+END2=$3
+CTRLVAR1='CTRL_'${END1:0:1}
+CTRLVAR2='CTRL_'${END2:0:1}
+IP4VAR1='IP4_'$END1
+IP4VAR2='IP4_'$END2
+
+CMD='-D'
+if [[ $ACT == 'fail' ]]
+then
+ CMD='-I'
+fi
+
+ssh ${!CTRLVAR1} "sudo iptables $CMD INPUT -s ${!IP4VAR2}/32 -p udp --dport 6363 -j DROP"
+ssh ${!CTRLVAR2} "sudo iptables $CMD INPUT -s ${!IP4VAR1}/32 -p udp --dport 6363 -j DROP"
+