Commit 7a43cdde authored by Christopher Alfeld's avatar Christopher Alfeld
Browse files

Updated to use a single argument for uniqueness. Name of IR file no

longer means anything.

tbend now also takes the extra argument.

Fixed tbreport.
parent d56506ce
#!/usr/local/bin/otclsh
if {$argc != 3} {
puts "usage: $argv0 project ns_input_file ir_file"
puts "usage: $argv0 id ns_input_file ir_file"
exit 1
}
set project [lindex $argv 0]
set id [lindex $argv 0]
set nsfile [lindex $argv 1]
set irfile [lindex $argv 2]
......@@ -73,6 +73,6 @@ source $libdir/sim.tcl
source $libdir/stubs.tcl
set prefix $project[lindex [split [lindex [split $nsfile /] end] .] 0]
set prefix $id
source $nsfile
......@@ -39,13 +39,14 @@ set resetvlans "$scriptdir/resetvlans.tcl"
source $libir
namespace import TB_LIBIR::ir
if {$argc != 1} {
puts stderr "Syntax: $argv0 <ir-file>"
if {$argc != 2} {
puts stderr "Syntax: $argv0 <id> <ir-file>"
exit 1
}
set nsFile [lindex $argv 0]
set t [split $nsFile .]
set irFile [lindex $argv 1]
set id [lindex $argv 0]
set t [split $irFile .]
set prefix [join [lrange $t 0 [expr [llength $t] - 2]] .]
set irFile "$prefix.ir"
set logFile "$prefix.log"
......@@ -76,7 +77,7 @@ foreach pair $nodemap {
lappend machines [lindex $pair 1]
}
if {[catch "exec $nfree $prefix $machines >@ $logFp 2>@ $logFp err"]} {
if {[catch "exec $nfree $id $machines >@ $logFp 2>@ $logFp err"]} {
outs stderr "Error freeing resources. ($err)"
exit 1
}
......
......@@ -49,6 +49,7 @@ set ns2ir "$scriptdir/ns2ir/parse.tcl"
set postparse "$scriptdir/ns2ir/postparse.tcl"
set assign "$scriptdir/ir/assign.tcl"
set handle_ip "$scriptdir/ir/handle_ip.tcl"
set handle_os "$scriptdir/ir/handle_os.tcl"
set avail "$updir/db/avail"
set ptopgen "$updir/db/ptopgen"
set ptopfile "/tmp/testbed[pid].ptop"
......@@ -59,14 +60,14 @@ source $libir
namespace import TB_LIBIR::ir
if {$argc != 2} {
puts stderr "Syntax: $argv0 <project> <ns-file>"
puts stderr "Syntax: $argv0 <id> <ns-file>"
exit 1
}
set nsFile [lindex $argv 1]
set t [split $nsFile .]
set project [lindex $argv 0]
set prefix "$project[join [lrange $t 0 [expr [llength $t] - 2]] .]"
set id [lindex $argv 0]
set prefix [join [lrange $t 0 [expr [llength $t] - 2]] .]
set irFile "$prefix.ir"
set logFile "$prefix.log"
......@@ -87,7 +88,7 @@ if {! [file exists $nsFile]} {
}
outs "Parsing ns input."
if {[catch "exec $ns2ir $project $nsFile $irFile >@ $logFp 2>@ $logFp" err]} {
if {[catch "exec $ns2ir $id $nsFile $irFile >@ $logFp 2>@ $logFp" err]} {
outs stderr "Error parsing ns input. ($err)"
exit 1
}
......@@ -139,7 +140,7 @@ foreach pair $nodemap {
}
outs "Reserving resources."
if {[catch "exec $reserve $prefix $machines >@ $logFp 2>@ $logFp" err]} {
if {[catch "exec $reserve $id $machines >@ $logFp 2>@ $logFp" err]} {
outs stderr "Error reserving resources. ($err)"
unlock
exit 1
......@@ -153,6 +154,12 @@ if {[catch "exec $handle_ip $irFile $nsFile >@ $logFp 2>@ $logFp" err]} {
exit 1
}
outs "Parsing OS information."
if {[catch "exec $handle_os $irFile $nsFile >@ $logFp 2>@ $logFp" err]} {
outs stderr "Error parsing OS information. ($err)"
exit 1
}
outs "Setup finished - $irFile generated."
......@@ -12,7 +12,7 @@ if {$scriptdir == "."} {set scriptdir [pwd]}
###
if {[file exists $scriptdir/ns2ir]} {
# development tree
set updir [file dirname $scriptdir]
set updir [file dirname $scriptdir]/lib
} else {
# install tree
set updir [file dirname $scriptdir]/lib
......
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