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/perf_provider.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/perf_provider.py')
-rw-r--r-- | testsuites/vstf/vstf_scripts/vstf/controller/sw_perf/perf_provider.py | 225 |
1 files changed, 0 insertions, 225 deletions
diff --git a/testsuites/vstf/vstf_scripts/vstf/controller/sw_perf/perf_provider.py b/testsuites/vstf/vstf_scripts/vstf/controller/sw_perf/perf_provider.py deleted file mode 100644 index 3fdbad60..00000000 --- a/testsuites/vstf/vstf_scripts/vstf/controller/sw_perf/perf_provider.py +++ /dev/null @@ -1,225 +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 - -LOG = logging.getLogger(__name__) - - -def get_agent_dict(nodes): - """ - :param: - nodes: list of flow info - and ever element must be a dict and kas key "agent" - :return : list for agent - :rtype : dict - """ - agent_list = map(lambda x: x["agent"], nodes) - return {}.fromkeys(agent_list, False) - - -class PerfProvider(object): - - def __init__(self, flows_info, tool_info, tester_info): - self._flows_info = flows_info - self._tool_info = tool_info - self._tester_info = tester_info - - def _islation(self): - flows = self._flows_info["flows"] - if flows == 2 and self._flows_info["senders"][0][ - "agent"] == self._flows_info["senders"][1]["agent"]: - return True - return False - - def get_senders(self, tool, protocol): - result = [] - flows = self._flows_info["flows"] - if self._islation() and "pktgen" == tool: - sender = { - "agent": self._flows_info["senders"][0]["agent"], - "params": { - "protocol": protocol, - "namespace": None, - "src": [], - "dst": [], - "time": self._tool_info[tool]["time"], - "threads": self._tool_info[tool]["threads"] - } - } - for i in range(flows): - sender['params']['src'].append( - self._flows_info["senders"][i]['dev']) - sender['params']['dst'].append( - self._flows_info["receivers"][i]['dev']) - result.append(sender) - else: - for i in range(flows): - sender = { - "agent": self._flows_info["senders"][i]["agent"], - "params": { - "protocol": protocol, - "namespace": None if "netmap" == tool else self._flows_info["senders"][i]['dev']['namespace'], - "src": [ - self._flows_info["senders"][i]['dev']], - "dst": [ - self._flows_info["receivers"][i]['dev']], - "time": self._tool_info[tool]["time"], - "threads": self._tool_info[tool]["threads"]}} - result.append(sender) - return result - - def get_receivers(self, tool, protocol): - result = [] - flows = self._flows_info["flows"] - if self._islation() and "pktgen" == tool: - receiver = { - "agent": self._flows_info["receivers"][0]["agent"], - "params": { - "namespace": None, - "protocol": protocol, - } - } - result.append(receiver) - else: - for i in range(flows): - receiver = { - "agent": self._flows_info["receivers"][i]["agent"], - "params": { - "namespace": None if "netmap" == tool else self._flows_info["receivers"][i]['dev']['namespace'], - "protocol": protocol, - "dst": [ - self._flows_info["receivers"][i]['dev']]}} - result.append(receiver) - return result - - def get_watchers(self, tool): - result = [] - for watcher in self._flows_info["watchers"]: - node = { - "agent": watcher["agent"], - "params": { - "iface": watcher['dev']["iface"], - "namespace": None if tool in [ - "pktgen", - "netmap"] else watcher['dev']["namespace"], - }} - result.append(node) - return result - - def get_namespaces(self, tool): - result = [] - - for watcher in self._flows_info["namespaces"]: - node = { - "agent": watcher["agent"], - "params": { - "iface": watcher['dev']["iface"], - "namespace": watcher['dev']["namespace"] if tool not in [ - "pktgen", - "netmap"] else None, - "ip": watcher['dev']["ip"] + - '/24', - }} - result.append(node) - return result - - @property - def get_cpuwatcher(self): - LOG.info(self._flows_info["cpu_listens"]) - result = { - "agent": self._flows_info["cpu_listens"][0]["agent"], - "params": { - } - } - return result - - @property - def get_cpu_affctl(self): - LOG.info(self._flows_info["cpu_listens"]) - result = { - "agent": self._flows_info["cpu_listens"][0]["agent"], - "params": { - "policy": self._flows_info["cpu_listens"][0]["affctl"]["policy"] - } - } - return result - - def get_cleaners(self, tool, protocol): - nodes = self.get_senders(tool, protocol) + \ - self.get_receivers(tool, protocol) + \ - self.get_watchers(tool) + \ - [self.get_cpuwatcher] - return get_agent_dict(nodes).keys() - - @property - def get_testers(self): - agents = get_agent_dict(self._flows_info["namespaces"]).keys() - result = [] - for agent in agents: - node = { - "agent": agent, - "params": { - "drivers": self._tester_info["drivers"] - } - } - result.append(node) - return result - - def duration(self, tool): - return self._tool_info[tool]["time"] - - def wait_balance(self, tool): - return self._tool_info[tool]["wait"] - - -def unit_test(): - from vstf.common.log import setup_logging - setup_logging( - level=logging.DEBUG, - log_file="/var/log/vstf/vstf-perf-provider.log", - clevel=logging.INFO) - - from vstf.controller.settings.flows_settings import FlowsSettings - from vstf.controller.settings.tool_settings import ToolSettings - from vstf.controller.settings.tester_settings import TesterSettings - - flows_settings = FlowsSettings() - tool_settings = ToolSettings() - tester_settings = TesterSettings() - - provider = PerfProvider( - flows_settings.settings, - tool_settings.settings, - tester_settings.settings) - - tools = ['pktgen'] - protocols = ['udp_bw', 'udp_lat'] - - for tool in tools: - LOG.info(tool) - for protocol in protocols: - LOG.info(protocol) - senders = provider.get_senders(tool, protocols) - LOG.info(len(senders)) - LOG.info(senders) - - receivers = provider.get_receivers(tool, protocols) - LOG.info(len(receivers)) - LOG.info(receivers) - - LOG.info(provider.get_cpuwatcher) - LOG.info(provider.get_watchers(tool)) - LOG.info(provider.get_namespaces(tool)) - LOG.info(provider.duration(tool)) - - -if __name__ == '__main__': - unit_test() |