- Decrease pylint errors. Part: easy
Change-Id: I452e5b5a11e9b78c03cd173a3848babe21b93c73
Signed-off-by: Peter Mikus <pmikus@cisco.com>
else:
logger.console('....log_install_dmm on node {1}.... {0}'
.format(stdout, dut_node['host']))
else:
logger.console('....log_install_dmm on node {1}.... {0}'
.format(stdout, dut_node['host']))
'{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),
'{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),
- raise RuntimeError('Patch of l3fwd failed.')
\ No newline at end of file
+ raise RuntimeError('Patch of l3fwd failed.')
+
the node.
"""
hw_addr = '' if mac is None else 'hw-addr {mac}'.format(mac=mac)
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(
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')
if output[0].get('retval') == 0:
sw_if_idx = output[0].get('sw_if_index')
if_key = Topology.get_interface_by_sw_index(node, sw_if_idx)
return if_key
else:
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):
@staticmethod
def add_bond_eth_interface(node, ifc_name=None, sw_if_idx=None):
FIXME: Describe API."""
# TODO: Decrease friction between various search and rate provider APIs.
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):
ROBOT_LIBRARY_SCOPE = 'TEST SUITE'
def __init__(self):
from glob import glob
from os import getcwd
from glob import glob
from os import getcwd
-from .Testcase import Testcase
from .DefaultTestcase import DefaultTestcase
from .DefaultTestcase import DefaultTestcase
}
def get_iface_and_suite_id(filename):
}
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.
dash_split = filename.split("-", 1)
if len(dash_split[0]) <= 4:
# It was something like "2n1l", we need one more split.
return dash_split[0], dash_split[1].split(".", 1)[0]
def add_testcase(testcase, iface, file_out, num, **kwargs):
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):
# 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)
num = 1
for tc_kwargs in tc_kwargs_list:
num = add_testcase(testcase, iface, file_out, num, **tc_kwargs)
- "frame_num": "${%d}" % fs,
- "frame_str": "%dB" % fs
+ "frame_num": "${%d}" % fsize,
+ "frame_str": "%dB" % fsize
}
except ValueError: # Assuming an IMIX string.
subst_dict = {
}
except ValueError: # Assuming an IMIX string.
subst_dict = {
- 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)
return DHCPRelayKeywords._set_dhcp_relay_properties(node, path, data)
{
"table-id": vrf,
"address-family": "vpp-fib-table-management:{0}"
{
"table-id": vrf,
"address-family": "vpp-fib-table-management:{0}"
"name": "{0}-VRF:{1}".format(ip_version, vrf)
}
]
"name": "{0}-VRF:{1}".format(ip_version, vrf)
}
]
- 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)
return RoutingKeywords._set_routing_table_properties(
node, path, full_data)
- 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
return RoutingKeywords._set_routing_table_properties(node, path)
@staticmethod
:raises HoneycombError: If the operation fails.
"""
: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)
status_code, resp = HcUtil.\
get_honeycomb_data(node, "oper_routing_table", path)
node, 'config_slaac', path)
else:
data = {
node, 'config_slaac', path)
else:
data = {
- 'ipv6-router-advertisements': slaac_data
+ 'ipv6-router-advertisements': slaac_data
}
status_code, _ = HcUtil.put_honeycomb_data(
}
status_code, _ = HcUtil.put_honeycomb_data(