Commit aa5628b8 authored by Mike Hibler's avatar Mike Hibler
Browse files

Pass along a "report only" option to tell linktest just to run the tests

and report the numbers without passing judgement on the results.
parent cccd82d9
......@@ -2,7 +2,7 @@
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2005 University of Utah and the Flux Group.
# Copyright (c) 2000-2006 University of Utah and the Flux Group.
# All rights reserved.
#
......@@ -21,10 +21,10 @@ use POSIX ":sys_wait_h";
sub usage()
{
print "Usage: linktest.proxy [-d level] -u user -g gid -e pid/eid ".
"-l level -o logfile -t timeout\n";
"-l level -o logfile -t timeout -r\n";
exit(-1);
}
my $optlist = "d:u:g:e:l:o:t:";
my $optlist = "d:u:g:e:l:o:t:r";
my $debug = 0;
my $user;
my $gid;
......@@ -33,6 +33,7 @@ my $eid;
my $level;
my $logfile;
my $timeout;
my $reportonly = 0;
#
# Configure variables
......@@ -105,6 +106,9 @@ if (defined($options{"t"})) {
if (defined($options{"o"})) {
$output = $options{"o"};
}
if (defined($options{"r"})) {
$reportonly = $options{"r"};
}
#
# Okay, now flip to user before running linktest. Must put the user
......@@ -138,6 +142,8 @@ push(@cmdandargs, ("-t", $timeout))
if (defined($timeout));
push(@cmdandargs, ("-o", $output))
if (defined($output));
push(@cmdandargs, "-r")
if (defined($reportonly));
exec(@cmdandargs);
die("*** $0:\n".
......
......@@ -24,15 +24,17 @@ sub usage()
"-t - Specify timeout in seconds.\n".
"-o - Specify output file for linktest results.\n".
"-m - Send email to swapper if linktest fails.\n".
"-r - Report results only, don't flag errors.\n".
"-d - Turn on debugging output.\n");
exit(-1);
}
my $optlist = "dkl:o:t:mf";
my $optlist = "dkl:o:t:mfr";
my $debug = 2;
my $cancel = 0;
my $sendmail = 0;
my $hosed = 0;
my $forcerun = 0;
my $reportonly = 0;
my $timeout;
my $level;
my $output;
......@@ -86,6 +88,9 @@ if (defined($options{"d"})) {
if (defined($options{"m"})) {
$sendmail = 1;
}
if (defined($options{"r"})) {
$reportonly = 1;
}
if (defined($options{"f"})) {
$forcerun = 1;
}
......@@ -377,6 +382,8 @@ push(@cmdargs, ("-g", $unix_gidname));
push(@cmdargs, ("-u", $dbuid));
push(@cmdargs, ("-e", "$pid/$eid"));
push(@cmdargs, ("-o", $errlog));
push(@cmdargs, "-r")
if ($reportonly);
print "Running '@cmdargs'\n"
if ($debug);
......
......@@ -17,17 +17,19 @@ use POSIX;
sub usage()
{
print "Usage: run_linktest.pl ".
"[-q] [-d level] [-t timeout] [-v] [-s server] [-p port] [-k keyfile] [-l level] [-o logfile] -e pid/eid\n".
"[-q] [-r] [-d level] [-t timeout] [-v] [-s server] [-p port] [-k keyfile] [-l level] [-o logfile] -e pid/eid\n".
"Use -q for quick termination mode, which skips the Bandwidth test\n".
"Use -r to report results, but not errors\n" .
"Use -v for verbose feedback messages\n" .
"Use -t <time> to set a timeout in seconds\n";
exit(1);
}
my $optlist = "vqd:s:p:k:e:L:l:o:t:";
my $optlist = "vqrd:s:p:k:e:L:l:o:t:";
my $debug = 0;
my $verbose = 0;
my $timeout = 0;
my $reportonly = 0;
my $server;
my $keyfile;
my $port;
......@@ -171,6 +173,9 @@ if (defined($options{"p"})) {
" Bad data in port: $port\n");
}
}
if (defined($options{"r"})) {
$reportonly = 1;
}
if (defined($options{"e"})) {
($pid,$eid) = split(/\//, $options{"e"});
}
......@@ -221,6 +226,8 @@ $args .= " -x START";
$args .= " STARTAT=$startAt STOPAT=$stopAt";
$args .= " DEBUG=$debug"
if ($debug);
$args .= " REPORTONLY=1"
if ($reportonly);
system($args);
if ($?) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment