db7b01c4cf91234156d6a60f976d2c32b074d16c
[nepi.git] / test / lib / mock2 / execute.py
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3
4 from constants import TESTBED_ID, TESTBED_VERSION
5 from nepi.core import testbed_impl
6
7 class TestbedController(testbed_impl.TestbedController):
8     def __init__(self):
9         super(TestbedController, self).__init__(TESTBED_ID, TESTBED_VERSION)
10
11     def do_configure(self):
12         pass
13
14     def action(self, time, guid, action):
15         raise NotImplementedError
16
17     def trace(self, guid, trace_id, attribute='value'):
18         if attribute == 'value':
19             return """PING 10.0.0.2 (10.0.0.2) 56(84) bytes of data.
20
21 --- 10.0.0.2 ping statistics ---
22 1 packets transmitted, 1 received, 0% packet loss, time 0ms
23 """
24         elif attribute == 'path':
25             return '<test>'
26         else:
27             return None
28
29     def shutdown(self):
30             pass
31