diff options
author | chenjiankun <chenjiankun1@huawei.com> | 2017-01-16 09:17:48 +0000 |
---|---|---|
committer | chenjiankun <chenjiankun1@huawei.com> | 2017-01-16 09:18:44 +0000 |
commit | fa3afbcac13e1aa3ae9cc2977dcb4cd882112f6f (patch) | |
tree | b9884b84f976f5d75d22b447d38f3c49e4a947fd /yardstick/benchmark/scenarios | |
parent | f036e9898a69f5041f9cde02e3652c29e2de1643 (diff) |
Use """ to replace ''' in docstring
JIRA: YARDSTICK-525
For consistency, we always use """triple double quotes""" around
docstrings.
Change-Id: I47a20bbd8b55bc544b4841ea4006929af0a044ac
Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
Diffstat (limited to 'yardstick/benchmark/scenarios')
26 files changed, 48 insertions, 48 deletions
diff --git a/yardstick/benchmark/scenarios/availability/attacker/attacker_baremetal.py b/yardstick/benchmark/scenarios/availability/attacker/attacker_baremetal.py index 7eb93a80f..1d632799d 100644 --- a/yardstick/benchmark/scenarios/availability/attacker/attacker_baremetal.py +++ b/yardstick/benchmark/scenarios/availability/attacker/attacker_baremetal.py @@ -19,7 +19,7 @@ LOG = logging.getLogger(__name__) def _execute_shell_command(command, stdin=None): - '''execute shell script with error handling''' + """execute shell script with error handling""" exitcode = 0 output = [] try: diff --git a/yardstick/benchmark/scenarios/availability/attacker/baseattacker.py b/yardstick/benchmark/scenarios/availability/attacker/baseattacker.py index f5f74f291..ca2324055 100644 --- a/yardstick/benchmark/scenarios/availability/attacker/baseattacker.py +++ b/yardstick/benchmark/scenarios/availability/attacker/baseattacker.py @@ -61,7 +61,7 @@ class BaseAttacker(object): @staticmethod def get_attacker_cls(attacker_cfg): - '''return attacker instance of specified type''' + """return attacker instance of specified type""" attacker_type = attacker_cfg['fault_type'] for attacker_cls in utils.itersubclasses(BaseAttacker): if attacker_type == attacker_cls.__attacker_type__: diff --git a/yardstick/benchmark/scenarios/availability/monitor/basemonitor.py b/yardstick/benchmark/scenarios/availability/monitor/basemonitor.py index a11966a12..3062037ee 100644 --- a/yardstick/benchmark/scenarios/availability/monitor/basemonitor.py +++ b/yardstick/benchmark/scenarios/availability/monitor/basemonitor.py @@ -77,7 +77,7 @@ class BaseMonitor(multiprocessing.Process): @staticmethod def get_monitor_cls(monitor_type): - '''return monitor class of specified type''' + """return monitor class of specified type""" for monitor in utils.itersubclasses(BaseMonitor): if monitor_type == monitor.__monitor_type__: diff --git a/yardstick/benchmark/scenarios/availability/monitor/monitor_command.py b/yardstick/benchmark/scenarios/availability/monitor/monitor_command.py index 6ddb73ea2..aae2daa86 100644 --- a/yardstick/benchmark/scenarios/availability/monitor/monitor_command.py +++ b/yardstick/benchmark/scenarios/availability/monitor/monitor_command.py @@ -18,7 +18,7 @@ LOG = logging.getLogger(__name__) def _execute_shell_command(command): - '''execute shell script with error handling''' + """execute shell script with error handling""" exitcode = 0 output = [] try: diff --git a/yardstick/benchmark/scenarios/availability/operation/baseoperation.py b/yardstick/benchmark/scenarios/availability/operation/baseoperation.py index 709884b6f..be286b8fd 100644 --- a/yardstick/benchmark/scenarios/availability/operation/baseoperation.py +++ b/yardstick/benchmark/scenarios/availability/operation/baseoperation.py @@ -61,7 +61,7 @@ class BaseOperation(object): @staticmethod def get_operation_cls(type): - '''return operation instance of specified type''' + """return operation instance of specified type""" operation_type = type for operation_cls in utils.itersubclasses(BaseOperation): if operation_type == operation_cls.__operation__type__: diff --git a/yardstick/benchmark/scenarios/availability/result_checker/baseresultchecker.py b/yardstick/benchmark/scenarios/availability/result_checker/baseresultchecker.py index 70e004012..1ccd05844 100644 --- a/yardstick/benchmark/scenarios/availability/result_checker/baseresultchecker.py +++ b/yardstick/benchmark/scenarios/availability/result_checker/baseresultchecker.py @@ -69,7 +69,7 @@ class BaseResultChecker(object): @staticmethod def get_resultchecker_cls(type): - '''return resultchecker instance of specified type''' + """return resultchecker instance of specified type""" resultchecker_type = type for checker_cls in utils.itersubclasses(BaseResultChecker): if resultchecker_type == checker_cls.__result_checker__type__: diff --git a/yardstick/benchmark/scenarios/availability/serviceha.py b/yardstick/benchmark/scenarios/availability/serviceha.py index b981c8cd8..e82e69b7d 100755 --- a/yardstick/benchmark/scenarios/availability/serviceha.py +++ b/yardstick/benchmark/scenarios/availability/serviceha.py @@ -30,7 +30,7 @@ class ServiceHA(base.Scenario): self.setup_done = False def setup(self): - '''scenario setup''' + """scenario setup""" nodes = self.context_cfg.get("nodes", None) if nodes is None: LOG.error("the nodes info is none") @@ -77,13 +77,13 @@ class ServiceHA(base.Scenario): return def teardown(self): - '''scenario teardown''' + """scenario teardown""" for attacker in self.attackers: attacker.recover() def _test(): # pragma: no cover - '''internal test function''' + """internal test function""" host = { "ip": "10.20.0.5", "user": "root", diff --git a/yardstick/benchmark/scenarios/base.py b/yardstick/benchmark/scenarios/base.py index 5f5c07d3b..5d3c36c38 100644 --- a/yardstick/benchmark/scenarios/base.py +++ b/yardstick/benchmark/scenarios/base.py @@ -26,20 +26,20 @@ import yardstick.common.utils as utils class Scenario(object): def setup(self): - ''' default impl for scenario setup ''' + """ default impl for scenario setup """ pass def run(self, args): - ''' catcher for not implemented run methods in subclasses ''' + """ catcher for not implemented run methods in subclasses """ raise RuntimeError("run method not implemented") def teardown(self): - ''' default impl for scenario teardown ''' + """ default impl for scenario teardown """ pass @staticmethod def get_types(): - '''return a list of known runner type (class) names''' + """return a list of known runner type (class) names""" scenarios = [] for scenario in utils.itersubclasses(Scenario): scenarios.append(scenario) @@ -47,7 +47,7 @@ class Scenario(object): @staticmethod def get_cls(scenario_type): - '''return class of specified type''' + """return class of specified type""" for scenario in utils.itersubclasses(Scenario): if scenario_type == scenario.__scenario_type__: return scenario diff --git a/yardstick/benchmark/scenarios/compute/cachestat.py b/yardstick/benchmark/scenarios/compute/cachestat.py index 0f60d466e..b4c3463e5 100644 --- a/yardstick/benchmark/scenarios/compute/cachestat.py +++ b/yardstick/benchmark/scenarios/compute/cachestat.py @@ -22,7 +22,7 @@ LOG = logging.getLogger(__name__) class CACHEstat(base.Scenario): - '''Collect cache statistics. + """Collect cache statistics. This scenario reads system cache hit/miss ratio and other statistics on a Linux host. @@ -58,7 +58,7 @@ class CACHEstat(base.Scenario): some error margin depending on unusual workload types. REQUIREMENTS: CONFIG_FUNCTION_PROFILER, awk. - ''' + """ __scenario_type__ = "CACHEstat" TARGET_SCRIPT = "cache_stat.bash" diff --git a/yardstick/benchmark/scenarios/compute/cyclictest.py b/yardstick/benchmark/scenarios/compute/cyclictest.py index 76bafff2b..ae1d37324 100644 --- a/yardstick/benchmark/scenarios/compute/cyclictest.py +++ b/yardstick/benchmark/scenarios/compute/cyclictest.py @@ -141,7 +141,7 @@ class Cyclictest(base.Scenario): self._connect_guest() def setup(self): - '''scenario setup''' + """scenario setup""" setup_options = self.scenario_cfg["setup_options"] host_setup_seqs = setup_options["host_setup_seqs"] guest_setup_seqs = setup_options["guest_setup_seqs"] @@ -205,7 +205,7 @@ class Cyclictest(base.Scenario): def _test(): # pragma: no cover - '''internal test function''' + """internal test function""" key_filename = pkg_resources.resource_filename("yardstick.resources", "files/yardstick_key") ctx = { diff --git a/yardstick/benchmark/scenarios/dummy/dummy.py b/yardstick/benchmark/scenarios/dummy/dummy.py index 95146e0c5..59d177586 100644 --- a/yardstick/benchmark/scenarios/dummy/dummy.py +++ b/yardstick/benchmark/scenarios/dummy/dummy.py @@ -25,7 +25,7 @@ class Dummy(base.Scenario): self.setup_done = False def setup(self): - '''scenario setup''' + """scenario setup""" self.setup_done = True def run(self, result): diff --git a/yardstick/benchmark/scenarios/networking/iperf3.py b/yardstick/benchmark/scenarios/networking/iperf3.py index b8ec9acdf..4d4c7e7ee 100644 --- a/yardstick/benchmark/scenarios/networking/iperf3.py +++ b/yardstick/benchmark/scenarios/networking/iperf3.py @@ -167,7 +167,7 @@ For more info see http://software.es.net/iperf def _test(): - '''internal test function''' + """internal test function""" key_filename = pkg_resources.resource_filename('yardstick.resources', 'files/yardstick_key') ctx = { diff --git a/yardstick/benchmark/scenarios/networking/netperf.py b/yardstick/benchmark/scenarios/networking/netperf.py index 80dbed334..d0528826f 100755 --- a/yardstick/benchmark/scenarios/networking/netperf.py +++ b/yardstick/benchmark/scenarios/networking/netperf.py @@ -60,7 +60,7 @@ class Netperf(base.Scenario): self.setup_done = False def setup(self): - '''scenario setup''' + """scenario setup""" self.target_script = pkg_resources.resource_filename( 'yardstick.benchmark.scenarios.networking', Netperf.TARGET_SCRIPT) @@ -150,7 +150,7 @@ class Netperf(base.Scenario): def _test(): - '''internal test function''' + """internal test function""" key_filename = pkg_resources.resource_filename("yardstick.resources", "files/yardstick_key") ctx = { diff --git a/yardstick/benchmark/scenarios/networking/netperf_node.py b/yardstick/benchmark/scenarios/networking/netperf_node.py index 0cf52b8dd..fd9fa0a50 100755 --- a/yardstick/benchmark/scenarios/networking/netperf_node.py +++ b/yardstick/benchmark/scenarios/networking/netperf_node.py @@ -61,7 +61,7 @@ class NetperfNode(base.Scenario): self.setup_done = False def setup(self): - '''scenario setup''' + """scenario setup""" self.target_script = pkg_resources.resource_filename( 'yardstick.benchmark.scenarios.networking', NetperfNode.TARGET_SCRIPT) @@ -172,13 +172,13 @@ class NetperfNode(base.Scenario): (mean_latency, sla_max_mean_latency) def teardown(self): - '''remove netperf from nodes after test''' + """remove netperf from nodes after test""" self.server.execute("sudo bash netperf_remove.sh") self.client.execute("sudo bash netperf_remove.sh") def _test(): # pragma: no cover - '''internal test function''' + """internal test function""" ctx = { "host": { "ip": "192.168.10.10", diff --git a/yardstick/benchmark/scenarios/networking/ping.py b/yardstick/benchmark/scenarios/networking/ping.py index eb173f1df..d20814697 100644 --- a/yardstick/benchmark/scenarios/networking/ping.py +++ b/yardstick/benchmark/scenarios/networking/ping.py @@ -102,7 +102,7 @@ class Ping(base.Scenario): def _test(): # pragma: no cover - '''internal test function''' + """internal test function""" key_filename = pkg_resources.resource_filename("yardstick.resources", "files/yardstick_key") ctx = { diff --git a/yardstick/benchmark/scenarios/networking/ping6.py b/yardstick/benchmark/scenarios/networking/ping6.py index dd4272236..142a35664 100644 --- a/yardstick/benchmark/scenarios/networking/ping6.py +++ b/yardstick/benchmark/scenarios/networking/ping6.py @@ -84,7 +84,7 @@ class Ping6(base.Scenario): # pragma: no cover return None def setup(self): - '''scenario setup''' + """scenario setup""" self.setup_script = pkg_resources.resource_filename( 'yardstick.benchmark.scenarios.networking', Ping6.SETUP_SCRIPT) diff --git a/yardstick/benchmark/scenarios/networking/pktgen.py b/yardstick/benchmark/scenarios/networking/pktgen.py index 69663ec5f..b61337a70 100644 --- a/yardstick/benchmark/scenarios/networking/pktgen.py +++ b/yardstick/benchmark/scenarios/networking/pktgen.py @@ -47,7 +47,7 @@ class Pktgen(base.Scenario): self.setup_done = False def setup(self): - '''scenario setup''' + """scenario setup""" self.target_script = pkg_resources.resource_filename( 'yardstick.benchmark.scenarios.networking', Pktgen.TARGET_SCRIPT) @@ -148,7 +148,7 @@ class Pktgen(base.Scenario): def _test(): - '''internal test function''' + """internal test function""" key_filename = pkg_resources.resource_filename('yardstick.resources', 'files/yardstick_key') ctx = { diff --git a/yardstick/benchmark/scenarios/networking/pktgen_dpdk.py b/yardstick/benchmark/scenarios/networking/pktgen_dpdk.py index 2bdb91abb..0b70629f8 100644 --- a/yardstick/benchmark/scenarios/networking/pktgen_dpdk.py +++ b/yardstick/benchmark/scenarios/networking/pktgen_dpdk.py @@ -37,7 +37,7 @@ class PktgenDPDKLatency(base.Scenario): self.setup_done = False def setup(self): - '''scenario setup''' + """scenario setup""" self.pktgen_dpdk_script = pkg_resources.resource_filename( 'yardstick.benchmark.scenarios.networking', PktgenDPDKLatency.PKTGEN_DPDK_SCRIPT) diff --git a/yardstick/benchmark/scenarios/networking/sfc.py b/yardstick/benchmark/scenarios/networking/sfc.py index 87fea4f95..c558e3512 100644 --- a/yardstick/benchmark/scenarios/networking/sfc.py +++ b/yardstick/benchmark/scenarios/networking/sfc.py @@ -14,7 +14,7 @@ LOG = logging.getLogger(__name__) class Sfc(base.Scenario): # pragma: no cover - ''' SFC scenario class ''' + """ SFC scenario class """ __scenario_type__ = "sfc" @@ -31,7 +31,7 @@ class Sfc(base.Scenario): # pragma: no cover self.teardown_done = False def setup(self): - '''scenario setup''' + """scenario setup""" self.tacker_script = pkg_resources.resource_filename( 'yardstick.benchmark.scenarios.networking', Sfc.TACKER_SCRIPT) @@ -40,7 +40,7 @@ class Sfc(base.Scenario): # pragma: no cover 'yardstick.benchmark.scenarios.networking', Sfc.SERVER_SCRIPT) - ''' calling Tacker to instantiate VNFs and Service Chains ''' + """ calling Tacker to instantiate VNFs and Service Chains """ cmd_tacker = "%s" % (self.tacker_script) subprocess.call(cmd_tacker, shell=True) @@ -50,7 +50,7 @@ class Sfc(base.Scenario): # pragma: no cover target_pwd = target.get('password', 'opnfv') target_ip = target.get('ip', None) - ''' webserver start automatically during the vm boot ''' + """ webserver start automatically during the vm boot """ LOG.info("user:%s, target:%s", target_user, target_ip) self.server = ssh.SSH(target_user, target_ip, password=target_pwd, port=target_ssh_port) @@ -102,7 +102,7 @@ class Sfc(base.Scenario): # pragma: no cover self.setup_done = True def run(self, result): - ''' Creating client and server VMs to perform the test''' + """ Creating client and server VMs to perform the test""" host = self.context_cfg['host'] host_user = host.get('user', 'root') ssh_port = host.get("ssh_port", ssh.DEFAULT_PORT) @@ -149,7 +149,7 @@ class Sfc(base.Scenario): # pragma: no cover 'yardstick.benchmark.scenarios.networking', Sfc.TACKER_CHANGECLASSI) - ''' calling Tacker to change the classifier ''' + """ calling Tacker to change the classifier """ cmd_tacker = "%s" % (self.tacker_classi) subprocess.call(cmd_tacker, shell=True) @@ -185,7 +185,7 @@ class Sfc(base.Scenario): # pragma: no cover " :) \n" + '\033[0m') def teardown(self): - ''' for scenario teardown remove tacker VNFs, chains and classifiers''' + """ for scenario teardown remove tacker VNFs, chains and classifiers""" self.teardown_script = pkg_resources.resource_filename( "yardstick.benchmark.scenarios.networking", Sfc.TEARDOWN_SCRIPT) @@ -193,7 +193,7 @@ class Sfc(base.Scenario): # pragma: no cover self.teardown_done = True -'''def _test(): # pragma: no cover +"""def _test(): # pragma: no cover internal test function logger = logging.getLogger("Sfc Yardstick") @@ -208,4 +208,4 @@ class Sfc(base.Scenario): # pragma: no cover sfc.teardown() if __name__ == '__main__': # pragma: no cover - _test()''' + _test()""" diff --git a/yardstick/benchmark/scenarios/networking/vsperf.py b/yardstick/benchmark/scenarios/networking/vsperf.py index 9d6db7c1d..f2c2ea9b8 100644 --- a/yardstick/benchmark/scenarios/networking/vsperf.py +++ b/yardstick/benchmark/scenarios/networking/vsperf.py @@ -112,7 +112,7 @@ class Vsperf(base.Scenario): None) def setup(self): - '''scenario setup''' + """scenario setup""" vsperf = self.context_cfg['host'] vsperf_user = vsperf.get('user', 'ubuntu') vsperf_ssh_port = vsperf.get('ssh_port', ssh.DEFAULT_PORT) diff --git a/yardstick/benchmark/scenarios/networking/vtc_instantiation_validation.py b/yardstick/benchmark/scenarios/networking/vtc_instantiation_validation.py index bf42d9a9a..ac57c929c 100644 --- a/yardstick/benchmark/scenarios/networking/vtc_instantiation_validation.py +++ b/yardstick/benchmark/scenarios/networking/vtc_instantiation_validation.py @@ -29,7 +29,7 @@ class VtcInstantiationValidation(base.Scenario): self.setup_done = False def setup(self): - '''scenario setup''' + """scenario setup""" self.options = self.scenario_cfg['options'] self.setup_done = True diff --git a/yardstick/benchmark/scenarios/networking/vtc_instantiation_validation_noisy.py b/yardstick/benchmark/scenarios/networking/vtc_instantiation_validation_noisy.py index fb6e762d1..d3a9a9a02 100644 --- a/yardstick/benchmark/scenarios/networking/vtc_instantiation_validation_noisy.py +++ b/yardstick/benchmark/scenarios/networking/vtc_instantiation_validation_noisy.py @@ -29,7 +29,7 @@ class VtcInstantiationValidationNoisy(base.Scenario): self.setup_done = False def setup(self): - '''scenario setup''' + """scenario setup""" self.options = self.scenario_cfg['options'] self.setup_done = True diff --git a/yardstick/benchmark/scenarios/networking/vtc_throughput.py b/yardstick/benchmark/scenarios/networking/vtc_throughput.py index 0754d3782..b9cb0b1e7 100644 --- a/yardstick/benchmark/scenarios/networking/vtc_throughput.py +++ b/yardstick/benchmark/scenarios/networking/vtc_throughput.py @@ -29,7 +29,7 @@ class VtcThroughput(base.Scenario): self.setup_done = False def setup(self): - '''scenario setup''' + """scenario setup""" self.options = self.scenario_cfg['options'] self.setup_done = True diff --git a/yardstick/benchmark/scenarios/networking/vtc_throughput_noisy.py b/yardstick/benchmark/scenarios/networking/vtc_throughput_noisy.py index 552ef8090..38ebc4c42 100644 --- a/yardstick/benchmark/scenarios/networking/vtc_throughput_noisy.py +++ b/yardstick/benchmark/scenarios/networking/vtc_throughput_noisy.py @@ -29,7 +29,7 @@ class VtcThroughputNoisy(base.Scenario): self.setup_done = False def setup(self): - '''scenario setup''' + """scenario setup""" self.options = self.scenario_cfg['options'] self.setup_done = True diff --git a/yardstick/benchmark/scenarios/parser/parser.py b/yardstick/benchmark/scenarios/parser/parser.py index 6d39733c6..eb16833e5 100644 --- a/yardstick/benchmark/scenarios/parser/parser.py +++ b/yardstick/benchmark/scenarios/parser/parser.py @@ -68,7 +68,7 @@ class Parser(base.Scenario): result['yangtotosca'] = "success" if p.returncode == 0 else "fail" def teardown(self): - ''' for scenario teardown remove parser and pyang ''' + """ for scenario teardown remove parser and pyang """ self.teardown_script = pkg_resources.resource_filename( "yardstick.benchmark.scenarios.parser", Parser.TEARDOWN_SCRIPT) @@ -77,7 +77,7 @@ class Parser(base.Scenario): def _test(): - '''internal test function''' + """internal test function""" pass diff --git a/yardstick/benchmark/scenarios/storage/fio.py b/yardstick/benchmark/scenarios/storage/fio.py index 2a8738e88..e28bd7bcc 100644 --- a/yardstick/benchmark/scenarios/storage/fio.py +++ b/yardstick/benchmark/scenarios/storage/fio.py @@ -58,7 +58,7 @@ class Fio(base.Scenario): self.setup_done = False def setup(self): - '''scenario setup''' + """scenario setup""" self.target_script = pkg_resources.resource_filename( "yardstick.benchmark.scenarios.storage", Fio.TARGET_SCRIPT) @@ -152,7 +152,7 @@ class Fio(base.Scenario): def _test(): - '''internal test function''' + """internal test function""" key_filename = pkg_resources.resource_filename("yardstick.resources", "files/yardstick_key") ctx = { |