Commit 52447f5d authored by Dan Gebhardt's avatar Dan Gebhardt

Copyrights.

parent 1a8cd5b3
#!/usr/bin/perl -w
#
# EMULAB-COPYRIGHT
# Copyright (c) 2006 University of Utah and the Flux Group.
# All rights reserved.
#
package Cmdqueue;
use strict;
......
#!/usr/bin/perl -w
#
# EMULAB-COPYRIGHT
# Copyright (c) 2006 University of Utah and the Flux Group.
# All rights reserved.
#
use strict;
use lib '/usr/testbed/lib';
......
#!/usr/bin/perl -w
#
# EMULAB-COPYRIGHT
# Copyright (c) 2006 University of Utah and the Flux Group.
# All rights reserved.
#
use strict;
use lib '/usr/testbed/lib';
......@@ -600,7 +605,6 @@ sub sendcmd_amc($)
if(defined $socket){
print $socket "$sercmd\n";
my $res = <$socket>;
# print "got status: $res";
print "$res";
chomp $res;
if( $res eq "OK" ){
......@@ -623,6 +627,7 @@ sub edittest_amc( $$$$$$ ){
print "edittest_amc : @_ \n";
my %cmd = ( expid => $bgmonexpt,
managerID=> $thisManagerID,
cmdtype => "EDIT",
dstnode => $destnode,
srcnode => $srcnode,
......
#!/usr/bin/perl -w
#
# EMULAB-COPYRIGHT
# Copyright (c) 2006 University of Utah and the Flux Group.
# All rights reserved.
#
=pod
......
#!/usr/bin/perl
#
# EMULAB-COPYRIGHT
# Copyright (c) 2006 University of Utah and the Flux Group.
# All rights reserved.
#
#
#TODO:
......
#!/usr/bin/perl -w
#
# EMULAB-COPYRIGHT
# Copyright (c) 2005 University of Utah and the Flux Group.
# Copyright (c) 2006 University of Utah and the Flux Group.
# All rights reserved.
#
......
#!/usr/bin/perl -w
#
# EMULAB-COPYRIGHT
# Copyright (c) 2006 University of Utah and the Flux Group.
# All rights reserved.
#
package libwanetmon;
......@@ -217,6 +223,7 @@ sub sendcmd_evsys($$$;$)
"$name",
$cmd{$name} ) )
{ warn "Could not add attribute to notification\n"; }
# print "adding $name => ".$cmd{$name}."\n";
}
#send notification
......
#!/usr/bin/perl
#
# EMULAB-COPYRIGHT
# Copyright (c) 2006 University of Utah and the Flux Group.
# All rights reserved.
#
use lib '/usr/testbed/lib';
use libtbdb;
......@@ -113,8 +118,8 @@ while (1) {
# print "accepting connection\n";
$cmdHandle = $handle->accept();
my $inmsg = <$cmdHandle>;
print "gotmsg from amc: $inmsg\n";
chomp $inmsg;
print "gotmsg from amc: $inmsg\n";
%sockIn = %{ deserialize_hash($inmsg) };
my $srcnode = $sockIn{srcnode};
my @res = sendcmd( $srcnode, \%sockIn ); #send hash on out
......@@ -192,12 +197,8 @@ sub callbackFunc($$$) {
print "got EDIT: $srcnode, $dstnode: $newexpid\n";
# my $socket;
# my $sel = IO::Select->new();
# only automanager can send "forever" edits (duration=0)
if( $duration > 0 || $managerID eq "automanagerclient" ){
if( isCmdValid(\%cmd) ){
print "sending cmd to $srcnode on behalf of $managerID\n";
sendcmd( $srcnode, \%cmd );
}
......@@ -243,7 +244,11 @@ sub callbackFunc($$$) {
"$testper,$duration,$managerID,$newexpid\n";
# only automanager can send "forever" edits (duration=0)
if( $duration > 0 ){ #|| $managerID eq "automanagerclient" ){
# if( $duration > 0 ){ #|| $managerID eq "automanagerclient" ){
# print "sending cmd from $srcnode\n";
# sendcmd( $srcnode, \%cmd );
# }
if( isCmdValid(\%cmd) ){
print "sending cmd from $srcnode\n";
sendcmd( $srcnode, \%cmd );
}
......@@ -264,6 +269,49 @@ sub callbackFunc($$$) {
}
sub isCmdValid($)
{
my ($cmdref) = @_;
my $valid = 1;
#list of invalid conditions
if( $cmdref->{managerID} ne "automanagerclient" ){
#managerclient is not the AMC
if( $cmdref->{duration} eq "0" ){
#only AMC can send "forever" commands
$valid = 0;
}elsif( $cmdref->{testtype} eq "bw" )
{
my @destnodes;
if( $cmdref->{cmdtype} eq "INIT" ){
@destnodes = split(" ",$cmdref->{destnodes});
}elsif( $cmdref->{cmdtype} eq "EDIT" ){
push @destnodes, $cmdref->{dstnode};
}
my $numDest = scalar(@destnodes);
#bandwidth must conform to limit
#SET TO MAX RATE, but it becomes VALID
#for now, just limit duration if bw period is low
if( $cmdref->{testper} < 600 &&
$cmdref->{duration} > 120 )
{
$cmdref->{duration} = "120";
$cmdref->{testper} = "600";
}
#limit duration, if testper is given with a duty-cycle
# higher than 20% for the given size set of destinations
elsif( $cmdref->{duration} > 120 &&
$cmdref->{testper} < ($numDest-1) * 5 * 1/.20 )
{
$cmdref->{duration} = "120";
}
}
}
return $valid;
}
=pod
sub event_poll_amc($){
my ($handle) = @_;
......
#!/usr/bin/perl -W
#
# EMULAB-COPYRIGHT
# Copyright (c) 2006 University of Utah and the Flux Group.
# All rights reserved.
#
#
# Configure variables
......
#!/usr/bin/perl
#
# EMULAB-COPYRIGHT
# Copyright (c) 2006 University of Utah and the Flux Group.
# All rights reserved.
#
########################
# TODO:
......@@ -89,6 +94,10 @@ TBDBConnect($DBNAME,$DBUSER,$DBPWD);
my $socket_rcv = IO::Socket::INET->new( LocalPort => $port,
Proto => 'udp' );
#my $socket_snd = IO::Socket::INET->new( PeerPort => $sendport,
# Proto => 'udp',
# PeerAddr => "$linksrc");
my $sel = IO::Select->new();
$sel->add($socket_rcv);
......@@ -148,10 +157,17 @@ sub handleincomingmsgs()
"tstamp =$tstamp\n") if( $debug > 1 );
if( defined $linksrc ){
my $socket_snd =
IO::Socket::INET->new( PeerPort => $sendport,
Proto => 'udp',
PeerAddr => "$linksrc");
my $socket_snd;
eval{
$socket_snd =
IO::Socket::INET->new( PeerPort => $sendport,
Proto => 'udp',
PeerAddr => "$linksrc");
};
if( $@ ){
#socket creation was fatal
warn "Socket creation failed: $@\n";
}
my %ack = ( expid => $expid,
cmdtype => "ACK",
index => $index,
......
#!/bin/bash
#
# EMULAB-COPYRIGHT
# Copyright (c) 2006 University of Utah and the Flux Group.
# All rights reserved.
#
rm bgmon.tar.gz
#tar -czf bgmon.tar.gz bgmon.pl runbgmon event.pm
tar -czf bgmon.tar.gz bgmon.pl libwanetmon.pm runbgmon
tar -czf bgmon.tar.gz bgmon.pl libwanetmon.pm Cmdqueue.pm runbgmon
cp bgmon.tar.gz /proj/tbres/gebhardt/wanetmonstuff/
#rm /proj/tbres/gebhardt/wanetmonstuff/iperfd.tar.gz
#rm /proj/tbres/gebhardt/wanetmonstuff/fping.tar.gz
......
#!/usr/bin/perl
#
# EMULAB-COPYRIGHT
# Copyright (c) 2006 University of Utah and the Flux Group.
# All rights reserved.
#
use strict;
......
#!/usr/bin/perl
#
# EMULAB-COPYRIGHT
# Copyright (c) 2006 University of Utah and the Flux Group.
# All rights reserved.
#
use Getopt::Std;
......@@ -36,8 +41,8 @@ if( @ARGV < 1 ){
my $path = $ARGV[0];
#system "sudo perl -mevent -I. -I/usr/testbed/lib -d $ARGV[0]bgmon.pl &";
system "perl $path/bgmon.pl -e $expt -i $iperfport -d $path/ &";
#system "sudo perl $path/bgmon.pl -e $expt -i $iperfport -d $path/ >/tmp/bgmon.log&";
system "sudo perl -I$path $path/bgmon.pl -e $expt -i $iperfport -d $path/&";
system "sudo rm $path/iperfd.out $path/iperfd.err";
system "sudo $path/iperfd -s -p $iperfport >& $path/iperfd.err > $path/iperfd.out &";
......
#!/usr/bin/perl
#
# EMULAB-COPYRIGHT
# Copyright (c) 2006 University of Utah and the Flux Group.
# All rights reserved.
#
#
# Configure variables
......
......@@ -44,6 +44,9 @@ load onto nodes.
+ testsend.pl - Run on ops. Sends a command to a single node. Command
line parameters not used can be set to anything for placeholders.
+ libwanetmon.pm - Common subroutines and variables used in many
scripts in this system.
(Overview - bgmon.pl)
......@@ -78,11 +81,16 @@ run. The applications are ping and a modified iperf. (iperf is
modified to exit with an error code) When a test is ready to be run,
bgmon forks one of these test apps with its output redirected to a
temporary file. When the test app exits, bgmon parses this file for a
result. There is room for improvement for the implementation of
handling a finished process: a child process of bgmon is probably not
correctly reaped when it exits. Currently, a waitpid is called with
the pid of each running test. A test app is finished, and the entry in
%testevents is marked as such, when a 0 is returned.
result, and sends it to ops.
There are a variety of possible errors that the measurement apps can
have. These are detected by parsing the measurement output. If the
test was determined to have an error, the corresponding numeric error
value is looked up in the hash ERRID, in libwanetmon.pm . This error
value is stored in the test result field of the data structure sent to
ops. Ops adds this to the database like any other "valid" test
result. Later analysis of the data can look for these error values when
evaluating a path.
Program flow for bgmon revolves around a poll loop. Each iteration, it
blocks on a select call for a number of seconds (0.1, currently) to
......@@ -96,9 +104,8 @@ A test result is cached in a file before being sent to ops. It is
deleted when ops returns an ack message with the corresponding
index. There is a limit for how many ack-pending files can exist. When
the limit is reached, newly-completed tests are sent to ops, but not
cached until an ack for an existing file is received. Every so many
iterations (set by $subtimer) of the main poll loop, all cached
results are sent to ops again.
cached until an ack for an existing file is received. Cached results
are resent to ops at a rate determined with the cacheSendRate variable.
The scheduling algorithm does not guarantee completion of measurements
with hard time bounds as a real-time system does. However, there are
......
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