Commit 3ef691db authored by Mike Hibler's avatar Mike Hibler

Wrap up sanity-checking tcpdump in a script so that it can be properly

killed when the STOP event is received.

Also fix a couple of minor nits.
parent 0c56299e
......@@ -331,7 +331,7 @@ for {set i 1} {$i <= $num_pcs} {incr i} {
lappend stublist $planetstub($i)
lappend planetstublist $planetstub($i)
set plabsanitycheck($i) [$planet($i) program-agent -expected-exit-code $ecode -command "sudo /usr/sbin/tcpdump -w /local/logs/SanityCheck.log -i vnet \\( \\(tcp and dst host $planet($i) and dst port $stub_peer_port \\) or \\(udp and dst host $planet($i) and dst port $udp_stub_peer_port \\) \\) "]
set plabsanitycheck($i) [$planet($i) program-agent -command "/local/pelab/run-sanity.sh vnet $planet($i) $stub_peer_port $udp_stub_peer_port"]
lappend sanitychecklist $plabsanitycheck($i)
......@@ -385,7 +385,7 @@ for {set i 1} {$i <= $num_pcs} {incr i} {
lappend serverlist $server($i)
lappend clientlist $client($i)
set elabsanitycheck($i) [$elab($i) program-agent -expected-exit-code $ecode -command "sudo tcpdump -w /local/logs/SanityCheck.log -i any \\( \\(tcp and dst host $elab($i) \\) or \\(udp and dst host $elab($i) \\) \\) "]
set elabsanitycheck($i) [$elab($i) program-agent -command "/local/pelab/run-sanity.sh any $elab($i) "]
lappend sanitychecklist $elabsanitycheck($i)
......
......@@ -5,7 +5,7 @@
# All rights reserved.
#
files="pelab/auto-pelab.ns pelab/common-env.sh pelab/init-elabnodes.pl pelab/dbmonitor pelab/libnetmon pelab/magent pelab/monitor pelab/pelabdb.pwd pelab/stub pelab/iperfd"
files="pelab/auto-pelab.ns pelab/common-env.sh pelab/init-elabnodes.pl pelab/run-sanity.sh pelab/dbmonitor pelab/libnetmon pelab/magent pelab/monitor pelab/pelabdb.pwd pelab/stub pelab/iperfd"
if [ $# != 1 ]; then
echo "usage: $0 tarball-path"
......
#!/bin/sh
#
# EMULAB-COPYRIGHT
# Copyright (c) 2006, 2007 University of Utah and the Flux Group.
# All rights reserved.
#
#
# This is really only needed in order to start/stop tcpdump as root...
#
if [ $# -lt 2 ]; then
echo "usage: run-sanity iface node"
exit 1
fi
iface=$1
node=$2
if [ $# -eq 4 ]; then
tdexpr="( ( tcp and dst port $3 ) or ( udp and dst port $4 ) )"
else
tdexpr="( tcp or udp )"
fi
ARGS="-i $iface -w /local/logs/SanityCheck.log dst host $node and $tdexpr"
echo "Running tcpdump $ARGS"
sudo tcpdump $ARGS &
PID=$!
trap "sudo kill $PID; sudo killall tcpdump" EXIT
wait
exit 0
#!/usr/bin/perl -w
#
# EMULAB-COPYRIGHT
# Copyright (c) 2006 University of Utah and the Flux Group.
# Copyright (c) 2006, 2007 University of Utah and the Flux Group.
# All rights reserved.
#
......@@ -273,6 +273,9 @@ if ($realplab && $initelab && !$use_simplemodel) {
# if (system "$pelabdir/$INITCOND -C $pid $eid") {
# warn "Error initializing Emulab links with initial path conditions\n";
# }
} else {
# avoid old stale conditions
unlink("/proj/$pid/exp/$eid/tmp/initial-conditions.txt");
}
print "##### Restarting servers\n";
......
#!/usr/bin/perl -w
#
# EMULAB-COPYRIGHT
# Copyright (c) 2006 University of Utah and the Flux Group.
# Copyright (c) 2006, 2007 University of Utah and the Flux Group.
# All rights reserved.
#
......@@ -11,7 +11,7 @@ use Getopt::Std;
my $TEVC = "/usr/testbed/bin/tevc";
my $LOGHOLE = "/usr/testbed/bin/loghole";
my $optlist = "n:t";
my $optlist = "nt";
my $nologs = 0;
my $sanityChecks = 0;
......
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