diff options
author | liyin <liyin11@huawei.com> | 2017-05-08 09:04:32 +0000 |
---|---|---|
committer | Yu Yang (Gabriel) <Gabriel.yuyang@huawei.com> | 2017-05-19 07:58:49 +0000 |
commit | fb9e1a726d3a598494fd38330848ef676219a47a (patch) | |
tree | bfb2d60c1ce3f6688b92e5787818f222d620f52e /testsuites/vstf/vstf_scripts/vstf/controller/sw_perf/model.py | |
parent | 6dff90faee27dc5569255f5cb6ba72ae5e22b924 (diff) |
Delete testcase of rubbos and vstf.
JIRA:BOTTLENECK-167
This patch will delete vstf and rubbos testcase code.
Include some testcase config file,
if there will be someone who want to use this testcase
maybe B or C version code will contain those testcase.
if you use the D version code to run this two testcase
we will info you that:
Rubbos testsuite is not updating anymore.
This entrance for running Rubbos within Bottlenecks is no longer supported.
Change-Id: I04e4042ff3998b3696df2ed47a9ffab6f1620ec3
Signed-off-by: liyin <liyin11@huawei.com>
(cherry picked from commit 6a8257127b3dce1f18a650afe6921a34b6c6f5b8)
Diffstat (limited to 'testsuites/vstf/vstf_scripts/vstf/controller/sw_perf/model.py')
-rw-r--r-- | testsuites/vstf/vstf_scripts/vstf/controller/sw_perf/model.py | 205 |
1 files changed, 0 insertions, 205 deletions
diff --git a/testsuites/vstf/vstf_scripts/vstf/controller/sw_perf/model.py b/testsuites/vstf/vstf_scripts/vstf/controller/sw_perf/model.py deleted file mode 100644 index 8e3e7b22..00000000 --- a/testsuites/vstf/vstf_scripts/vstf/controller/sw_perf/model.py +++ /dev/null @@ -1,205 +0,0 @@ -############################################################################## -# Copyright (c) 2015 Huawei Technologies Co.,Ltd and others. -# -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Apache License, Version 2.0 -# which accompanies this distribution, and is available at -# http://www.apache.org/licenses/LICENSE-2.0 -############################################################################## - -import logging - -from vstf.controller.fabricant import Fabricant -from vstf.controller.sw_perf.raw_data import RawDataProcess -from vstf.common import perfmark as mark - -LOG = logging.getLogger(__name__) - - -class NetDeviceMgr(Fabricant): - - @classmethod - def add(cls, dst, conn, dev): - self = cls(dst, conn) - LOG.info(dev) - ret = self.config_dev(netdev=dev) - LOG.info(ret) - - @classmethod - def remove(cls, dst, conn, dev): - self = cls(dst, conn) - LOG.info(dev) - ret = self.recover_dev(netdev=dev) - LOG.info(ret) - - @classmethod - def clear(cls, dst, conn): - self = cls(dst, conn) - self.clean_all_namespace() - - -class Actor(Fabricant): - - def __init__(self, dst, conn, tool, params): - super(Actor, self).__init__(dst, conn) - self._tool = tool - self._params = params - self._data = {} - - def __repr__(self): - repr_dict = self.__dict__ - repr_keys = sorted(repr_dict.keys()) - return '%s(%s)' % (self.__class__.__name__, ', '.join( - ['%s=%r' % (k, repr_dict[k]) for k in repr_keys])) - - -class Sender(Actor): - - def start(self, pktsize, **kwargs): - LOG.info("Sender.start") - if 'ratep' in kwargs and kwargs['ratep']: - self._params['ratep'] = kwargs['ratep'] - self._params['size'] = pktsize - - ret, info = self.perf_run( - operation="start", - action="send", - tool=self._tool, - params=self._params - ) - LOG.info(ret) - if ret: - raise Exception(info) - LOG.info(info) - print ret - - def stop(self): - LOG.info(self._params) - rets = self.perf_run( - operation="stop", - action="send", - tool=self._tool, - params={} - ) - LOG.info(rets) - minlatency, avglatency, maxlatency = 0, 0, 0 - count = 0 - for (ret, info) in rets: - if ret: - raise Exception(info) - if self.is_data() and ret == 0: - count += 1 - minlatency += info[mark.minLatency] - avglatency += info[mark.avgLatency] - maxlatency += info[mark.maxLatency] - count = 1 if not count else count - self._data[mark.minLatency] = minlatency / count - self._data[mark.avgLatency] = avglatency / count - self._data[mark.maxLatency] = maxlatency / count - - print rets - - def is_data(self): - if '_lat' in self._params['protocol']: - return True - return False - - def result(self): - return self._data - - -class Receiver(Actor): - - def start(self, **kwargs): - LOG.info("Receiver.start") - ret, info = self.perf_run( - operation="start", - action="receive", - tool=self._tool, - params=self._params - ) - LOG.info(ret) - if ret: - raise Exception(info) - LOG.info(info) - return ret - - def stop(self): - LOG.info("Receiver.stop") - ret, info = self.perf_run( - operation="stop", - action="receive", - tool=self._tool, - params=self._params - ) - LOG.info(ret) - if ret: - raise Exception(info) - LOG.info(info) - return ret - - -class NicWatcher(Fabricant): - - def __init__(self, dst, conn, params): - super(NicWatcher, self).__init__(dst, conn) - self._params = params - self._pid = None - self._data = {} - - def start(self): - print "NicWatcher.start" - self._pid = self.run_vnstat( - device=self._params["iface"], - namespace=self._params["namespace"]) - print self._pid - - def stop(self): - print "NicWatcher.stop" - if self._pid: - data = self.kill_vnstat(pid=self._pid) - self._data = RawDataProcess.process(data) - print "---------------------------------" - print self._data - print "---------------------------------" - - def result(self, **kwargs): - return self._data - - -class CpuWatcher(Fabricant): - - def __init__(self, dst, conn): - super(CpuWatcher, self).__init__(dst, conn) - self._pid = None - self._data = { - "cpu_num": 0, - "idle": 0, - "cpu_mhz": 0 - } - - def start(self): - print "CpuWatcher.start" - self._pid = self.run_cpuwatch() - print self._pid - - def stop(self): - print "CpuWatcher.stop" - if self._pid: - print self._pid - data = self.kill_cpuwatch(pid=self._pid) - self._data = RawDataProcess.process(data) - print "---------------------------------" - print self._data - print "---------------------------------" - - def result(self, **kwargs): - return self._data - - -def unit_test(): - pass - - -if __name__ == '__main__': - unit_test() |