Commit c0b2800b authored by Leigh B. Stoller's avatar Leigh B. Stoller
Browse files

Simple wrapper scripts to be invoked from the web interface.

parent 242ebd68
......@@ -49,6 +49,8 @@ install: all
install -c tbsetup/tbrun.tcl /usr/testbed/bin/tbrun
install -c tbsetup/vpower /usr/testbed/bin
install -c tbsetup/vsnmpit /usr/testbed/bin
install -c tbsetup/tbdoit /usr/testbed/bin
install -c tbsetup/tbstopit /usr/testbed/bin
#XXX - hackish
rm -rf /usr/testbed/lib/tbsetup
rm -rf /usr/testbed/lib/db
......
#!/usr/bin/perl
#
# This gets invoked from the Web interface. CD into the proper directory
# and do the tb stuff.
#
# usage: tbdoit <path to working directory> <nsfile>
#
my $tbdir = "/usr/testbed/bin/";
if (@ARGV != 2) {
print STDOUT "Usage: tbdoit <working dir> <project> <file>\n";
exit(-1);
}
my $workdir = $ARGV[0];
my $project = $ARGV[1];
my $nsfile = $ARGV[2];
my $base = "$nsfile";
$_ = $nsfile;
s/\.ns//g;
$base = $_;
my $irfile = "$base.ir";
my $repfile = "$base.report";
#
# We run the TB stuff in the given directory.
#
if (! chdir($workdir)) {
print STDOUT "Could not chdir to $workdir\n";
exit(-1);
}
print STDOUT "Running tbprerun with arguments: $project $nsfile\n";
if (system("$tbdir/tbprerun $project $nsfile") == 0) {
print STDOUT "tbprerun failed!\n";
exit(-1);
}
print STDOUT "Running tbrun with arguments: $irfile\n";
if (system("$tbdir/tbrun $irfile") == 0) {
print STDOUT "tbrun failed!\n";
exit(-1);
}
print STDOUT "Running tbreport with arguments: $irfile -v >& $repfile\n";
if (system("$tbdir/tbreport -v $irfile >& $repfile") == 0) {
print STDOUT "tbreport failed!\n";
exit(-1);
}
print STDOUT "Setup Success\n";
exit 0;
#!/usr/bin/perl
#
# This gets invoked from the Web interface. CD into the proper directory
# and do the tb stuff.
#
# usage: tbstopit <path to working directory> <irfile>
#
my $tbdir = "/usr/testbed/bin/";
if (@ARGV != 2) {
print STDOUT "Usage: tbstopit <working dir> <irfile>\n";
exit(-1);
}
my $workdir = $ARGV[0];
my $irfile = $ARGV[1];
#
# We run the TB stuff in the given directory.
#
if (! chdir($workdir)) {
print STDOUT "Could not chdir to $workdir\n";
exit(-1);
}
print STDOUT "Running tbend with arguments: $irfile\n";
if (system("$tbdir/tbend $irfile") == 0) {
print STDOUT "tbend failed!\n";
exit(-1);
}
print STDOUT "Termination Success\n";
exit 0;
Supports Markdown
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