Commit 018dd59b authored by Kevin Atkinson's avatar Kevin Atkinson

Small script to set the cloudinfo from an input file.  Only works
on elab experiments for now.
parent 4b9ba9ec
#!/usr/bin/perl
#
# cloudinfo-set: Set the cloud info based on an input file of the form:
#
# <pid> <eid>
# <src> <dst> <bw> <delay> <loss>
#
# Where <src> and <dst> or of the form "elab-*" for now.
use strict;
my $TEVC = "/usr/testbed/bin/tevc";
local $_ = <>;
chop;
my ($pid,$eid) = /^(\S+)\s+(\S+)$/ or die
"First line must be of the form \"<pid> <eid>\"\n";
while (<>) {
my ($src, $dst, $bw, $del, $plr) = split /\s+/;
my $dstix = $dst =~ (/^elab-\d+$/) or die "Host names must be of the form elab-NUM\n";
my $dstip = "10.0.0.$dstix";
my $cmd = "$TEVC -e $pid/$eid now elabc-$src MODIFY ".
"DEST=$dstip BANDWIDTH=$bw DELAY=$del PLR=$plr";
print STDERR "$cmd\n";
system("$cmd");
}
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