aboutsummaryrefslogtreecommitdiffstats
path: root/vnfs/vLB/scripts/vdnspacketgen_change_streams_ports.sh
diff options
context:
space:
mode:
authorplatania <platania@research.att.com>2017-02-16 11:20:22 -0500
committerplatania <platania@research.att.com>2017-02-16 11:20:47 -0500
commit3426556541256f93d2cba65df3b9c8d1d1772861 (patch)
tree56e5b26481400d35e3e2e36be20df953793e348d /vnfs/vLB/scripts/vdnspacketgen_change_streams_ports.sh
parentf525cb9014ae27ddd795f933dee54a78b214a589 (diff)
Initial OpenECOMP Demo commit
Change-Id: Ibf8696196a7ac2c84ac8aa7cde1982c9c89fb64d Signed-off-by: platania <platania@research.att.com>
Diffstat (limited to 'vnfs/vLB/scripts/vdnspacketgen_change_streams_ports.sh')
-rw-r--r--vnfs/vLB/scripts/vdnspacketgen_change_streams_ports.sh53
1 files changed, 53 insertions, 0 deletions
diff --git a/vnfs/vLB/scripts/vdnspacketgen_change_streams_ports.sh b/vnfs/vLB/scripts/vdnspacketgen_change_streams_ports.sh
new file mode 100644
index 00000000..9bd77162
--- /dev/null
+++ b/vnfs/vLB/scripts/vdnspacketgen_change_streams_ports.sh
@@ -0,0 +1,53 @@
+#!/bin/bash
+
+#Disable all streams via Honeycomb (so that it will in consistent state)
+curl -X PUT -H "Authorization: Basic YWRtaW46YWRtaW4=" -H "Content-Type: application/json" -H "Cache-Control: no-cache" -d '{"pg-streams":{"pg-stream": []}}' "http://localhost:8183/restconf/config/sample-plugin:sample-plugin/pg-streams"
+
+vppctl pac del dns1
+vppctl pac del dns2
+vppctl pac del dns3
+vppctl pac del dns4
+vppctl pac del dns5
+vppctl pac del dns6
+vppctl pac del dns7
+vppctl pac del dns8
+vppctl pac del dns9
+vppctl pac del dns10
+
+
+#Update destination (vLB) IP
+VLB_IPADDR=$(cat /opt/config/vlb_ipaddr.txt)
+IPADDR1=$(ifconfig br0 | grep "inet addr" | tr -s ' ' | cut -d' ' -f3 | cut -d':' -f2)
+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
+sed -i -e "0,/UDP/ s/UDP:.*/UDP: "$IPADDR1" -> "$VLB_IPADDR"/" /opt/dns_streams/stream_dns6
+sed -i -e "0,/UDP/ s/UDP:.*/UDP: "$IPADDR1" -> "$VLB_IPADDR"/" /opt/dns_streams/stream_dns7
+sed -i -e "0,/UDP/ s/UDP:.*/UDP: "$IPADDR1" -> "$VLB_IPADDR"/" /opt/dns_streams/stream_dns8
+sed -i -e "0,/UDP/ s/UDP:.*/UDP: "$IPADDR1" -> "$VLB_IPADDR"/" /opt/dns_streams/stream_dns9
+sed -i -e "0,/UDP/ s/UDP:.*/UDP: "$IPADDR1" -> "$VLB_IPADDR"/" /opt/dns_streams/stream_dns10
+
+#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
+sed -i -e "s/.*-> 53.*/ UDP: $RANDOM -> 53/" /opt/dns_streams/stream_dns6
+sed -i -e "s/.*-> 53.*/ UDP: $RANDOM -> 53/" /opt/dns_streams/stream_dns7
+sed -i -e "s/.*-> 53.*/ UDP: $RANDOM -> 53/" /opt/dns_streams/stream_dns8
+sed -i -e "s/.*-> 53.*/ UDP: $RANDOM -> 53/" /opt/dns_streams/stream_dns9
+sed -i -e "s/.*-> 53.*/ UDP: $RANDOM -> 53/" /opt/dns_streams/stream_dns10
+
+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
+vppctl exec /opt/dns_streams/stream_dns6
+vppctl exec /opt/dns_streams/stream_dns7
+vppctl exec /opt/dns_streams/stream_dns8
+vppctl exec /opt/dns_streams/stream_dns9
+vppctl exec /opt/dns_streams/stream_dns10 \ No newline at end of file