summaryrefslogtreecommitdiffstats
path: root/vnfs/vLBMS/scripts/run_streams_dns.sh
diff options
context:
space:
mode:
authorMarco Platania <platania@research.att.com>2018-03-21 17:44:27 -0400
committerMarco Platania <platania@research.att.com>2018-03-21 17:44:27 -0400
commit13fdadba0a69e43fcfbd55cf4f473cc0db612640 (patch)
tree98d97a31cb6fe5517a2186a0fbc299643eeb6ff8 /vnfs/vLBMS/scripts/run_streams_dns.sh
parentc18a8faa269799bfe5eaddbb431aff86de689104 (diff)
Fix health check issues with vLBMS
- Allow vLB to run health check only against active vDNS instances - Change the path to status file - Make run_health scripts executable Change-Id: I6909d8507cafee5f9e93fcceb868db5d4f224045 Issue-ID: INT-433 Signed-off-by: Marco Platania <platania@research.att.com>
Diffstat (limited to 'vnfs/vLBMS/scripts/run_streams_dns.sh')
-rw-r--r--vnfs/vLBMS/scripts/run_streams_dns.sh51
1 files changed, 51 insertions, 0 deletions
diff --git a/vnfs/vLBMS/scripts/run_streams_dns.sh b/vnfs/vLBMS/scripts/run_streams_dns.sh
new file mode 100644
index 00000000..86f97b2e
--- /dev/null
+++ b/vnfs/vLBMS/scripts/run_streams_dns.sh
@@ -0,0 +1,51 @@
+#!/bin/bash
+
+#Disable all the running streams
+vppctl packet-gen disable
+
+#Initial configuration: run only two streams
+vppctl packet-gen enable-stream dns1
+vppctl packet-gen enable-stream dns2
+
+sleep 180
+
+#Rehash port numbers and re-run five streams every minute
+while true; do
+ vppctl packet-gen disable
+ vppctl pac del dns1
+ vppctl pac del dns2
+ vppctl pac del dns3
+ vppctl pac del dns4
+ vppctl pac del dns5
+
+ #Update destination (vLB) IP
+ VLB_IPADDR=$(cat /opt/config/vlb_ipaddr.txt)
+ IPADDR1=$(cat /opt/config/local_private_ipaddr.txt)
+ sed -i -e "0,/UDP/ s/UDP:.*/UDP: "$IPADDR1" -> "$VLB_IPADDR"/" /opt/dns_streams/stream_dns1
+ sed -i -e "0,/UDP/ s/UDP:.*/UDP: "$IPADDR1" -> "$VLB_IPADDR"/" /opt/dns_streams/stream_dns2
+ sed -i -e "0,/UDP/ s/UDP:.*/UDP: "$IPADDR1" -> "$VLB_IPADDR"/" /opt/dns_streams/stream_dns3
+ sed -i -e "0,/UDP/ s/UDP:.*/UDP: "$IPADDR1" -> "$VLB_IPADDR"/" /opt/dns_streams/stream_dns4
+ sed -i -e "0,/UDP/ s/UDP:.*/UDP: "$IPADDR1" -> "$VLB_IPADDR"/" /opt/dns_streams/stream_dns5
+
+ #Update source ports (make them random)
+ sed -i -e "s/.*-> 53.*/ UDP: $RANDOM -> 53/" /opt/dns_streams/stream_dns1
+ sed -i -e "s/.*-> 53.*/ UDP: $RANDOM -> 53/" /opt/dns_streams/stream_dns2
+ sed -i -e "s/.*-> 53.*/ UDP: $RANDOM -> 53/" /opt/dns_streams/stream_dns3
+ sed -i -e "s/.*-> 53.*/ UDP: $RANDOM -> 53/" /opt/dns_streams/stream_dns4
+ sed -i -e "s/.*-> 53.*/ UDP: $RANDOM -> 53/" /opt/dns_streams/stream_dns5
+
+ vppctl exec /opt/dns_streams/stream_dns1
+ vppctl exec /opt/dns_streams/stream_dns2
+ vppctl exec /opt/dns_streams/stream_dns3
+ vppctl exec /opt/dns_streams/stream_dns4
+ vppctl exec /opt/dns_streams/stream_dns5
+
+ #Resume stream execution
+ vppctl packet-gen enable-stream dns1
+ vppctl packet-gen enable-stream dns2
+ vppctl packet-gen enable-stream dns3
+ vppctl packet-gen enable-stream dns4
+ vppctl packet-gen enable-stream dns5
+
+ sleep 60
+done