summaryrefslogtreecommitdiffstats
path: root/dnstraffic.sh
diff options
context:
space:
mode:
authorDR695H <dr695h@att.com>2017-02-17 18:44:24 -0500
committerDR695H <dr695h@att.com>2017-02-17 18:44:41 -0500
commitccff30b6e325f359879595998e83bbfe6624c851 (patch)
treec98f950f33baa71d21b091b6b10ca3ffb7700467 /dnstraffic.sh
parent234c2226d8cb3368a7af3d280a5ec280782bed63 (diff)
Initial checkin of EopenECOMP testsuite
Change-Id: I64a2b6d8cf66169829866b73b3d26a4ff59b0a42 Signed-off-by: DR695H <dr695h@att.com>
Diffstat (limited to 'dnstraffic.sh')
-rw-r--r--dnstraffic.sh34
1 files changed, 34 insertions, 0 deletions
diff --git a/dnstraffic.sh b/dnstraffic.sh
new file mode 100644
index 00000000..808a7b53
--- /dev/null
+++ b/dnstraffic.sh
@@ -0,0 +1,34 @@
+#!/bin/bash
+#
+# This script is run by the policy closed loop to generate traffic (DNS packets) to the DNS
+#
+# Usage: dnstraffic.sh <DNSIP> <RATE_PER_SEC> <ITERATIONS>
+#
+# The DNSIP is that of the DNS vLoadBalancer.
+# The RATE_PER_SEC is the approximate number of nslookup requests generated per second.
+# The ITERATIONS is roughly the number of seconds to run the test. Note that the Robot
+# will kill this script after the validation is complete.
+#
+# The validation portion of the script has done a successful lookup, so the point of
+# these requests is to generate DNS packets. We do not care about the results. The timeout
+# of 1 second is to ensure we do not flood the process table with long waits
+# on failed lookups.
+#
+# We generate an approximate rate because we sleep for a full second so the RATE_PER_SEC
+# should have some slop in it. We only need to drive this to 20+ per second, so a 35
+# per second should fall within the range to trigger the polciy check and prvide enough
+# to validate even distribution without spawning a 3rd DNS
+#
+DNSIP=$1
+RATE_PER_SEC=$2
+ITERATIONS=$3
+ITERATIONS=${ITERATIONS:-300}
+
+for iter in `seq 1 $ITERATIONS`;
+do
+ for i in `seq 1 $RATE_PER_SEC`;
+ do
+ nslookup -timeout=1 host2.dnsdemo.openecomp.org $DNSIP >/dev/null 2>&1 &
+ done
+ sleep 1
+done