3 # This script is run by the policy closed loop to generate traffic (DNS packets) to the DNS
5 # Usage: dnstraffic.sh <DNSIP> <RATE_PER_SEC> <ITERATIONS>
7 # The DNSIP is that of the DNS vLoadBalancer.
8 # The RATE_PER_SEC is the approximate number of nslookup requests generated per second.
9 # The ITERATIONS is roughly the number of seconds to run the test. Note that the Robot
10 # will kill this script after the validation is complete.
12 # The validation portion of the script has done a successful lookup, so the point of
13 # these requests is to generate DNS packets. We do not care about the results. The timeout
14 # of 1 second is to ensure we do not flood the process table with long waits
17 # We generate an approximate rate because we sleep for a full second so the RATE_PER_SEC
18 # should have some slop in it. We only need to drive this to 20+ per second, so a 35
19 # per second should fall within the range to trigger the polciy check and prvide enough
20 # to validate even distribution without spawning a 3rd DNS
25 ITERATIONS=${ITERATIONS:-300}
27 for iter in `seq 1 $ITERATIONS`;
29 for i in `seq 1 $RATE_PER_SEC`;
31 nslookup -timeout=1 host2.dnsdemo.openecomp.org $DNSIP >/dev/null 2>&1 &