8 from vstf.agent.unittest.perf import model
9 from vstf.agent import softagent
12 class TestCallback(model.Model):
14 super(TestCallback, self).setUp()
15 self.agent = softagent.softAgent()
16 for ns, dev, ip_setting in zip(self.ns_list, self.device_list, self.ip_setting_list):
20 'ip_setting': ip_setting
22 self.mgr.config_dev(netdev)
29 "namespace": self.ns_list[0],
30 "protocol": "tcp_lat",
32 {"ip": self.ip_list[1]}
44 "namespace": self.ns_list[1],
49 super(TestCallback, self).tearDown()
54 self.start['tool'] = 'netperf'
55 self.stop['tool'] = 'netperf'
56 self.start['action'] = 'receive'
57 self.start['operation'] = 'start'
58 self.start['params']['namespace'] = self.ns_list[1]
59 self.start['params']['protocol'] = 'udp_bw'
60 agent.perf_run(**self.start)
61 self.start['action'] = 'send'
62 self.start['operation'] = 'start'
63 self.start['params']['namespace'] = self.ns_list[0]
64 agent.perf_run(**self.start)
68 if __name__ == "__main__":
71 logging.getLogger(__name__)
72 logging.basicConfig(level=logging.DEBUG)
73 # import sys;sys.argv = ['', 'Test.testName']
76 if __name__ == "__main__":
79 logging.basicConfig(level=logging.DEBUG)