Commit 47d55472 authored by Leigh Stoller's avatar Leigh Stoller

Add tb-set-jail-os and tb-set-delay-os to set the experiment wide

jail and delay node OSIDs. When set, will override anything in the
node_types table. Use with caution.
parent 27f3f38d
......@@ -44,6 +44,9 @@ proc tb-set-useveth {link onoff} {}
proc tb-set-allowcolocate {lanlink onoff} {}
proc tb-set-colocate-factor {factor} {}
proc tb-set-node-startcmd {node cmd} {}
proc tb-set-encapsulate {onoff} {}
proc tb-set-jail-os {os} {}
proc tb-set-delay-os {os} {}
Class Program
......
......@@ -232,6 +232,10 @@ namespace eval GLOBALS {
# Control veth encapsulation
variable veth_encapsulate 1
# Allow override of jail and delay osids.
variable jail_osname {}
variable delay_osname {}
}
# Load all our classes
......
......@@ -248,6 +248,8 @@ Simulator instproc run {} {
var_import ::GLOBALS::cpu_usage
var_import ::GLOBALS::mem_usage
var_import ::GLOBALS::veth_encapsulate
var_import ::GLOBALS::jail_osname
var_import ::GLOBALS::delay_osname
var_import ::TBCOMPAT::objtypes
var_import ::TBCOMPAT::eventtypes
......@@ -349,6 +351,15 @@ Simulator instproc run {} {
lappend fields "sync_server"
lappend values $default_sync_server
}
if { $jail_osname != {} } {
lappend fields "jail_osname"
lappend values $jail_osname
}
if { $delay_osname != {} } {
lappend fields "delay_osname"
lappend values $delay_osname
}
$self spitxml_data "experiments" $fields $values
......
......@@ -712,3 +712,31 @@ proc tb-set-encapsulate {onoff} {
set veth_encapsulate $onoff
}
#
# Control jail and delay nodes osnames.
#
proc tb-set-jail-os {os} {
var_import ::GLOBALS::jail_osname
if {! ${GLOBALS::anonymous} && ! ${GLOBALS::passmode}} {
var_import ::TBCOMPAT::osids
if {! [info exists osids($os)]} {
perror "\[tb-set-jail-os] Invalid osid $os."
return
}
}
set jail_osname $os
}
proc tb-set-delay-os {os} {
var_import ::GLOBALS::delay_osname
if {! ${GLOBALS::anonymous} && ! ${GLOBALS::passmode}} {
var_import ::TBCOMPAT::osids
if {! [info exists osids($os)]} {
perror "\[tb-set-delay-os] Invalid osid $os."
return
}
}
set delay_osname $os
}
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