8 from vstf.agent.perf.vstfperf import Vstfperf
9 from vstf.agent.unittest.perf import model
12 class Test(model.Model):
14 super(Test, self).setUp()
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(net_dev)
29 "namespace": self.ns_list[0],
30 "protocol": "tcp_lat",
32 {"ip": self.ip_list[1]}
44 "namespace": self.ns_list[1],
49 super(Test, self).tearDown()
51 def testNetperf(self):
53 self.start['tool'] = 'netperf'
54 self.stop['tool'] = 'netperf'
55 self.start['action'] = 'receive'
56 self.start['operation'] = 'start'
57 self.start['params']['namespace'] = self.ns_list[1]
58 self.start['params']['protocol'] = 'udp_bw'
59 perf.run(**self.start)
60 self.start['action'] = 'send'
61 self.start['operation'] = 'start'
62 self.start['params']['namespace'] = self.ns_list[0]
63 perf.run(**self.start)
64 self.stop['action'] = 'send'
65 self.stop['operation'] = 'stop'
66 self.stop['params']['namespace'] = self.ns_list[0]
68 self.stop['action'] = 'receive'
69 self.stop['operation'] = 'stop'
70 self.stop['params']['namespace'] = self.ns_list[1]
75 self.start['tool'] = 'qperf'
76 self.stop['tool'] = 'qperf'
77 self.start['action'] = 'receive'
78 self.start['operation'] = 'start'
79 self.start['params']['namespace'] = self.ns_list[1]
80 perf.run(**self.start)
81 self.start['action'] = 'send'
82 self.start['operation'] = 'start'
83 self.start['params']['namespace'] = self.ns_list[0]
84 perf.run(**self.start)
85 self.stop['action'] = 'send'
86 self.stop['operation'] = 'stop'
87 self.stop['params']['namespace'] = self.ns_list[0]
89 self.stop['action'] = 'receive'
90 self.stop['operation'] = 'stop'
91 self.stop['params']['namespace'] = self.ns_list[1]
95 if __name__ == "__main__":
97 logging.basicConfig(level = logging.DEBUG)