# need a definition!
class Factory(AttributesMap):
def __init__(self, factory_id, create_function, start_function,
- stop_function, status_function, configure_function,
+ stop_function, status_function,
+ configure_function, preconfigure_function,
allow_addresses = False, allow_routes = False):
super(Factory, self).__init__()
self._factory_id = factory_id
self._stop_function = stop_function
self._status_function = status_function
self._configure_function = configure_function
+ self._preconfigure_function = preconfigure_function
self._connector_types = dict()
self._traces = list()
self._box_attributes = AttributesMap()
def configure_function(self):
return self._configure_function
+ @property
+ def preconfigure_function(self):
+ return self._preconfigure_function
+
@property
def traces(self):
return self._traces
self._box_attributes.add_attribute(name, help, type, value, range,
allowed, flags, validation_function)
-class TestbedInstance(object):
+class TestbedController(object):
def __init__(self, testbed_id, testbed_version):
self._testbed_id = testbed_id
self._testbed_version = testbed_version
self._netrefs = dict()
self._root_dir = root_dir
+ self.persist_experiment_xml()
+
@property
def experiment_xml(self):
return self._experiment_xml
+ def persist_experiment_xml(self):
+ xml_path = os.path.join(self._root_dir, "experiment.xml")
+ f = open(xml_path, "w")
+ f.write(self._experiment_xml)
+ f.close()
+
def set_access_configuration(self, testbed_guid, access_config):
self._access_config[testbed_guid] = access_config
# perform create-connect in parallel, wait
# (internal connections only)
self._parallel([lambda : (testbed.do_create(),
- testbed.do_connect())
+ testbed.do_connect(),
+ testbed.do_preconfigure())
for testbed in self._testbeds.itervalues()])
# resolve netrefs