Commit f3ecb310 authored by Jonathon Duerig's avatar Jonathon Duerig

Bugfix: Actually check in linktest standalone changes.

parent ffa8eaf3
...@@ -14,6 +14,7 @@ NSTOIRDIR = $(TESTBED_SRCDIR)/tbsetup/ns2ir ...@@ -14,6 +14,7 @@ NSTOIRDIR = $(TESTBED_SRCDIR)/tbsetup/ns2ir
DAEMON = linktest DAEMON = linktest
LTEVENT = ltevent LTEVENT = ltevent
SCRIPT = linktest.pl SCRIPT = linktest.pl
SCRIPT_ELAB = elab_linktest.pl
SCRIPT_RUN = run_linktest.pl SCRIPT_RUN = run_linktest.pl
SCRIPT_PROXY = linktest.proxy SCRIPT_PROXY = linktest.proxy
SCRIPT_CONTROL = linktest_control SCRIPT_CONTROL = linktest_control
...@@ -30,7 +31,7 @@ SYSTEM := $(patsubst CYGWIN%,CYGWIN,$(shell uname -s)) ...@@ -30,7 +31,7 @@ SYSTEM := $(patsubst CYGWIN%,CYGWIN,$(shell uname -s))
include $(OBJDIR)/Makeconf include $(OBJDIR)/Makeconf
all: binaries $(SCRIPT) $(SCRIPT_RUN) $(SCRIPT_PROXY) \ all: binaries $(SCRIPT) $(SCRIPT_ELAB) $(SCRIPT_RUN) $(SCRIPT_PROXY) \
weblinktest linktest_control weblinktest linktest_control
include $(TESTBED_SRCDIR)/GNUmakerules include $(TESTBED_SRCDIR)/GNUmakerules
...@@ -139,12 +140,13 @@ client-install: client ...@@ -139,12 +140,13 @@ client-install: client
$(INSTALL_PROGRAM) $(DAEMON) $(DESTDIR)$(CLIENT_BINDIR)/$(DAEMON) $(INSTALL_PROGRAM) $(DAEMON) $(DESTDIR)$(CLIENT_BINDIR)/$(DAEMON)
$(INSTALL_PROGRAM) $(LTEVENT) $(DESTDIR)$(CLIENT_BINDIR)/$(LTEVENT) $(INSTALL_PROGRAM) $(LTEVENT) $(DESTDIR)$(CLIENT_BINDIR)/$(LTEVENT)
$(INSTALL_PROGRAM) $(SCRIPT) $(DESTDIR)$(CLIENT_BINDIR)/$(SCRIPT) $(INSTALL_PROGRAM) $(SCRIPT) $(DESTDIR)$(CLIENT_BINDIR)/$(SCRIPT)
$(INSTALL_PROGRAM) $(SCRIPT_ELAB) $(DESTDIR)$(CLIENT_BINDIR)/$(SCRIPT_ELAB)
$(INSTALL_PROGRAM) $(SCRIPT_RUN) $(DESTDIR)$(CLIENT_BINDIR)/$(SCRIPT_RUN) $(INSTALL_PROGRAM) $(SCRIPT_RUN) $(DESTDIR)$(CLIENT_BINDIR)/$(SCRIPT_RUN)
$(MAKE) -C iperf client-install $(MAKE) -C iperf client-install
$(MAKE) -C rude client-install $(MAKE) -C rude client-install
clean: clean:
rm -f *.o *-debug $(TESTS) $(SCRIPT) $(SCRIPT_RUN) $(SCRIPT_PROXY) \ rm -f *.o *-debug $(TESTS) $(SCRIPT) $(SCRIPT_ELAB) $(SCRIPT_RUN) $(SCRIPT_PROXY) \
weblinktest linktest_control $(DAEMON) $(LTEVENT) version.c weblinktest linktest_control $(DAEMON) $(LTEVENT) version.c
-$(MAKE) -C iperf clean -$(MAKE) -C iperf clean
-$(MAKE) -C rude clean -$(MAKE) -C rude clean
...@@ -9,7 +9,7 @@ Boss: ...@@ -9,7 +9,7 @@ Boss:
Ops: Ops:
-> linktest.proxy -> run_linktest.pl -> linktest.proxy -> run_linktest.pl
Nodes: Nodes:
-> linktest -> linktest.pl -> linktest -> elab_linktest.pl -> linktest.pl
Description of files... Description of files...
...@@ -27,10 +27,21 @@ What it does: ...@@ -27,10 +27,21 @@ What it does:
for a KILL event. for a KILL event.
Who it should run as: Who it should run as:
experiment swapper experiment swapper
Name: Name:
linktest.pl.in elab_linktest.pl.in
Description:
A wrapper which interfaces with Emulab config variables and passes
them on as parameters to linktest.pl
Where it runs:
On nodes only. Runs in the current directory.
What it does:
Invokes linktest.pl with Emulab-specific arguments.
Who it should run as:
Invoked by linktest; therefore experiment swapper.
Name:
linktest.pl
Description: Description:
A test suite for Emulab experiments. A test suite for Emulab experiments.
Where it runs: Where it runs:
...@@ -44,7 +55,7 @@ What it does: ...@@ -44,7 +55,7 @@ What it does:
REPORT events to report on its progress and ultimately, REPORT events to report on its progress and ultimately,
a COMPLETE event when all tests are completed. a COMPLETE event when all tests are completed.
Who it should run as: Who it should run as:
Invoked by linktest; therefore experiment swapper. Invoked by elab_linktest.pl; therefore experiment swapper.
Name: Name:
run_linktest.pl.in run_linktest.pl.in
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#define TRUE 1 #define TRUE 1
#define FALSE 0 #define FALSE 0
#define LINKTEST_SCRIPT CLIENT_BINDIR "/linktest.pl" #define LINKTEST_SCRIPT CLIENT_BINDIR "/elab_linktest.pl"
#define MAX_ARGS 10 #define MAX_ARGS 10
static int debug; static int debug;
......
...@@ -18,7 +18,7 @@ my $LINKTEST_VERSION = "1.2"; ...@@ -18,7 +18,7 @@ my $LINKTEST_VERSION = "1.2";
# #
# XXX config stuff that does not belong on the client-side # XXX config stuff that does not belong on the client-side
# #
my $PROJROOT = "@PROJROOT_DIR@"; #my $PROJROOT = "@PROJROOT_DIR@";
# #
# Linktest test script. This script is set up to run as root on # Linktest test script. This script is set up to run as root on
...@@ -39,12 +39,22 @@ sub usage() ...@@ -39,12 +39,22 @@ sub usage()
" [DOARP=<1=yes, 0=no>]\n". " [DOARP=<1=yes, 0=no>]\n".
" [REPORTONLY=<1=yes, 0=no>]\n". " [REPORTONLY=<1=yes, 0=no>]\n".
" [NODES=<n1,n2...>\n". " [NODES=<n1,n2...>\n".
" [DEBUG=<debugging level. 1=on, 0=off>]\n"); " [DEBUG=<debugging level. 1=on, 0=off>]\n".
" [LOGRUN=<command/used/for/logging>]\n".
" [LOGDIR=<path/to/log/root>]\n".
" [BINDIR=<path/to/binary/files>]\n".
" [VARDIR=<path/to/config/files>]\n".
" [EVENTSERVER=<eventserver hostname>]\n");
print(" <test step>: 1=conn/latency, 2=routing, 3=loss, 4=BW\n". print(" <test step>: 1=conn/latency, 2=routing, 3=loss, 4=BW\n".
" COMPAT=<version>: remain compatible with version <version> or earlier\n". " COMPAT=<version>: remain compatible with version <version> or earlier\n".
" DOARP=1: run a single-ping pass to create ARP entries\n". " DOARP=1: run a single-ping pass to create ARP entries\n".
" REPORTONLY=1: report stats only, do not pass judgement\n". " REPORTONLY=1: report stats only, do not pass judgement\n".
" NODES: comma-separated list of virtnames to run on\n"); " NODES: comma-separated list of virtnames to run on\n".
" LOGRUN: Command to run for high-level logging. The log message as its only argument.".
" LOGDIR: Path used to store stderr logs of individual test utilities.\n".
" BINDIR: Path must contain emulab-rude emulab-crude emulab-iperf\n".
" VARDIR: Path must contain...\n".
" EVENTSERVER: Hostname of event server\n");
exit(0); exit(0);
} }
...@@ -53,23 +63,6 @@ sub usage() ...@@ -53,23 +63,6 @@ sub usage()
# Constants # Constants
############################################################################## ##############################################################################
# path to applications and files
use constant PATH_NICKNAME => "@CLIENT_VARDIR@/boot/nickname";
use constant PATH_KEYFILE => "@CLIENT_VARDIR@/boot/eventkey";
use constant PATH_RUDE => "@CLIENT_BINDIR@/emulab-rude";
use constant PATH_CRUDE => "@CLIENT_BINDIR@/emulab-crude";
use constant PATH_IPERF => "@CLIENT_BINDIR@/emulab-iperf";
use constant PATH_RCTOPO => "@CLIENT_BINDIR@/rc/rc.topomap";
use constant PATH_EMULAB_SYNC => "@CLIENT_BINDIR@/emulab-sync";
use constant PATH_LTEVENT => "@CLIENT_BINDIR@/ltevent";
use constant PATH_TEVC => "@CLIENT_BINDIR@/tevc";
use constant RUN_PATH => "@CLIENT_BINDIR@"; # where the linktest-ns runs.
use constant EVENTSERVER => "@EVENTSERVER@";
use constant PATH_SCHEDFILE => "@CLIENT_VARDIR@/logs/linktest.sched";
use constant PATH_SYNCSERVER => "@CLIENT_VARDIR@/boot/syncserver";
use constant PATH_TOPOFILE => "@CLIENT_VARDIR@/boot/ltmap";
use constant PATH_PTOPOFILE => "@CLIENT_VARDIR@/boot/ltpmap";
# log files used by tests. # log files used by tests.
use constant CRUDE_DAT => "/tmp/crude.dat"; # binary data use constant CRUDE_DAT => "/tmp/crude.dat"; # binary data
use constant RUDE_CFG => "/tmp/rude.cfg"; use constant RUDE_CFG => "/tmp/rude.cfg";
...@@ -244,6 +237,12 @@ $| = 1; #Turn off line buffering on output ...@@ -244,6 +237,12 @@ $| = 1; #Turn off line buffering on output
# Make sure that files written into the experiment subdir are group writable. # Make sure that files written into the experiment subdir are group writable.
umask(0002); umask(0002);
our $LOGRUN = "";
our $PROJROOT = "";
our $VARDIR = "";
our $BINDIR = "";
our $EVENTSERVER = "";
# #
# Parse command arguments. Since Linktest is run via the event system, # Parse command arguments. Since Linktest is run via the event system,
# parse out pairs of <symbol>=<value>. # parse out pairs of <symbol>=<value>.
...@@ -268,14 +267,7 @@ foreach my $arg (@ARGV) { ...@@ -268,14 +267,7 @@ foreach my $arg (@ARGV) {
$debug_level=$1; $debug_level=$1;
} }
if($arg =~ /PRINTSCHED=(\d)/) { if($arg =~ /PRINTSCHED=(\d)/) {
my $schedfile = PATH_SCHEDFILE;
$printsched=$1; $printsched=$1;
if ($printsched) {
open(SCHED, ">$schedfile") or
die("Could not open schedule log file $schedfile");
} else {
unlink($schedfile);
}
} }
if($arg =~ /TOKEN=(\d+)/) { if($arg =~ /TOKEN=(\d+)/) {
$token=$1; $token=$1;
...@@ -284,6 +276,21 @@ foreach my $arg (@ARGV) { ...@@ -284,6 +276,21 @@ foreach my $arg (@ARGV) {
$swapper=$1; $swapper=$1;
(undef,undef,$swapperid,$swappergid) = getpwnam($swapper); (undef,undef,$swapperid,$swappergid) = getpwnam($swapper);
} }
if($arg =~ /LOGRUN=(.+)/) {
$LOGRUN = $1;
}
if($arg =~ /LOGDIR=(.+)/) {
$PROJROOT = $1;
}
if($arg =~ /VARDIR=(.+)/) {
$VARDIR = $1;
}
if($arg =~ /BINDIR=(.+)/) {
$BINDIR = $1;
}
if($arg =~ /EVENTSERVER=(.+)/) {
$EVENTSERVER = $1;
}
} }
$compat = 99 $compat = 99
...@@ -294,11 +301,35 @@ if ($compat < 1.2) { ...@@ -294,11 +301,35 @@ if ($compat < 1.2) {
$arpit = 0; $arpit = 0;
} }
# path to applications and files
our $PATH_NICKNAME = "$VARDIR/boot/nickname";
our $PATH_KEYFILE = "$VARDIR/boot/eventkey";
our $PATH_RUDE = "$BINDIR/emulab-rude";
our $PATH_CRUDE = "$BINDIR/emulab-crude";
our $PATH_IPERF = "$BINDIR/emulab-iperf";
our $PATH_RCTOPO = "$BINDIR/rc/rc.topomap";
our $PATH_EMULAB_SYNC = "$BINDIR/emulab-sync";
our $PATH_LTEVENT = "$BINDIR/ltevent";
our $PATH_TEVC = "$BINDIR/tevc";
our $RUN_PATH = "$BINDIR"; # where the linktest-ns runs.
our $PATH_SCHEDFILE = "$VARDIR/logs/linktest.sched";
our $PATH_SYNCSERVER = "$VARDIR/boot/syncserver";
our $PATH_TOPOFILE = "$VARDIR/boot/ltmap";
our $PATH_PTOPOFILE = "$VARDIR/boot/ltpmap";
my $schedfile = $PATH_SCHEDFILE;
if ($printsched) {
open(SCHED, ">$schedfile") or
die("Could not open schedule log file $schedfile");
} else {
unlink($schedfile);
}
# #
# Parse the nickname file to obtain the host name, # Parse the nickname file to obtain the host name,
# experiment ID and the project ID. # experiment ID and the project ID.
# #
my $fname = PATH_NICKNAME; my $fname = $PATH_NICKNAME;
die("Could not locate $fname\n") unless -e $fname; die("Could not locate $fname\n") unless -e $fname;
my @results = &read_file($fname); my @results = &read_file($fname);
($hostname, $exp_id, $proj_id) = split /\./, $results[0]; ($hostname, $exp_id, $proj_id) = split /\./, $results[0];
...@@ -321,8 +352,8 @@ $gid = $proj_id; ...@@ -321,8 +352,8 @@ $gid = $proj_id;
# #
$expt_path = "$PROJROOT/$proj_id/exp/$exp_id/tbdata"; $expt_path = "$PROJROOT/$proj_id/exp/$exp_id/tbdata";
$linktest_path = "$expt_path/linktest"; $linktest_path = "$expt_path/linktest";
$topology_file = PATH_TOPOFILE; $topology_file = $PATH_TOPOFILE;
$ptopology_file = PATH_PTOPOFILE; $ptopology_file = $PATH_PTOPOFILE;
# #
# Determine what OS we are. Used for handling the occasional difference # Determine what OS we are. Used for handling the occasional difference
...@@ -337,7 +368,7 @@ $ptopology_file = PATH_PTOPOFILE; ...@@ -337,7 +368,7 @@ $ptopology_file = PATH_PTOPOFILE;
# the NFS server. # the NFS server.
# #
sleep(int(rand(5))); sleep(int(rand(5)));
&my_system(PATH_RCTOPO, "reconfig"); &my_system($PATH_RCTOPO, "reconfig");
&get_topo($topology_file, $ptopology_file); &get_topo($topology_file, $ptopology_file);
&debug_top(); &debug_top();
...@@ -347,7 +378,7 @@ sleep(int(rand(5))); ...@@ -347,7 +378,7 @@ sleep(int(rand(5)));
# is not participating, we choose the first node on the host list. # is not participating, we choose the first node on the host list.
# #
$synserv = ""; $synserv = "";
my $ssname = PATH_SYNCSERVER; my $ssname = $PATH_SYNCSERVER;
if ($ssname) { if ($ssname) {
@results = &read_file($ssname); @results = &read_file($ssname);
($synserv) = split/\./, $results[0]; ($synserv) = split/\./, $results[0];
...@@ -438,7 +469,7 @@ if (&dotest(TEST_BW)) { ...@@ -438,7 +469,7 @@ if (&dotest(TEST_BW)) {
&schedlog("start iperf listener"); &schedlog("start iperf listener");
} else { } else {
$listener_iperf = &start_listener(PATH_NICE, "-n", "-10", $listener_iperf = &start_listener(PATH_NICE, "-n", "-10",
PATH_IPERF,"-s","-f","b","-u", $PATH_IPERF,"-s","-f","b","-u",
"-w","200000","-l",IPERF_PKTSIZE); "-w","200000","-l",IPERF_PKTSIZE);
$listeners++; $listeners++;
} }
...@@ -447,7 +478,7 @@ if (&dotest(TEST_LOSS)) { ...@@ -447,7 +478,7 @@ if (&dotest(TEST_LOSS)) {
if ($printsched) { if ($printsched) {
&schedlog("start crude listener"); &schedlog("start crude listener");
} else { } else {
$listener_crude = &start_listener(PATH_CRUDE,"-l",CRUDE_DAT, $listener_crude = &start_listener($PATH_CRUDE,"-l",CRUDE_DAT,
"-P",CRUDE_PRI); "-P",CRUDE_PRI);
$listeners++; $listeners++;
} }
...@@ -744,7 +775,7 @@ sub loss_test { ...@@ -744,7 +775,7 @@ sub loss_test {
", time=" . ", time=" .
LOSS_TEST_DURATION . "s, psize=20)"); LOSS_TEST_DURATION . "s, psize=20)");
} else { } else {
&my_system(PATH_RUDE,"-s", RUDE_CFG, "-P", RUDE_PRI, &my_system($PATH_RUDE,"-s", RUDE_CFG, "-P", RUDE_PRI,
$rude_arg); $rude_arg);
$analyze{$stream_id} = $other_edge; $analyze{$stream_id} = $other_edge;
} }
...@@ -768,7 +799,7 @@ sub loss_test { ...@@ -768,7 +799,7 @@ sub loss_test {
", time=" . ", time=" .
LOSS_TEST_DURATION . "s, psize=20)"); LOSS_TEST_DURATION . "s, psize=20)");
} else { } else {
&my_system(PATH_RUDE,"-s", RUDE_CFG, "-P", RUDE_PRI, &my_system($PATH_RUDE,"-s", RUDE_CFG, "-P", RUDE_PRI,
$rude_arg); $rude_arg);
$analyze{$stream_id} = $edge; $analyze{$stream_id} = $edge;
} }
...@@ -801,7 +832,7 @@ sub loss_test { ...@@ -801,7 +832,7 @@ sub loss_test {
if ($printsched) { if ($printsched) {
@results = (); @results = ();
} else { } else {
@results = &my_tick(PATH_CRUDE,"-d",CRUDE_DAT); @results = &my_tick($PATH_CRUDE,"-d",CRUDE_DAT);
} }
my $result_count = @results; my $result_count = @results;
&debug("result_count from crude: $result_count\n"); &debug("result_count from crude: $result_count\n");
...@@ -1470,7 +1501,7 @@ sub bw_test { ...@@ -1470,7 +1501,7 @@ sub bw_test {
" (bw=${bw}bps, time=${duration}s," . " (bw=${bw}bps, time=${duration}s," .
" sbsize=200000, acktime=${acktime}ms)"); " sbsize=200000, acktime=${acktime}ms)");
} else { } else {
&my_system(PATH_NICE, "-n", "-10", PATH_IPERF, &my_system(PATH_NICE, "-n", "-10", $PATH_IPERF,
"-c", $edge->src . "-" . $edge->name, "-c", $edge->src . "-" . $edge->name,
"-t", "$duration", "-f", "b", "-t", "$duration", "-f", "b",
"-r", "-u", "-w", "200000", "-r", "-u", "-w", "200000",
...@@ -2196,12 +2227,12 @@ sub barrier { ...@@ -2196,12 +2227,12 @@ sub barrier {
return return
if (! $barr_count); if (! $barr_count);
$rc = &my_system(PATH_EMULAB_SYNC,"-i",$barr_count, $rc = &my_system($PATH_EMULAB_SYNC,"-i",$barr_count,
"-n",SYNC_NAMESPACE, "-n",SYNC_NAMESPACE,
"-e",$error_count); "-e",$error_count);
} }
else { else {
$rc = &my_system(PATH_EMULAB_SYNC,"-n", $rc = &my_system($PATH_EMULAB_SYNC,"-n",
SYNC_NAMESPACE,"-e",$error_count); SYNC_NAMESPACE,"-e",$error_count);
} }
...@@ -2395,45 +2426,57 @@ sub wait_all { ...@@ -2395,45 +2426,57 @@ sub wait_all {
sub post_event { sub post_event {
my ($event,$args) = map { $1 if (/(.*)/) } @_; my ($event,$args) = map { $1 if (/(.*)/) } @_;
if($hostname eq $synserv) { if($hostname eq $synserv) {
if ($LOGRUN ne "") {
system("$LOGRUN '$args'");
} elsif ($EVENTSERVER ne "") {
if ($printsched) {
&schedlog("syncserver ltevent $event");
return;
}
system($PATH_LTEVENT,
"-s",
$EVENTSERVER,
"-e",
"$proj_id/$exp_id",
"-k",
$PATH_KEYFILE,
"-x",
"$event",
"$args");
} else {
print $args . "\n";
}
}
}
sub post_event2 {
my ($event,$args) = map { $1 if (/(.*)/) } @_;
if ($LOGRUN ne "") {
system("$LOGRUN '$args'");
} elsif ($EVENTSERVER ne "") {
if ($printsched) { if ($printsched) {
&schedlog("syncserver ltevent $event"); &schedlog("ltevent $event");
return; return;
} }
system(PATH_LTEVENT, system($PATH_LTEVENT,
"-s", "-s",
EVENTSERVER, $EVENTSERVER,
"-e", "-e",
"$proj_id/$exp_id", "$proj_id/$exp_id",
"-k", "-k",
PATH_KEYFILE, $PATH_KEYFILE,
"-x", "-x",
"$event", "$event",
"$args"); "$args");
} else {
print $args . "\n";
} }
} }
sub post_event2 {
my ($event,$args) = map { $1 if (/(.*)/) } @_;
if ($printsched) {
&schedlog("ltevent $event");
return;
}
system(PATH_LTEVENT,
"-s",
EVENTSERVER,
"-e",
"$proj_id/$exp_id",
"-k",
PATH_KEYFILE,
"-x",
"$event",
"$args");
}
# #
# sim_event sends an event to the event scheduler. EVENT_LOG events # sim_event sends an event to the event scheduler. EVENT_LOG events
# deposit their message into the event scheduler log file. Kinda silly # deposit their message into the event scheduler log file. Kinda silly
...@@ -2441,14 +2484,14 @@ sub post_event2 { ...@@ -2441,14 +2484,14 @@ sub post_event2 {
# #
sub sim_event { sub sim_event {
my ($event,$args) = map { $1 if (/(.*)/) } @_; my ($event,$args) = map { $1 if (/(.*)/) } @_;
if($hostname eq $synserv) { if($hostname eq $synserv && $EVENTSERVER ne "") {
if ($printsched) { if ($printsched) {
&schedlog("syncserver tevc $event"); &schedlog("syncserver tevc $event");
return; return;
} }
system(PATH_TEVC, system($PATH_TEVC,
"-e", "$proj_id/$exp_id", "-e", "$proj_id/$exp_id",
"now", "now",
$simname, $simname,
...@@ -2460,17 +2503,19 @@ sub sim_event { ...@@ -2460,17 +2503,19 @@ sub sim_event {
sub sim_event2 { sub sim_event2 {
my ($event,$args) = map { $1 if (/(.*)/) } @_; my ($event,$args) = map { $1 if (/(.*)/) } @_;
if ($printsched) { if ($EVENTSERVER ne "") {
&schedlog("tevc $event"); if ($printsched) {
return; &schedlog("tevc $event");
} return;
}
system(PATH_TEVC, system($PATH_TEVC,
"-e", "$proj_id/$exp_id", "-e", "$proj_id/$exp_id",
"now", "now",
$simname, $simname,
"$event", "$event",
"$args"); "$args");
}
} }
# cleanup any child procs. # cleanup any child procs.
......
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