Commit ace17ac1 authored by Jonathon Duerig's avatar Jonathon Duerig

Merge branch 'master' of git-public.flux.utah.edu:/flux/git/emulab-devel

parents 7199fd8a f32313ce
......@@ -52,6 +52,8 @@ ELVIN_COMPAT=changeme
# The name of the outer boss for inner boss to request services from.
OUTERBOSS_NODENAME=changeme
TBCOOKIESUFFIX=changeme
# XXX hack to work around perl bug
SELFLOADER_DATA=changeme
#
# SSL Certificate stuff. Used to customize config files in ssl directory.
# Note that OrganizationalUnit is set in the cnf file.
......
#!/usr/bin/perl -w -T
#!/usr/bin/perl -w
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2007 University of Utah and the Flux Group.
# Copyright (c) 2010 University of Utah and the Flux Group.
# All rights reserved.
#
use strict;
my $PROJROOT = "@PROJROOT_DIR@";
my $CLIENT_VARDIR = "@CLIENT_VARDIR@";
my $CLIENT_BINDIR = "@CLIENT_BINDIR@";
my $EVENTSERVER = "@EVENTSERVER@";
# un-taint path
$ENV{'PATH'} = '/bin:/usr/bin:/usr/local/bin';
delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'};
my $argString = join(" ", @ARGV);
my $argString .= " LOGDIR=$PROJROOT VARDIR=$CLIENT_VARDIR BINDIR=$CLIENT_BINDIR EVENTSERVER=$EVENTSERVER";
my $linktest = "@CLIENT_BINDIR@/linktest.pl";
system("$CLIENT_BINDIR/linktest.pl $argString");
my @emulab_defaults = (
"PROJDIR=@PROJROOT_DIR@",
"VARDIR=@CLIENT_VARDIR@",
"BINDIR=@CLIENT_BINDIR@",
"EVENTSERVER=@EVENTSERVER@"
);
my $argString = join(" ", @emulab_defaults);
# add these after the defaults so we can override the defaults
$argString .= " " . join(" ", @ARGV);
exec("$linktest $argString") or
die("could not exec linktest.pl");
......@@ -15,11 +15,6 @@ use Socket;
my $LINKTEST_VERSION = "1.2";
#
# XXX config stuff that does not belong on the client-side
#
#my $PROJROOT = "@PROJROOT_DIR@";
#
# Linktest test script. This script is set up to run as root on
# experiment nodes. It is invoked by the Linktest daemon after the
......@@ -182,7 +177,6 @@ my $rtproto; # routing protocol
my $hostname; # this hosts name
my $exp_id; # experiment id
my $proj_id; # project id
my $gid; # group id
my $platform; # name of platform
my $startat=1; # which test to start at
my $stopat=99; # which test to stop at
......@@ -207,7 +201,6 @@ my %linkmembers;
my @links; # links: list of edge structs.
# sorted alphabetically by src . dst
my $expt_path; # experiment path (ie, tbdata) set by init.
my $linktest_path; # log path (ie tbdata/linktest) set by init.
my $simname = "ns";
my $swapper = "";
......@@ -237,11 +230,15 @@ $| = 1; #Turn off line buffering on output
# Make sure that files written into the experiment subdir are group writable.
umask(0002);
# Traditional Emulab defaults that can be overridden but must be set
our $VARDIR = "/var/emulab";
our $BINDIR = "/usr/local/etc/emulab";
our $PROJDIR = "/proj";
our $LOGRUN = "";
our $PROJROOT = "";
our $VARDIR = "";
our $BINDIR = "";
our $LOGDIR = "";
our $EVENTSERVER = "";
our $EVENTID = "";
#
# Parse command arguments. Since Linktest is run via the event system,
......@@ -280,11 +277,14 @@ foreach my $arg (@ARGV) {
$LOGRUN = $1;
}
if($arg =~ /LOGDIR=(.+)/) {
$PROJROOT = $1;
$LOGDIR = $1;
}
if($arg =~ /VARDIR=(.+)/) {
$VARDIR = $1;
}
if($arg =~ /PROJDIR=(.+)/) {
$PROJDIR = $1;
}
if($arg =~ /BINDIR=(.+)/) {
$BINDIR = $1;
}
......@@ -330,28 +330,32 @@ if ($printsched) {
# experiment ID and the project ID.
#
my $fname = $PATH_NICKNAME;
die("Could not locate $fname\n") unless -e $fname;
my @results = &read_file($fname);
($hostname, $exp_id, $proj_id) = split /\./, $results[0];
chomp $hostname;
chomp $exp_id;
chomp $proj_id;
# taint check pid/eid
if ($proj_id =~ /([-\w]*)/) {
$proj_id = $1;
}
if ($exp_id =~ /([-\w]*)/) {
$exp_id = $1;
if (-r $fname) {
my $name = `cat $fname`;
if ($name =~ /([-\@\w]*)\.([-\@\w]*)\.([-\@\w]*)/) {
$hostname = $1;
$exp_id = $2;
$proj_id = $3;
} else {
die("Could not parse $fname info\n");
}
} else {
die("Could not locate $fname\n");
}
$gid = $proj_id;
#
# Now that we know the pid/eid, defaults some values (unless otherwise set).
#
$LOGDIR = "$PROJDIR/$proj_id/exp/$exp_id/tbdata"
if ($LOGDIR eq "");
$EVENTID = "$proj_id/$exp_id"
if ($EVENTID eq "");
#
# Set path variables storing the experiment logging path,
# the current ns file and the output file for topology info.
#
$expt_path = "$PROJROOT/$proj_id/exp/$exp_id/tbdata";
$linktest_path = "$expt_path/linktest";
$linktest_path = "$LOGDIR/linktest";
$topology_file = $PATH_TOPOFILE;
$ptopology_file = $PATH_PTOPOFILE;
......@@ -380,7 +384,7 @@ sleep(int(rand(5)));
$synserv = "";
my $ssname = $PATH_SYNCSERVER;
if ($ssname) {
@results = &read_file($ssname);
my @results = &read_file($ssname);
($synserv) = split/\./, $results[0];
chomp $synserv;
}
......@@ -2439,7 +2443,7 @@ sub post_event {
"-s",
$EVENTSERVER,
"-e",
"$proj_id/$exp_id",
$EVENTID,
"-k",
$PATH_KEYFILE,
"-x",
......@@ -2466,7 +2470,7 @@ sub post_event2 {
"-s",
$EVENTSERVER,
"-e",
"$proj_id/$exp_id",
$EVENTID,
"-k",
$PATH_KEYFILE,
"-x",
......@@ -2492,7 +2496,7 @@ sub sim_event {
}
system($PATH_TEVC,
"-e", "$proj_id/$exp_id",
"-e", $EVENTID,
"-k", $PATH_KEYFILE,
"now",
$simname,
......@@ -2511,7 +2515,7 @@ sub sim_event2 {
}
system($PATH_TEVC,
"-e", "$proj_id/$exp_id",
"-e", $EVENTID,
"-k", $PATH_KEYFILE,
"now",
$simname,
......
perl -w -T linktest.pl.in STARTAT=1 STOPAT=4 DOARP=0 NODES=node1,node2 LOGDIR=/proj BINDIR=/usr/testbed/lib VARDIR=/var/emulab/
perl -w -T linktest.pl.in STARTAT=1 STOPAT=4 DOARP=0 NODES=node1,node2 PROJDIR=/proj BINDIR=/usr/testbed/lib VARDIR=/var/emulab
......@@ -311,7 +311,7 @@ sub doboot()
#
# FreeBSD version specific adjustments for defaults.
#
if ($FBSD_VERSION == 7.2) {
if ($FBSD_VERSION >= 7.2) {
$emulabconfig{"MFSVERSION"} = "72";
} else {
$emulabconfig{"MFSVERSION"} = "62";
......@@ -2099,6 +2099,19 @@ sub CreateDefsFile($)
last SWITCH;
};
/^SELFLOADER_DATA$/ && do {
#
# XXX we know that the emulab-*-3.x package sets include
# perl 5.10 which has a bug with taint checking which in
# turn is triggered by the SelfLoader we use. So turn
# it off when perl 5.10 is used. Otherwise don't set
# the variable at all so it will default correctly.
#
if ($emulabconfig{BOSS_PKG} =~ /^emulab-boss-3/) {
print OUTDEFS "SELFLOADER_DATA=""\n";
}
last SWITCH;
};
print OUTDEFS $line;
}
}
......@@ -2305,6 +2318,7 @@ sub GetEmulabSource($)
mysystem("rsync -a --delete /usr/src/ $destdir/testbed");
}
else {
print "Downloading current testbed software from ${bossname}\n";
#
# Get the tarball from the server.
#
......@@ -2359,12 +2373,12 @@ sub RecreateDir($$)
# If it is a mount point, unmount it. Otherwise, rename it.
#
if (-d "$dir") {
if (system("umount $dir") == 0) {
if (system("umount $dir >/dev/null 2>&1") == 0) {
# was a mounted FS, need to remove it from fstab if present
mysystem("sed -i '.orig' -E '\\;\[\[:space:\]\]$TBDIR\[\[:space:\]\];d' /etc/fstab");
}
# remove it if it is empty
rmdir("$dir");
rmdir("$dir >/dev/null 2>&1");
}
#
......
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