ACTION = 25
STATUS = 26
GUIDS = 27
+GET_ROUTE = 28
+GET_ADDRESS = 29
# PARAMETER TYPE
STRING = 100
controller_messages = dict({
XML: "%d" % XML,
ACCESS: "%d|%s" % (ACCESS, "%d|%s|%s|%s|%s|%d|%s|%r|%s"),
- TRACE: "%d|%s" % (TRACE, "%d|%d|%s"),
+ TRACE: "%d|%s" % (TRACE, "%d|%d|%s|%s"),
FINISHED: "%d|%s" % (FINISHED, "%d"),
START: "%d" % START,
STOP: "%d" % STOP,
def trace(self, params):
guid = int(params[1])
trace_id = params[2]
- trace = self._testbed.trace(guid, trace_id)
+ attribute = base64.b64decode(params[3])
+ trace = self._testbed.trace(guid, trace_id, attribute)
result = base64.b64encode(trace)
return "%d|%s" % (OK, result)
testbed_guid = int(params[1])
guid = int(params[2])
trace_id = params[3]
- trace = self._controller.trace(testbed_guid, guid, trace_id)
+ attribute = base64.b64decode(params[4])
+ trace = self._controller.trace(testbed_guid, guid, trace_id, attribute)
result = base64.b64encode(trace)
return "%d|%s" % (OK, result)
raise RuntimeError(text)
return int(text)
- def trace(self, guid, trace_id):
+ def trace(self, guid, trace_id, attribute='value'):
msg = testbed_messages[TRACE]
- msg = msg % (guid, trace_id)
+ attribute = base64.b64encode(attribute)
+ msg = msg % (guid, trace_id, attribute)
self._client.send_msg(msg)
reply = self._client.read_reply()
result = reply.split("|")
if code == ERROR:
raise RuntimeError(text)
- def trace(self, testbed_guid, guid, trace_id):
+ def trace(self, testbed_guid, guid, trace_id, attribute='value'):
msg = controller_messages[TRACE]
- msg = msg % (testbed_guid, guid, trace_id)
+ attribute = base64.b64encode(attribute)
+ msg = msg % (testbed_guid, guid, trace_id, attribute)
self._client.send_msg(msg)
reply = self._client.read_reply()
result = reply.split("|")