aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGary Wu <gary.i.wu@huawei.com>2017-11-15 01:33:45 +0000
committerGerrit Code Review <gerrit@onap.org>2017-11-15 01:33:45 +0000
commit56a26b99554513227ed896bfc0ecb6022c5e4d0f (patch)
treebb52a7c893645c16031d59b86a9069911fc22b95
parentc6d8aae3482b9769de7aa9a0092ea106e9ff88ad (diff)
parent3514fec2ce01344df19df298f6a0d39a369ad26c (diff)
Merge "Fix streams in vLB/vDNS VNF"
-rwxr-xr-xvnfs/vLB/scripts/run_streams_dns.sh50
-rw-r--r--vnfs/vLB/scripts/v_packetgen_install.sh5
2 files changed, 46 insertions, 9 deletions
diff --git a/vnfs/vLB/scripts/run_streams_dns.sh b/vnfs/vLB/scripts/run_streams_dns.sh
index cf95fa53..b73c9ee7 100755
--- a/vnfs/vLB/scripts/run_streams_dns.sh
+++ b/vnfs/vLB/scripts/run_streams_dns.sh
@@ -1,9 +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 100
-vppctl packet-gen enable-stream dns3
-vppctl packet-gen enable-stream dns4
-vppctl packet-gen enable-stream dns5
+
+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 \ No newline at end of file
diff --git a/vnfs/vLB/scripts/v_packetgen_install.sh b/vnfs/vLB/scripts/v_packetgen_install.sh
index ca2957a7..6dce05ec 100644
--- a/vnfs/vLB/scripts/v_packetgen_install.sh
+++ b/vnfs/vLB/scripts/v_packetgen_install.sh
@@ -56,7 +56,6 @@ cd /opt
wget $REPO_URL_BLOB/org.onap.demo/vnfs/vlb/$INSTALL_SCRIPT_VERSION/v_packetgen_init.sh
wget $REPO_URL_BLOB/org.onap.demo/vnfs/vlb/$INSTALL_SCRIPT_VERSION/vpacketgen.sh
wget $REPO_URL_BLOB/org.onap.demo/vnfs/vlb/$INSTALL_SCRIPT_VERSION/run_streams_dns.sh
-wget $REPO_URL_BLOB/org.onap.demo/vnfs/vlb/$INSTALL_SCRIPT_VERSION/vdnspacketgen_change_streams_ports.sh
wget $REPO_URL_ARTIFACTS/org/onap/demo/vnf/vlb/vlb_dns_streams/$DEMO_ARTIFACTS_VERSION/vlb_dns_streams-$DEMO_ARTIFACTS_VERSION-demo.tar.gz
tar -zmxvf vlb_dns_streams-$DEMO_ARTIFACTS_VERSION-demo.tar.gz
@@ -65,7 +64,6 @@ rm *.tar.gz
chmod +x v_packetgen_init.sh
chmod +x vpacketgen.sh
chmod +x run_streams_dns.sh
-chmod +x vdnspacketgen_change_streams_ports.sh
# Install VPP
export UBUNTU="xenial"
@@ -93,7 +91,4 @@ then
reboot
fi
-# Install a cron job that restart streams every minute. This allows to map streams to different vDNSs when we scale out the VNF
-echo "* * * * * /opt/vdnspacketgen_change_streams_ports.sh" | crontab
-
./v_packetgen_init.sh