2 # -*- coding: utf-8 -*-
4 from constants import TESTBED_ID
5 from nepi.core import testbed_impl
7 class TestbedController(testbed_impl.TestbedController):
8 def __init__(self, testbed_version):
9 super(TestbedController, self).__init__(TESTBED_ID, testbed_version)
14 def do_configure(self):
17 def set(self, time, guid, name, value):
18 super(TestbedController, self).set(time, guid, name, value)
20 def get(self, time, guid, name):
22 return self.box_get(time, guid, name)
23 except KeyError, AttributeError:
26 def get_route(self, guid, index, attribute):
28 return self.box_get_route(guid, int(index), attribute)
29 except KeyError, AttributeError:
32 def get_address(self, guid, index, attribute='Address'):
34 return self.box_get_address(guid, int(index), attribute)
35 except KeyError, AttributeError:
38 def action(self, time, guid, action):
39 raise NotImplementedError
41 def trace(self, guid, trace_id, attribute='value'):
42 if attribute == 'value':
43 return """PING 10.0.0.2 (10.0.0.2) 56(84) bytes of data.
45 --- 10.0.0.2 ping statistics ---
46 1 packets transmitted, 1 received, 0% packet loss, time 0ms
48 elif attribute == 'path':