aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries
diff options
context:
space:
mode:
authorPeter Mikus <pmikus@cisco.com>2018-09-01 15:29:37 +0000
committerPeter Mikus <pmikus@cisco.com>2018-09-04 07:29:54 +0000
commitbe430a282810185c939c1fbbf3042036b814f38a (patch)
tree1d5a18291e74ee892703e7bc81ed96209e8716ae /resources/libraries
parent7db6faf25da39820d321222f7f8fcb191585add9 (diff)
Fix pylint part 1
- Decrease pylint errors. Part: easy Change-Id: I452e5b5a11e9b78c03cd173a3848babe21b93c73 Signed-off-by: Peter Mikus <pmikus@cisco.com>
Diffstat (limited to 'resources/libraries')
-rw-r--r--resources/libraries/python/DMM/SingleCliSer.py1
-rw-r--r--resources/libraries/python/DPDK/L3fwdTest.py5
-rw-r--r--resources/libraries/python/InterfaceUtil.py10
-rw-r--r--resources/libraries/python/TrafficGenerator.py4
-rw-r--r--resources/libraries/python/autogen/Regenerator.py34
-rw-r--r--resources/libraries/python/autogen/Testcase.py6
-rw-r--r--resources/libraries/python/honeycomb/DHCP.py3
-rw-r--r--resources/libraries/python/honeycomb/FIB.py2
-rw-r--r--resources/libraries/python/honeycomb/Routing.py11
9 files changed, 57 insertions, 19 deletions
diff --git a/resources/libraries/python/DMM/SingleCliSer.py b/resources/libraries/python/DMM/SingleCliSer.py
index 504f59c415..9bf18bb9eb 100644
--- a/resources/libraries/python/DMM/SingleCliSer.py
+++ b/resources/libraries/python/DMM/SingleCliSer.py
@@ -111,3 +111,4 @@ class SingleCliSer(object):
else:
logger.console('....log_install_dmm on node {1}.... {0}'
.format(stdout, dut_node['host']))
+
diff --git a/resources/libraries/python/DPDK/L3fwdTest.py b/resources/libraries/python/DPDK/L3fwdTest.py
index 8cf63a8e06..84c623e716 100644
--- a/resources/libraries/python/DPDK/L3fwdTest.py
+++ b/resources/libraries/python/DPDK/L3fwdTest.py
@@ -140,7 +140,8 @@ class L3fwdTest(object):
'{fwdir}/tests/dpdk/dpdk_scripts/patch_l3fwd.sh {arch} '
'{fwdir}/tests/dpdk/dpdk_scripts/{patch}'.
format(fwdir=Constants.REMOTE_FW_DIR, arch=arch, patch=patch),
- timeout=600)
+ timeout=600)
if ret_code != 0:
- raise RuntimeError('Patch of l3fwd failed.') \ No newline at end of file
+ raise RuntimeError('Patch of l3fwd failed.')
+
diff --git a/resources/libraries/python/InterfaceUtil.py b/resources/libraries/python/InterfaceUtil.py
index 7286633676..94cee5ecbc 100644
--- a/resources/libraries/python/InterfaceUtil.py
+++ b/resources/libraries/python/InterfaceUtil.py
@@ -933,11 +933,11 @@ class InterfaceUtil(object):
the node.
"""
hw_addr = '' if mac is None else 'hw-addr {mac}'.format(mac=mac)
- lb = '' if load_balance is None \
- else 'lb {lb}'.format(lb=load_balance)
+ ldb = '' if load_balance is None \
+ else 'lb {ldb}'.format(ldb=load_balance)
output = VatExecutor.cmd_from_template(
- node, 'create_bond_interface.vat', mode=mode, lb=lb, mac=hw_addr)
+ node, 'create_bond_interface.vat', mode=mode, lb=ldb, mac=hw_addr)
if output[0].get('retval') == 0:
sw_if_idx = output[0].get('sw_if_index')
@@ -945,8 +945,8 @@ class InterfaceUtil(object):
if_key = Topology.get_interface_by_sw_index(node, sw_if_idx)
return if_key
else:
- raise RuntimeError('Create bond interface failed on node "{n}"'
- .format(n=node['host']))
+ raise RuntimeError('Create bond interface failed on "{host}"'
+ .format(host=node['host']))
@staticmethod
def add_bond_eth_interface(node, ifc_name=None, sw_if_idx=None):
diff --git a/resources/libraries/python/TrafficGenerator.py b/resources/libraries/python/TrafficGenerator.py
index 1398072ce1..36a83851cb 100644
--- a/resources/libraries/python/TrafficGenerator.py
+++ b/resources/libraries/python/TrafficGenerator.py
@@ -107,9 +107,9 @@ class TrafficGenerator(AbstractMeasurer):
FIXME: Describe API."""
# TODO: Decrease friction between various search and rate provider APIs.
- # FIXME: Remove "trex" from lines which could work with other TGs.
+ # TODO: Remove "trex" from lines which could work with other TGs.
- # use one instance of TrafficGenerator for all tests in test suite
+ # Use one instance of TrafficGenerator for all tests in test suite
ROBOT_LIBRARY_SCOPE = 'TEST SUITE'
def __init__(self):
diff --git a/resources/libraries/python/autogen/Regenerator.py b/resources/libraries/python/autogen/Regenerator.py
index e7e0370325..7a576764a2 100644
--- a/resources/libraries/python/autogen/Regenerator.py
+++ b/resources/libraries/python/autogen/Regenerator.py
@@ -16,7 +16,6 @@
from glob import glob
from os import getcwd
-from .Testcase import Testcase
from .DefaultTestcase import DefaultTestcase
@@ -63,6 +62,13 @@ class Regenerator(object):
}
def get_iface_and_suite_id(filename):
+ """Get interface and suite ID.
+
+ :param filename: Suite file.
+ :type filename: str
+ :returns: Interface ID, Suite ID.
+ :rtype: tuple
+ """
dash_split = filename.split("-", 1)
if len(dash_split[0]) <= 4:
# It was something like "2n1l", we need one more split.
@@ -70,12 +76,38 @@ class Regenerator(object):
return dash_split[0], dash_split[1].split(".", 1)[0]
def add_testcase(testcase, iface, file_out, num, **kwargs):
+ """Add testcase to file.
+
+ :param testcase: Testcase class.
+ :param iface: Interface.
+ :param file_out: File to write testcases to.
+ :param num: Testcase number.
+ :param kwargs: Key-value pairs used to construct testcase.
+ :type testcase: Testcase
+ :type iface: str
+ :type file_out: file
+ :type num: int
+ :type kwargs: dict
+ :returns: Next testcase number.
+ :rtype: int
+ """
# TODO: Is there a better way to disable some combinations?
if kwargs["framesize"] != 9000 or "vic1227" not in iface:
file_out.write(testcase.generate(num=num, **kwargs))
return num + 1
def add_testcases(testcase, iface, file_out, tc_kwargs_list):
+ """Add testcases to file.
+
+ :param testcase: Testcase class.
+ :param iface: Interface.
+ :param file_out: File to write testcases to.
+ :param tc_kwargs_list: Key-value pairs used to construct testcase.
+ :type testcase: Testcase
+ :type iface: str
+ :type file_out: file
+ :type tc_kwargs_list: dict
+ """
num = 1
for tc_kwargs in tc_kwargs_list:
num = add_testcase(testcase, iface, file_out, num, **tc_kwargs)
diff --git a/resources/libraries/python/autogen/Testcase.py b/resources/libraries/python/autogen/Testcase.py
index 4f92e6c2e1..dd58547f33 100644
--- a/resources/libraries/python/autogen/Testcase.py
+++ b/resources/libraries/python/autogen/Testcase.py
@@ -49,10 +49,10 @@ class Testcase(object):
:rtype: str
"""
try:
- fs = int(framesize)
+ fsize = int(framesize)
subst_dict = {
- "frame_num": "${%d}" % fs,
- "frame_str": "%dB" % fs
+ "frame_num": "${%d}" % fsize,
+ "frame_str": "%dB" % fsize
}
except ValueError: # Assuming an IMIX string.
subst_dict = {
diff --git a/resources/libraries/python/honeycomb/DHCP.py b/resources/libraries/python/honeycomb/DHCP.py
index f93a8fd56f..56cfdb2a78 100644
--- a/resources/libraries/python/honeycomb/DHCP.py
+++ b/resources/libraries/python/honeycomb/DHCP.py
@@ -73,7 +73,8 @@ class DHCPRelayKeywords(object):
:rtype: bytearray
"""
- path = "/relay/vpp-fib-table-management:{0}/{1}".format(ip_version, entry_id)
+ path = "/relay/vpp-fib-table-management:{0}/{1}".format(ip_version,
+ entry_id)
return DHCPRelayKeywords._set_dhcp_relay_properties(node, path, data)
diff --git a/resources/libraries/python/honeycomb/FIB.py b/resources/libraries/python/honeycomb/FIB.py
index a5e8ba9bae..bfccf5a029 100644
--- a/resources/libraries/python/honeycomb/FIB.py
+++ b/resources/libraries/python/honeycomb/FIB.py
@@ -85,7 +85,7 @@ class FibKeywords(object):
{
"table-id": vrf,
"address-family": "vpp-fib-table-management:{0}"
- .format(ip_version),
+ .format(ip_version),
"name": "{0}-VRF:{1}".format(ip_version, vrf)
}
]
diff --git a/resources/libraries/python/honeycomb/Routing.py b/resources/libraries/python/honeycomb/Routing.py
index 8d8f7f4401..314c3fe64d 100644
--- a/resources/libraries/python/honeycomb/Routing.py
+++ b/resources/libraries/python/honeycomb/Routing.py
@@ -115,7 +115,8 @@ class RoutingKeywords(object):
]
}
- path = "/control-plane-protocol/hc2vpp-ietf-routing:static/{0}".format(name)
+ path = "/control-plane-protocol/hc2vpp-ietf-routing:static/{0}".format(
+ name)
return RoutingKeywords._set_routing_table_properties(
node, path, full_data)
@@ -131,7 +132,8 @@ class RoutingKeywords(object):
:rtype: bytearray
"""
- path = "/control-plane-protocol/hc2vpp-ietf-routing:static/{0}".format(name)
+ path = "/control-plane-protocol/hc2vpp-ietf-routing:static/{0}".format(
+ name)
return RoutingKeywords._set_routing_table_properties(node, path)
@staticmethod
@@ -149,7 +151,8 @@ class RoutingKeywords(object):
:raises HoneycombError: If the operation fails.
"""
- path = "/control-plane-protocol/hc2vpp-ietf-routing:static/{0}".format(name)
+ path = "/control-plane-protocol/hc2vpp-ietf-routing:static/{0}".format(
+ name)
status_code, resp = HcUtil.\
get_honeycomb_data(node, "oper_routing_table", path)
@@ -226,7 +229,7 @@ class RoutingKeywords(object):
node, 'config_slaac', path)
else:
data = {
- 'ipv6-router-advertisements': slaac_data
+ 'ipv6-router-advertisements': slaac_data
}
status_code, _ = HcUtil.put_honeycomb_data(