From: Sapan Bhatia Date: Thu, 19 Mar 2009 16:43:54 +0000 (+0000) Subject: -help file for ping X-Git-Tag: tests-4.3-0~8 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=1adf7878550efbc8a2d8d0dfb6c97adc5a7ba874;p=tests.git -help file for ping -modified traceroutes test that is more robust -nmapitest, which for some reason wasn't checked in :-/ --- diff --git a/qaapi/qa/tests/slice/nmapitest.py b/qaapi/qa/tests/slice/nmapitest.py new file mode 100755 index 0000000..f934eb1 --- /dev/null +++ b/qaapi/qa/tests/slice/nmapitest.py @@ -0,0 +1,10 @@ +#!/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/qaapi/qa/tests/slice/ping.help b/qaapi/qa/tests/slice/ping.help new file mode 100644 index 0000000..2a307be --- /dev/null +++ b/qaapi/qa/tests/slice/ping.help @@ -0,0 +1,5 @@ +Description: Ping test for VNET+. +Action: Send out ping echo requests to a given IP. +Pass: ping echo replies return for each outgoing request. +Fail: one or more echo requests go unanswered. +Author: sapanb@cs.princeton.edu diff --git a/qaapi/qa/tests/slice/traceroutes.pl b/qaapi/qa/tests/slice/traceroutes.pl index 5dfad46..95e7a70 100755 --- a/qaapi/qa/tests/slice/traceroutes.pl +++ b/qaapi/qa/tests/slice/traceroutes.pl @@ -9,6 +9,7 @@ # Author: sapanb@cs.princeton.edu $|=1; +use strict; # ******************************************************************************** # CONFIGURATION @@ -22,6 +23,8 @@ my $guineapig="vini-veritas.net"; my $ttraceroute=`which tcptraceroute 2>/dev/null`; my $traceroute=`which traceroute 2>/dev/null`; +my %tr; + chop($ttraceroute); chop($traceroute); @@ -35,60 +38,55 @@ if (!-e "$ttraceroute") { die("[FAILED] Please install tcptraceroute in the slice before running this test\n"); } else { - print "Found rcptraceroute. Good.\n"; + print "Found tcptraceroute. Good.\n"; } if ($traceroute !~ /^\//) { die("[FAILED] Please install traceroute in the slice before running this test\n"); } -my %hash; - sub open_tcptraceroute { - my $cmdline="sudo $ttraceroute $guineapig"; + my $cmdline="sudo $ttraceroute $guineapig 2>&1"; + print $cmdline."\n"; my $out=''; open TT,"$cmdline|"; while () { if (/\((\d+\.\d+\.\d+\.\d+)\)/) { - glob %hash; - print ">>> $_"; - $hash{$1}++; + glob %tr; + $tr{"IP$1"}++; + print ">>>$1\n"; } } } sub open_traceroute { my $ref=shift; - my $cmdline="$traceroute $guineapig"; + my $cmdline="$traceroute $guineapig 2>&1"; my $out=''; print $cmdline."\n"; open TT,"$cmdline|"; while () { if (/\((\d+\.\d+\.\d+\.\d+)\)/) { - glob %hash; - print ">>> $_"; - $hash{$1}=$hash{$1}+1; + glob %tr; + $tr{"IP$1"}++; + print ">>>$1\n"; } } } sub compare { - my $ref=shift; my $ret=1; my $double=0; my $single=0; - glob %hash; - foreach (keys %hash) { - if ($hash{$_}==1) { + glob %tr; + foreach (keys %tr) { + if ($tr{$_}==1) { $single++; - } elsif ($hash{$_}==2) { - print "Concorded on $_\n"; + } elsif ($tr{$_}==2) { $double++; } - else { die ("[FAILED] Could not complete test.\n");} - } return ($single,$double); } @@ -98,25 +96,23 @@ sub alhandler { exit(-1); } -print "Starting tcptraceroute...\n"; if (fork==0) { my %r1; my $s; my $d; + glob %tr; 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"; - } + + ($s,$d)=compare; + + if ($d>4) { + print "[SUCCESS] traceroutes succeeded, singles: $s, doubles: $d\n"; + } + else { + print "[FAILED] traceroutes returned different results: $s, $d\n"; + } } else { print "Generating connections...\n";