### Connection functions ####
+def connect_cross(testbed_instance, guid, cross_data):
+ connected = True
+ testbed_instance.set(guid, "cross", True)
+
### Creation functions ###
def create_node(testbed_instance, guid):
- element = NODE
- testbed_instance.elements[guid] = element
+ testbed_instance.elements[guid] = NODE
def create_iface(testbed_instance, guid):
- element = IFACE
- testbed_instance.elements[guid] = element
+ testbed_instance.elements[guid] = IFACE
def create_application(testbed_instance, guid):
- element = APP
- testbed_instance.elements[guid] = element
+ testbed_instance.elements[guid] = APP
### Start/Stop functions ###
"max": 1,
"min": 0
}),
+ "cross": dict({
+ "help": "Connector to an Interface in other testbed",
+ "name": "cross",
+ "max": 1,
+ "min": 0
+ }),
})
connections = [
dict({
"from": (TESTBED_ID, NODE, "devs"),
"to": (TESTBED_ID, IFACE, "node"),
- "code": None,
"can_cross": False
}),
dict({
"from": (TESTBED_ID, IFACE, "iface"),
"to": (TESTBED_ID, IFACE, "iface"),
- "code": None,
"can_cross": False
}),
dict({
"from": (TESTBED_ID, NODE, "apps"),
"to": (TESTBED_ID, APP, "node"),
- "code": None,
"can_cross": False
- })
-]
+ }),
+ dict({
+ "from": (TESTBED_ID, IFACE, "cross"),
+ "to": ("mock2", IFACE, "cross"),
+ "init_code": connect_cross,
+ "can_cross": True,
+ })]
attributes = dict({
"fake": dict({
"help": "fake attribute",
"type": Attribute.BOOL,
"value": False,
- "range": None,
- "allowed": None,
"validation_function": validation.is_bool
}),
"test": dict({
"type": Attribute.STRING,
"validation_function": validation.is_string
}),
+ "cross": dict({
+ "name": "cross",
+ "help": "Attribute that indicates if cross connection was performed",
+ "type": Attribute.BOOL,
+ "value": False,
+ "validation_function": validation.is_bool
+ })
})
traces = dict({
"status_function": None,
"allow_addresses": True,
"factory_attributes": ["fake"],
- "box_attributes": ["fake","test"],
- "connector_types": ["node", "iface"]
+ "box_attributes": ["fake", "test", "cross"],
+ "connector_types": ["node", "iface", "cross"]
}),
APP: dict({
"help": "Fake application",
"start_function": None,
"stop_function": None,
"status_function": status_application,
- "box_attributes": ["fake","test"],
+ "box_attributes": ["fake", "test"],
"connector_types": ["node"],
"traces": ["fake"]
}),