Commit e7422d49 authored by Leigh B Stoller's avatar Leigh B Stoller

Address linktest problems reported by Mike in issue #160:

1. Changes to gentopofile to not put in linktest info for links and lan
   with only one member.

2. Fix to the CM for deletenode of a node that has tagged links.

3. Fixes to the status web page for deletenode; we were installing the
   linktest event handlers multiple times.

4. Pass through -N argument to linktest from the CM, when the experiment
   has NFS mounts turned off, so that we use loghole to gather the data
   files (instead of via NFS).

This closes issues #160.
parent 50194e3e
#!/usr/bin/perl -w
#
# Copyright (c) 2000-2011 University of Utah and the Flux Group.
# Copyright (c) 2000-2016 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -37,11 +37,11 @@ use POSIX ":sys_wait_h";
#
sub usage()
{
print "Usage: linktest.proxy [-d level] -u user -p unix_pid -g unix_gid -e pid/eid ".
print "Usage: linktest.proxy [-d level] [-N] -u user -p unix_pid -g unix_gid -e pid/eid ".
"-l level -o logfile -t timeout -r\n";
exit(-1);
}
my $optlist = "d:u:g:e:l:o:t:rp:";
my $optlist = "d:u:g:e:l:o:t:rp:N";
my $debug = 0;
my $user;
my $pid;
......@@ -50,6 +50,7 @@ my $level;
my $logfile;
my $timeout;
my $reportonly = 0;
my $nonfs = 0;
my $unix_gid;
my $unix_pid;
......@@ -128,6 +129,9 @@ if (defined($options{"o"})) {
if (defined($options{"r"})) {
$reportonly = $options{"r"};
}
if (defined($options{"N"})) {
$nonfs = 1
}
#
# Okay, now flip to user before running linktest. Must put the user
......@@ -163,6 +167,8 @@ push(@cmdandargs, ("-o", $output))
if (defined($output));
push(@cmdandargs, "-r")
if ($reportonly);
push(@cmdandargs, "-N")
if ($nonfs);
exec(@cmdandargs);
die("*** $0:\n".
......
......@@ -42,17 +42,19 @@ sub usage()
"-o - Specify output file for linktest results.\n".
"-e - Tell linktest to send error output to stdout or -o file\n".
"-m - Send email to swapper if linktest fails.\n".
"-N - Use loghole instead of NFS shared directory\n".
"-r - Report results only, don't flag errors.\n".
"-d - Turn on debugging output.\n");
exit(-1);
}
my $optlist = "dkl:o:t:mfre";
my $optlist = "dkl:o:t:mfreN";
my $debug = 1;
my $cancel = 0;
my $sendmail = 0;
my $forcerun = 0;
my $reportonly = 0;
my $noerrlog = 0;
my $nonfs = 0;
my $timeout;
my $level;
my $output;
......@@ -105,6 +107,9 @@ if (defined($options{"d"})) {
if (defined($options{"m"})) {
$sendmail = 1;
}
if (defined($options{"N"})) {
$nonfs = 1;
}
if (defined($options{"r"})) {
$reportonly = 1;
}
......@@ -357,6 +362,8 @@ push(@cmdargs, ("-o", $errlog))
if (!$noerrlog);
push(@cmdargs, "-r")
if ($reportonly);
push(@cmdargs, "-N")
if ($nonfs);
print "Running '@cmdargs'\n"
if ($debug > 1);
......
#!/usr/bin/perl -wT
#
# Copyright (c) 2000-2012 University of Utah and the Flux Group.
# Copyright (c) 2000-2016 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -255,7 +255,7 @@ if (!defined($keyfile)) {
}
# path to linktest data.
my $linktest_path = "$expdata_path/linktest";
if ($NOSHAREDFS) {
if ($NOSHAREDFS || $nodelogdir ne "") {
#
# We have to make the log directory since it is not in a shared FS
# (normally the "master" linktest node would do this).
......@@ -585,14 +585,12 @@ sub run_loghole(;$$) {
if (!$remdir || !$localdir) {
$remdir = "/var/emulab/logs";
$localdir = "$PROJROOT/$pid/exp/$eid/tbdata/ltlogs";
print "Downloading logs...\n";
}
print "Downloading logs ... patience please.\n";
system("rm -rf $localdir");
system("mkdir -p $localdir");
system("chmod 775 $localdir");
system("$LOGHOLE -e $pid/$eid sync -P -n -l $localdir -r $remdir ".
"> $localdir/loghole.out 2>&1");
system("$LOGHOLE -e $pid/$eid sync -P -n -l $localdir -r $remdir");
}
sub TBTimeStamp {
......
......@@ -3156,6 +3156,20 @@ sub NoNFSMounts($)
return 0;
}
sub HasNoNFSMounts($)
{
my ($self) = @_;
my $idx = $self->idx();
my $query_result =
DBQueryWarn("select nonfsmounts,nfsmounts from experiments ".
"where idx='$idx' and ".
" (nonfsmounts=1 or nfsmounts='none')");
return 1
if (!$query_result);
return $query_result->numrows;
}
#
# Clear the panic bit.
#
......
......@@ -4449,14 +4449,13 @@ sub SliverWorkAux($$$$$$$$)
$message = "Inconsistent ifacemap; $node_id,$iface_id";
goto bad;
}
if (GeniHRN::IsValid($iface_name)) {
my (undef, undef, $short_iface) =
GeniHRN::ParseInterface($iface_name);
$iface_name = $short_iface;
}
my $interface;
if ($iface_name ne "lo0") {
if (GeniHRN::IsValid($iface_name)) {
my ($authority, $short_node, $short_iface) =
GeniHRN::ParseInterface($iface_name);
$iface_name = $short_iface;
}
$interface = Interface->LookupByIface($node, $iface_name);
if (!defined($interface)) {
$message = "No such interface $iface_name on $node";
......
......@@ -5213,6 +5213,8 @@ sub RunLinktest($)
}
else {
my $command = "$LINKTEST -e -l $level -t 3600 ";
$command .= "-N "
if ($experiment->HasNoNFSMounts());
$command .= "-o " . $logfile->filename() . " "
if (defined($async));
$command .= "$pid $eid";
......
#!/usr/bin/perl -w
#
# Copyright (c) 2000-2014 University of Utah and the Flux Group.
# Copyright (c) 2000-2016 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -526,7 +526,7 @@ foreach my $lan (keys(%virt_lans)) {
}
}
}
else {
elsif (@members > 1) {
foreach my $memb0 (@members) {
my $member0 = $virt_lans{$lan}->{"MEMBERS"}->{$memb0};
......@@ -926,6 +926,8 @@ if ($query_result->numrows) {
if ($havepmap) {
foreach my $vlan (keys(%virt_lans)) {
my @members = @{$virt_lans{$vlan}->{"MEMBERLIST"}};
next
if (@members <= 1);
foreach my $memb0 (@members) {
my $member0 = $virt_lans{$vlan}->{"MEMBERS"}->{$memb0};
my $node0 = $member0->{"vnode"};
......
......@@ -1699,11 +1699,15 @@ function (_, sup, moment, marked, UriTemplate, ShowImagingModal,
* No point in showing linktest if no links at any site.
* For the moment, we do not count links if they span sites
* since linktest does not work across stitched links.
*
* We reset showlinktest cause we get called again after
* a deletenode.
*/
showlinktest = false;
$(xml).find("link").each(function() {
var managers = $(this).find("component_manager");
if (managers.length == 1)
showlinktest++;
showlinktest = true;
});
SetupLinktest(instanceStatus);
}
......@@ -2356,10 +2360,17 @@ function (_, sup, moment, marked, UriTemplate, ShowImagingModal,
//
// Linktest support.
//
var linktestsetup = 0;
function SetupLinktest(status) {
if (hidelinktest || !showlinktest) {
return;
// We might remove a node that removes last link.
return ToggleLinktestButtons(status);
}
if (linktestsetup) {
return ToggleLinktestButtons(status);
}
linktestsetup = 1;
require(['js/lib/text!template/linktest.md'],
function(md) {
$('#linktest-help').html(marked(md));
......@@ -2392,6 +2403,7 @@ function (_, sup, moment, marked, UriTemplate, ShowImagingModal,
}
function ToggleLinktestButtons(status) {
if (hidelinktest || !showlinktest) {
$('#linktest-modal-button').addClass("hidden");
DisableButton("start-linktest");
return;
}
......
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