diff options
author | Yiting.Li <liyiting@huawei.com> | 2015-12-22 17:11:12 -0800 |
---|---|---|
committer | Yiting.Li <liyiting@huawei.com> | 2015-12-22 17:11:12 -0800 |
commit | 8f1101df131a4d3e03b377738507d88b745831c0 (patch) | |
tree | 73f140474fcec2a77c85a453f6946957ca0742d1 /vstf/vstf/agent/unittest/perf/test_vstfperf.py | |
parent | 1a24ebbda3f95600c0e7d5ed8661317a8ff7e265 (diff) |
Upload the contribution of vstf as bottleneck network framework.
End to End Performance test
JIRA:BOTTLENECK-29
Change-Id: Ib2c553c8b60d6cda9e7a7b52b737c9139f706ebd
Signed-off-by: Yiting.Li <liyiting@huawei.com>
Diffstat (limited to 'vstf/vstf/agent/unittest/perf/test_vstfperf.py')
-rwxr-xr-x | vstf/vstf/agent/unittest/perf/test_vstfperf.py | 98 |
1 files changed, 98 insertions, 0 deletions
diff --git a/vstf/vstf/agent/unittest/perf/test_vstfperf.py b/vstf/vstf/agent/unittest/perf/test_vstfperf.py new file mode 100755 index 00000000..30d7c7fd --- /dev/null +++ b/vstf/vstf/agent/unittest/perf/test_vstfperf.py @@ -0,0 +1,98 @@ +""" +Created on 2015-9-28 + +@author: y00228926 +""" +import unittest + +from vstf.agent.perf.vstfperf import Vstfperf +from vstf.agent.unittest.perf import model + + +class Test(model.Model): + def setUp(self): + super(Test, self).setUp() + + for ns, dev, ip_setting in zip(self.ns_list, self.device_list, self.ip_setting_list): + net_dev = { + "namespace":ns, + "iface":dev, + 'ip_setting':ip_setting + } + self.mgr.config_dev(net_dev) + + self.start = { + "operation": "start", + "action": "send", + "tool": "netperf", + "params":{ + "namespace": self.ns_list[0], + "protocol": "tcp_lat", + "dst":[ + {"ip": self.ip_list[1]} + ], + "size": 64, + "threads": 1, + "time": 1, + }, + } + self.stop = { + "operation": "stop", + "action": "send", + "tool": "netperf", + "params":{ + "namespace": self.ns_list[1], + }, + } + + def tearDown(self): + super(Test, self).tearDown() + + def testNetperf(self): + perf = Vstfperf() + self.start['tool'] = 'netperf' + self.stop['tool'] = 'netperf' + self.start['action'] = 'receive' + self.start['operation'] = 'start' + self.start['params']['namespace'] = self.ns_list[1] + self.start['params']['protocol'] = 'udp_bw' + perf.run(**self.start) + self.start['action'] = 'send' + self.start['operation'] = 'start' + self.start['params']['namespace'] = self.ns_list[0] + perf.run(**self.start) + self.stop['action'] = 'send' + self.stop['operation'] = 'stop' + self.stop['params']['namespace'] = self.ns_list[0] + perf.run(**self.stop) + self.stop['action'] = 'receive' + self.stop['operation'] = 'stop' + self.stop['params']['namespace'] = self.ns_list[1] + perf.run(**self.stop) + + def testQperf(self): + perf = Vstfperf() + self.start['tool'] = 'qperf' + self.stop['tool'] = 'qperf' + self.start['action'] = 'receive' + self.start['operation'] = 'start' + self.start['params']['namespace'] = self.ns_list[1] + perf.run(**self.start) + self.start['action'] = 'send' + self.start['operation'] = 'start' + self.start['params']['namespace'] = self.ns_list[0] + perf.run(**self.start) + self.stop['action'] = 'send' + self.stop['operation'] = 'stop' + self.stop['params']['namespace'] = self.ns_list[0] + perf.run(**self.stop) + self.stop['action'] = 'receive' + self.stop['operation'] = 'stop' + self.stop['params']['namespace'] = self.ns_list[1] + perf.run(**self.stop) + + +if __name__ == "__main__": + import logging + logging.basicConfig(level = logging.DEBUG) + unittest.main()
\ No newline at end of file |