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

Two new functions:

* A node method to create a startup routine:

	$node start-command "$mydir/batchcmd.sh >& $mydir/b1.log"

* And some old style syntactic pepper:

	tb-set-node-startcommand $nodeb1 "$mydir/batchcmd.sh >& $mydir/b1.log"

The latter is intended to replace the exiting tb-set-node-startup
function. The new implementation of the above is to use a program
object that starts at time 0.
parent 1a0ef135
......@@ -355,3 +355,19 @@ Node instproc add_routes_to_DB {DB} {
$sim spitxml_data "virt_routes" [list "vname" "dst" "nexthop" "dst_type" ] [list $self $dstip $hopip $type ]
}
}
#
# Create a program object to run on the node when the experiment starts.
#
Node instproc start-command {command} {
$self instvar sim
set newprog [new Program $sim]
$newprog set node $self
$newprog set command $command
# Starts at time 0
$sim at 0 "$newprog start"
return $newprog
}
......@@ -632,3 +632,16 @@ proc tb-set-sync-server {node} {
}
set sync_server $node
}
#
# Set the startup command for a node. Replaces the tb-set-node-startup
# command above, but we have to keep that one around for a while. This
# new version dispatched to the node object, which uses a program object.
#
proc tb-set-node-startcommand {node command} {
if {[$node info class] != "Node"} {
perror "\[tb-set-node-startcommand] $node is not a node."
return
}
return [$node start-command $command]
}
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