From fc989e6da313fd3f0f90a6e0e85c1361cbe8c516 Mon Sep 17 00:00:00 2001 From: Sapan Bhatia Date: Fri, 1 Aug 2008 02:47:14 +0000 Subject: [PATCH] Misread the tests repo. Found the right directory this time. --- node_tests/nmapitest.py | 10 --- node_tests/ping.pl | 40 ------------ node_tests/synacks.pl | 86 -------------------------- node_tests/traceroutes.pl | 124 -------------------------------------- 4 files changed, 260 deletions(-) delete mode 100755 node_tests/nmapitest.py delete mode 100755 node_tests/ping.pl delete mode 100755 node_tests/synacks.pl delete mode 100755 node_tests/traceroutes.pl diff --git a/node_tests/nmapitest.py b/node_tests/nmapitest.py deleted file mode 100755 index f934eb1..0000000 --- a/node_tests/nmapitest.py +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/python -# Module: VNET+ -# Description: -# Connect to the node manager -# Author: acb@cs.princeton.edu - -from xmlrpclib import ServerProxy - -nodemanager = ServerProxy('http://127.0.0.1:812/') -nodemanager.SetLoans('pl_sirius', []) diff --git a/node_tests/ping.pl b/node_tests/ping.pl deleted file mode 100755 index bbc4b58..0000000 --- a/node_tests/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/node_tests/synacks.pl b/node_tests/synacks.pl deleted file mode 100755 index 6f7ef6a..0000000 --- a/node_tests/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/node_tests/traceroutes.pl b/node_tests/traceroutes.pl deleted file mode 100755 index 9297799..0000000 --- a/node_tests/traceroutes.pl +++ /dev/null @@ -1,124 +0,0 @@ -#!/usr/bin/perl - -# Module: VNET+ -# Description: Trace the route path to a node using two methods: TCP-related ICMP errors, and TTL expiry. -# Then match the two paths to see that they concord. If there's a slight difference, it's probably OK given that -# some routers might support one type of error but not the other, and that the routes are not guaranteed to be the -# same. -# Dependencies: tcptraceroute, traceroute, which -# Author: sapanb@cs.princeton.edu - -$|=1; - -# ******************************************************************************** -# CONFIGURATION - - -# The node that we're going to trace route. It's probably a good idea to change it -# periodically so that we don't harass the same host. -my $guineapig="vini-veritas.net"; - -# Location of traceroute, tcptraceroute -my $ttraceroute=`which tcptraceroute 2>/dev/null`; -my $traceroute=`which traceroute 2>/dev/null`; - -chop($ttraceroute); -chop($traceroute); - -if ($traceroute !~ /^\//) { - $traceroute=`which tracepath 2>/dev/null`; - chop($traceroute); -} - -if (!-e "$ttraceroute") { - print $ttraceroute."\n"; - die("[FAILED] Please install tcptraceroute in the slice before running this test\n"); -} -else { - print "Found rcptraceroute. Good.\n"; -} - -if ($traceroute !~ /^\//) { - die("[FAILED] Please install traceroute in the slice before running this test\n"); -} - -my %hash; - -sub open_tcptraceroute { - my $cmdline="$ttraceroute $guineapig"; - my $out=''; - open TT,"$cmdline|"; - - while () { - if (/\((\d+\.\d+\.\d+\.\d+)\)/) { - $hash{$1}++; - } - } -} - -sub open_traceroute { - my $ref=shift; - my $cmdline="$traceroute $guineapig"; - my $out=''; - open TT,"$cmdline|"; - glob %hash; - - while () { - if (/\((\d+\.\d+\.\d+\.\d+)\)/) { - if ($ref->{$1}) {print $ref->{$1};} - $hash{$1}=$hash{$1}+1; - if ($ref->{$1}) {print $ref->{$1};} - } - } -} - -sub compare { - my $ref=shift; - my $ret=1; - my $double=0; - my $single=0; - foreach (keys %hash) { - print "$_->".$a1{$_}."\n"; - if ($hash{$_}==1) { - $single++; - } elsif ($hash{$_}==2) { - print "Concorded on $_\n"; - $double++; - } - else { die ("[FAILED] bug in test script (sorry!).\n");} - - } - return ($single,$double); -} - -sub alhandler { - print "[FAILED] Timed out waiting.\n"; - exit(-1); -} - -print "Starting tcptraceroute...\n"; -if (fork==0) { - my %r1; - my $s; - my $d; - - open_tcptraceroute; - open_traceroute; - ($s,$d)=compare; - if ($s==0 && $d>2) { - print "[SUCCESS] traceroute and tcptraceroute reported the same result. $d hops.\n"; - exit(0); - } - elsif ($s && $d>2) { - print "[PARTIAL SUCCESS] traceroute and tcptraceroute reported $s different hops out of $d.\n"; - } - else { - print "[FAILED] traceroute and tcptraceroute reported different results\n"; - } -} -else { - print "Generating connections...\n"; - $SIG{ALRM}=\&alhandler; - alarm(60); - wait; -} -- 2.47.0