X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=vnfs%2FvLB%2Fscripts%2Frun_streams_dns.sh;h=b73c9ee73d30266bb3930f9f3e59c753c6c8a0c7;hb=3514fec2ce01344df19df298f6a0d39a369ad26c;hp=cf95fa53be3941137f39789cda542181689ac39f;hpb=9907e4958485625ba469b08d10cb11bd5a56dba6;p=demo.git 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