From 7fc965d60aba3ea9a53e6ced5239ab0aba33e115 Mon Sep 17 00:00:00 2001 From: Sapan Bhatia Date: Fri, 23 Jan 2009 15:47:48 +0000 Subject: [PATCH] Fixed for Thierry's test environment. --- qaapi/qa/tests/node/ping.pl | 40 -------------- qaapi/qa/tests/node/synacks.pl | 86 ------------------------------ qaapi/qa/tests/node/vsys_launch.pl | 4 +- 3 files changed, 3 insertions(+), 127 deletions(-) delete mode 100755 qaapi/qa/tests/node/ping.pl delete mode 100755 qaapi/qa/tests/node/synacks.pl diff --git a/qaapi/qa/tests/node/ping.pl b/qaapi/qa/tests/node/ping.pl deleted file mode 100755 index bbc4b58..0000000 --- a/qaapi/qa/tests/node/ping.pl +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/perl - -# Module: VNET+ -# Description: Generate ping packets and count the responses -# Author: sapanb@cs.princeton.edu - -use strict; -use threads; - -#please change to something local -my $guineapig='planetlab-1.cs.princeton.edu'; -my $numiter=1000; - -sub run { - system("ping -c $numiter -i 0.1 $guineapig"); - } - - -sub open_tcpdump { - my $filter="icmp and src $guineapig"; - my $cmdline="/usr/sbin/tcpdump -c $numiter $filter"; - - system($cmdline); -} - -sub alhandler { - print "[FAILED] tcpdump apparently did not intercept all SYN/ACK packets\n"; - exit(-1); -} - -print "Starting tcpdump...\n"; -my $tcpdthr=threads->create(\&open_tcpdump); -sleep 10; -print "Generating connections...\n"; -run; -$SIG{ALRM}=\&alhandler; -alarm(60); - -$tcpdthr->join; -print "[SUCCESS] Test completed OK.\n"; diff --git a/qaapi/qa/tests/node/synacks.pl b/qaapi/qa/tests/node/synacks.pl deleted file mode 100755 index 6f7ef6a..0000000 --- a/qaapi/qa/tests/node/synacks.pl +++ /dev/null @@ -1,86 +0,0 @@ -#!/usr/bin/perl - -# Module: VNET+ -# Description: -# Generate a ton of connections and check if we can see syn/ack packets via tcpdump. -# Author: sapanb@cs.princeton.edu - -use strict; -use IO::Socket; -use threads; -use threads::shared; - -my $guineapig='www.cs.princeton.edu'; -my $targetfile='/~sapanb/small'; -my $magic='3j4kl;1234kj341234jl1k234ljk123h4'; -my $numiter=1000; -my $numsynacks:shared=0; -my $numthreads=4; -my $numpackets=$numthreads*$numiter; - -sub fetch { - my $sock = new IO::Socket::INET ( - PeerAddr => $guineapig, - PeerPort => 80, - Proto => 'tcp' - ); - return 0 unless $sock; - print $sock "GET $targetfile HTTP/1.0\r\n"; - print $sock "Host: www.cs.princeton.edu\r\n"; - print $sock "\r\n"; - - my $success=0; - while (<$sock>) { - if (/$magic/g) { - $success=1; - last; - } - } - close ($sock); - if ($success==1) { - $numsynacks=$numsynacks+1; - } - return $success; -} - -sub mfetch { - foreach (1..$numiter) { - fetch; - } -} - -sub launch { - my @tarray; - foreach (1..$numthreads) { - my $thr = threads->create(\&mfetch); - push @tarray,$thr; - } - - for (@tarray) { - $_->join; - } -} - -sub open_tcpdump { - my $filter="'tcp[tcpflags]&tcp-syn !=0 and tcp[tcpflags]&tcp-ack !=0 and src $guineapig'"; - my $cmdline="/usr/sbin/tcpdump -c $numpackets $filter"; - my $p; - - system($cmdline); -} - -sub alhandler { - print "[FAILED] tcpdump apparently did not intercept all SYN/ACK packets\n"; - exit(-1); -} - -print "Starting tcpdump...\n"; -my $tcpdthr=threads->create(\&open_tcpdump); -sleep 10; -print "Generating connections...\n"; -launch; -$SIG{ALRM}=\&alhandler; -alarm(60); -$tcpdthr->join; -$numsynacks++; -print "[SUCCESS] Test completed OK. $numsynacks SYN/ACK packets intercepted.\n"; diff --git a/qaapi/qa/tests/node/vsys_launch.pl b/qaapi/qa/tests/node/vsys_launch.pl index 46a4045..6e287b3 100755 --- a/qaapi/qa/tests/node/vsys_launch.pl +++ b/qaapi/qa/tests/node/vsys_launch.pl @@ -10,7 +10,9 @@ if ($#ARGV>0) { else { $prefix="pl"; } -# my $prefix="ple"; + +# Setting temporarily for Thierry's test environment +$prefix="ple"; my $slice="$prefix"."_netflow"; my $slicedir="/vservers/$slice"; -- 2.43.0