summaryrefslogtreecommitdiffstats
path: root/dnstraffic.sh
blob: f4bf97be1ca580ae40c465bb24a97c9efd724996 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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.onap.org $DNSIP >/dev/null 2>&1 &
   done
   sleep 1
done
agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ============LICENSE_END============================================ ECOMP and OpenECOMP are trademarks and service marks of AT&T Intellectual Property. --> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <groupId>org.onap.demo.vnf</groupId> <artifactId>demo-aggregator</artifactId> <version>1.2.0-SNAPSHOT</version> <name>demo</name> <packaging>pom</packaging> <modelVersion>4.0.0</modelVersion> <prerequisites> <maven>3.1.1</maven> </prerequisites> <!--properties> <nexusproxy>https://nexus.onap.org</nexusproxy> </properties--> <modules> <module>vnfs/honeycomb_plugin/sample_plugin/parent-pom</module> <module>vnfs/vFW/pg_streams</module> <module>vnfs/vLB/dns_streams</module> <module>vnfs/vLB/DNSClient</module> <module>vnfs/vLB/DNSManager</module> <module>vnfs/VES</module> <module>vnfs/VESreporting_vLB</module> <module>vnfs/VESreporting_vFW</module> <module>vnfs/VES5.0</module> <module>vnfs/VESreporting_vLB5.0</module> <module>vnfs/VESreporting_vFW5.0</module> <module>vnfs/vCPE/kea-sdnc-notify-mod</module> <module>vnfs/vLBMS/apis/vlb-business-vnf-onap-plugin</module> <module>vnfs/vLBMS/apis/health-vnf-onap-plugin</module> </modules> <properties> <sonar.skip>true</sonar.skip> </properties> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-deploy-plugin</artifactId> <version>2.8.1</version> <configuration> <skip>true</skip> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-install-plugin</artifactId> <version>2.5.2</version> <configuration> <skip>true</skip> </configuration> </plugin> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>exec-maven-plugin</artifactId> <version>1.1.1</version> <executions> <execution> <id>upload-boot-scripts</id> <phase>deploy</phase> <goals> <goal>exec</goal> </goals> </execution> </executions> <configuration> <executable>scripts/deploy.sh</executable> </configuration> </plugin> <plugin> <groupId>org.sonatype.plugins</groupId> <artifactId>nexus-staging-maven-plugin</artifactId> <version>1.6.7</version> <extensions>true</extensions> <configuration> <nexusUrl>https://nexus.onap.org/</nexusUrl> <stagingProfileId>176c31dfe190a</stagingProfileId> <serverId>ecomp-staging</serverId> </configuration> </plugin> </plugins> </build> <distributionManagement> <repository> <id>ecomp-releases</id> <name>Demo Release Repository</name> <url>https://nexus.onap.org/content/repositories/releases/</url> </repository> <snapshotRepository> <id>ecomp-snapshots</id> <name>Demo Snapshot Repository</name> <url>https://nexus.onap.org/content/repositories/snapshots/</url> </snapshotRepository> </distributionManagement> </project>