Commit 227b0797 authored by Leigh B Stoller's avatar Leigh B Stoller

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

parents 134c6e0d 985db88c
......@@ -14,6 +14,7 @@ NSTOIRDIR = $(TESTBED_SRCDIR)/tbsetup/ns2ir
DAEMON = linktest
LTEVENT = ltevent
SCRIPT = linktest.pl
SCRIPT_ELAB = elab_linktest.pl
SCRIPT_RUN = run_linktest.pl
SCRIPT_PROXY = linktest.proxy
SCRIPT_CONTROL = linktest_control
......@@ -30,7 +31,7 @@ SYSTEM := $(patsubst CYGWIN%,CYGWIN,$(shell uname -s))
include $(OBJDIR)/Makeconf
all: binaries $(SCRIPT) $(SCRIPT_RUN) $(SCRIPT_PROXY) \
all: binaries $(SCRIPT) $(SCRIPT_ELAB) $(SCRIPT_RUN) $(SCRIPT_PROXY) \
weblinktest linktest_control
include $(TESTBED_SRCDIR)/GNUmakerules
......@@ -139,12 +140,13 @@ client-install: client
$(INSTALL_PROGRAM) $(DAEMON) $(DESTDIR)$(CLIENT_BINDIR)/$(DAEMON)
$(INSTALL_PROGRAM) $(LTEVENT) $(DESTDIR)$(CLIENT_BINDIR)/$(LTEVENT)
$(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)
$(MAKE) -C iperf client-install
$(MAKE) -C rude client-install
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
-$(MAKE) -C iperf clean
-$(MAKE) -C rude clean
......@@ -9,7 +9,7 @@ Boss:
Ops:
-> linktest.proxy -> run_linktest.pl
Nodes:
-> linktest -> linktest.pl
-> linktest -> elab_linktest.pl -> linktest.pl
Description of files...
......@@ -27,10 +27,21 @@ What it does:
for a KILL event.
Who it should run as:
experiment swapper
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:
A test suite for Emulab experiments.
Where it runs:
......@@ -44,7 +55,7 @@ What it does:
REPORT events to report on its progress and ultimately,
a COMPLETE event when all tests are completed.
Who it should run as:
Invoked by linktest; therefore experiment swapper.
Invoked by elab_linktest.pl; therefore experiment swapper.
Name:
run_linktest.pl.in
......
#!/usr/bin/perl -w -T
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2007 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@";
my $argString = join(" ", @ARGV);
my $argString .= " LOGDIR=$PROJROOT VARDIR=$CLIENT_VARDIR BINDIR=$CLIENT_BINDIR EVENTSERVER=$EVENTSERVER";
system("$CLIENT_BINDIR/linktest.pl $argString");
......@@ -26,7 +26,7 @@
#define TRUE 1
#define FALSE 0
#define LINKTEST_SCRIPT CLIENT_BINDIR "/linktest.pl"
#define LINKTEST_SCRIPT CLIENT_BINDIR "/elab_linktest.pl"
#define MAX_ARGS 10
static int debug;
......
perl -w -T linktest.pl.in STARTAT=1 STOPAT=4 DOARP=0 NODES=node1,node2 LOGDIR=/proj BINDIR=/usr/testbed/lib VARDIR=/var/emulab/
......@@ -1553,6 +1553,13 @@ sub Credential2SliceAggregate($)
$slice = GeniSlice->Lookup($target_uuid);
}
if (defined($slice)) {
if( $credential->expires() gt $slice->expires() ) {
# The credential presented lasts longer than we though the
# slice did: our expiry date must have been stale. This can
# happen because the SA is always free to extend the lifetime
# of a slice, and is not required to tell us.
$slice->SetExpiration( $credential->expires() );
}
$aggregate = GeniAggregate->SliceAggregate($slice);
}
else {
......
......@@ -28,6 +28,12 @@ FILES = $(wildcard *.py)
FILES += $(wildcard $(SRCDIR)/*.py)
FILES += $(wildcard $(SRCDIR)/*.rspec)
ALLFILES = $(notdir $(FILES))
# Gather up the AM tests and include their subdirectory
AMFILES1 = $(wildcard $(SRCDIR)/am/*.py)
AMFILES = $(addprefix am/, $(notdir $(AMFILES1)))
ALLFILES += $(AMFILES)
TARBALL = $(INSTALL_WWWDIR)/downloads/protogeni-tests.tar.gz
install: install-mkdir \
......@@ -37,7 +43,7 @@ install: install-mkdir \
control-install:
install-mkdir:
-mkdir -p $(INSTALL_TOPDIR)/opsdir/protogeni/test
-mkdir -p $(INSTALL_TOPDIR)/opsdir/protogeni/test/am
clean:
rm -f *.o core *.pl *.pm *.py
......
......@@ -52,7 +52,10 @@ params = [myslice["urn"], [slicecred]]
try:
response = do_method("am", "DeleteSliver", params,
response_handler=geni_am_response_handler)
print "Sliver %s has been deleted." % (SLICENAME)
print "value = %s" % (response)
if response:
print "Sliver %s has been deleted." % (SLICENAME)
else:
msg = "Something went wrong. Sliver %s has not been deleted."
print msg % (SLICENAME)
except xmlrpclib.Fault, e:
Fatal("Could not delete sliver: %s" % (str(e)))
......@@ -79,8 +79,7 @@ print "Renewed the slice, asking for slice credential again";
slicecred = get_slice_credential( myslice, mycredential )
print "Got the slice credential, renewing the sliver";
params = [SLICEURN, [slicecred]]
print "WARNING: No expiration time passed!"
params = [SLICEURN, [slicecred], valid_until]
try:
response = do_method("am", "RenewSliver", params,
response_handler=geni_am_response_handler)
......
......@@ -43,6 +43,7 @@ delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'};
# Protos
sub fatal($);
sub logit($$);
sub NodeIsDead($);
sub NodeIsOkay($);
......@@ -137,7 +138,7 @@ if (! $debug) {
if (MarkDaemonRunning("checknodes_daemon")) {
fatal("Could not mark daemon as running!");
}
print "Check Nodes Daemon starting ... pid $$, at ".`date`;
logit("Check Nodes Daemon starting ... pid $$", 0);
if ($elabman->FlipTo($experiment->unix_gid())) {
fatal("Could not flipto $elabman ($experiment)");
......@@ -163,13 +164,11 @@ while (1) {
my @tmp = ();
my $disabled;
print "Running at ".
POSIX::strftime("20%y-%m-%d %H:%M:%S", localtime()) . "\n";
if (! TBGetSiteVar("web/nologins", \$disabled) || $disabled) {
print " Skipping this loop cause of nologins\n";
logit("Skipping this loop because of nologins", 0);
goto loop;
}
logit("Running", 0);
#
# Look for nodes in a wierd state. Lets test them.
......@@ -193,7 +192,7 @@ while (1) {
while (my ($nodeid,$eventstate,$stamp) = $query_result->fetchrow_array()) {
my $node = Node->Lookup($nodeid);
if (!defined($node)) {
print STDERR "Cannot find object for $nodeid\n";
logit("Cannot find object for $nodeid", 1);
next;
}
#
......@@ -204,7 +203,7 @@ while (1) {
if (!$node->imageable() ||
!defined($node->default_imageid()));
print "Node in unknown state: $nodeid,$eventstate,$stamp\n";
logit("Node in unknown state: $nodeid,$eventstate,$stamp", 0);
next
if ($impotent);
......@@ -214,7 +213,7 @@ while (1) {
# push it into the hwcheckup experiment.
#
if ($node->MoveReservation($experiment)) {
print STDERR "Could not move $node to $experiment\n";
logit("Could not move $node to $experiment", 1);
next;
}
$node->InsertNodeLogEntry($elabman, TB_DEFAULT_NODELOGTYPE(),
......@@ -230,17 +229,17 @@ while (1) {
if (!@nodelist);
if ($impotent) {
print "Would check @nodelist\n";
logit("Would check @nodelist", 0);
goto loop;
}
foreach my $node (@nodelist) {
if ($node->ClearBootAttributes()) {
print STDERR "$node: Could not clear boot attributes.\n";
logit("$node: Could not clear boot attributes.", 1);
next;
}
if (! $node->imageable()) {
print STDERR "$node is not imageable.\n";
logit("$node is not imageable.", 1);
NodeIsDead($node);
push(@informtbopsfatal, $node->node_id());
next;
......@@ -249,24 +248,24 @@ while (1) {
}
@nodelist = @tmp;
print "Checking nodes @nodelist\n";
logit("Checking nodes @nodelist", 0);
if (@nodelist) {
print "Running $GENTOPOFILE ...\n";
logit("Running $GENTOPOFILE ...", 0);
if (system("$GENTOPOFILE $pid $eid")) {
print STDERR "$GENTOPOFILE failed\n";
logit("$GENTOPOFILE failed", 1);
next;
}
print "Running $EXPORTS_SETUP ...\n";
logit("Running $EXPORTS_SETUP ...", 0);
if (system("$EXPORTS_SETUP")) {
print STDERR "$EXPORTS_SETUP failed\n";
logit("$EXPORTS_SETUP failed", 1);
next;
}
# The nodes will not boot locally unless there is a DNS
# record.
print "Running $NAMED_SETUP ...\n";
logit("Running $NAMED_SETUP ...", 0);
if (system("$NAMED_SETUP")) {
print STDERR "$NAMED_SETUP failed\n";
logit("$NAMED_SETUP failed", 1);
next;
}
my @nodenames = map { $_->node_id() } @nodelist;
......@@ -276,10 +275,10 @@ while (1) {
$reload_args{'debug'} = $debug;
$reload_args{'waitmode'} = 2; # XXX Wait till reboot after reload.
$reload_args{'nodelist'} = [ @nodenames ];
print "Running osload on @nodenames\n";
logit("Running osload on @nodenames", 0);
my $failures = osload(\%reload_args, \%reload_results);
if ($failures) {
print STDERR "osload returned $failures failures\n";
logit("osload returned $failures failures", 1);
}
foreach my $node (@nodelist) {
......@@ -317,20 +316,20 @@ while (1) {
}
}
print "Running $GENTOPOFILE ...\n";
logit("Running $GENTOPOFILE ...", 0);
if (system("$GENTOPOFILE $pid $eid")) {
print STDERR "$GENTOPOFILE failed\n";
logit("$GENTOPOFILE failed", 1);
next;
}
print "Running $EXPORTS_SETUP ...\n";
logit("Running $EXPORTS_SETUP ...", 0);
if (system("$EXPORTS_SETUP")) {
print STDERR "$EXPORTS_SETUP failed\n";
logit("$EXPORTS_SETUP failed", 1);
next;
}
# The nodes will not boot locally unless there is a DNS record.
print "Running $NAMED_SETUP ...\n";
logit("Running $NAMED_SETUP ...", 0);
if (system("$NAMED_SETUP")) {
print STDERR "$NAMED_SETUP failed\n";
logit("$NAMED_SETUP failed", 1);
next;
}
loop:
......@@ -344,10 +343,10 @@ sub NodeIsDead($)
my ($node) = @_;
if ($node->MoveReservation($hwdown_experiment)) {
print STDERR "Could not move $node to $hwdown_experiment\n";
logit("Could not move $node to $hwdown_experiment", 1);
return;
}
print STDERR "$node is fatally ill; moving to hwdown.\n";
logit("$node is fatally ill; moving to hwdown.", 1);
$node->InsertNodeLogEntry($elabman, TB_DEFAULT_NODELOGTYPE(),
"Moved to hwdown by checknodes daemon");
}
......@@ -356,7 +355,7 @@ sub NodeIsOkay($)
{
my ($node) = @_;
print STDERR "$node appears to be okay; releasing.\n";
logit("$node appears to be okay; releasing.", 1);
$node->InsertNodeLogEntry($elabman, TB_DEFAULT_NODELOGTYPE(),
"Released by checknodes daemon");
}
......@@ -379,3 +378,14 @@ sub fatal($)
" $msg\n");
}
sub logit($$)
{
my ($msg,$stderr) = @_;
my $stamp = POSIX::strftime("20%y-%m-%d %H:%M:%S", localtime());
if ($stderr) {
print STDERR "$stamp: $msg\n";
} else {
print "$stamp: $msg\n";
}
}
......@@ -199,6 +199,7 @@ if (!defined($experiment)) {
}
my $special = ($pid eq "testbed" || $pid eq "tbres" || $pid eq "geni" ||
$pid eq "emulab-ops" || $pid eq "utahstud" ||
$pid eq "ClemsonGENI" ||
$pid eq "ResiliNets" || $pid eq "gec8tutorial");
my $newsetup = $special;
my $syncvlans = ($pid eq "emulab-ops" || ($MAINSITE && $special));
......
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