+ Docstring warnings fixed.
+ Multiline param descriptions indented by 4 spaces.
- Except the PacketVerifier.py one
- I have tried several quote-like blocks, nothing works.
- Rst warnings not fixed.
- How can I fix them? They refer to temporarily created files.
+ Other improvements:
+ Python lines no longer than 80 characters.
+ :return: -> :returns:
+ Notes before params.
+ :raises
+ closing colon after exception class.
+ Description is a sentence.
+ Present tense in conditional sentences.
+ Bumped copyright year in edited files.
Change-Id: I462c194eeecb666dc146e26858486a07c990be9b
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
-# Copyright (c) 2017 Cisco and/or its affiliates.
+# Copyright (c) 2018 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
:type node: dict
:type ip_version: str
:type direction: str
- :returns (table_index, skip_n, match_n)
- table_index: Classify table index.
- skip_n: Number of skip vectors.
- match_n: Number of match vectors.
+ :returns: (table_index, skip_n, match_n)
+ table_index: Classify table index.
+ skip_n: Number of skip vectors.
+ match_n: Number of match vectors.
:rtype: tuple(int, int, int)
:raises RuntimeError: If VPP can't create table.
"""
:param direction: Direction of traffic - src/dst.
:type node: dict
:type direction: str
- :returns (table_index, skip_n, match_n)
- table_index: Classify table index.
- skip_n: Number of skip vectors.
- match_n: Number of match vectors.
+ :returns: (table_index, skip_n, match_n)
+ table_index: Classify table index.
+ skip_n: Number of skip vectors.
+ match_n: Number of match vectors.
:rtype: tuple(int, int, int)
:raises RuntimeError: If VPP can't create table.
"""
:param hex_mask: Classify hex mask.
:type node: dict
:type hex_mask: str
- :returns (table_index, skip_n, match_n)
- table_index: Classify table index.
- skip_n: Number of skip vectors.
- match_n: Number of match vectors.
+ :returns: (table_index, skip_n, match_n)
+ table_index: Classify table index.
+ skip_n: Number of skip vectors.
+ match_n: Number of match vectors.
:rtype: tuple(int, int, int)
:raises RuntimeError: If VPP can't create table.
"""
:param node: VPP node to setup classify session.
:param session_type: Session type - hit-next, l2-hit-next, acl-hit-next
- or policer-hit-next, and their respective parameters.
+ or policer-hit-next, and their respective parameters.
:param table_index: Classify table index.
:param skip_n: Number of skip vectors based on mask.
:param match_n: Number of match vectors based on mask.
:param match: Match value - l2, l3, l4 or hex, and their
- respective parameters.
+ respective parameters.
:param match2: Additional match values, to avoid using overly long
- variables in RobotFramework.
+ variables in RobotFramework.
:type node: dict
:type session_type: str
:type table_index: int
:type protocol: str
:type direction: str
:returns: Classify hex mask.
- :rtype : str
+ :rtype: str
:raises ValueError: If protocol is not TCP or UDP.
:raises ValueError: If direction is not source or destination or
source + destination.
:param ip_version: Version of IP protocol.
:type ip_version: str
- :return: Base hex mask.
+ :returns: Base hex mask.
:rtype: str
"""
if ip_version == 'ip4':
-# Copyright (c) 2017 Cisco and/or its affiliates.
+# Copyright (c) 2018 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
def install_vpp(self, install_dkms=False):
"""Install VPP inside a container.
- :param install_dkms: If install dkms package. This will impact install
- time. Dkms is required for installation of vpp-dpdk-dkms. Default is
- false.
+ :param install_dkms: If install dkms package. This will impact
+ install time. Dkms is required for installation of vpp-dpdk-dkms.
+ Default is false.
:type install_dkms: bool
"""
self.execute('ln -s /dev/null /etc/sysctl.d/80-vpp.conf')
"""Acquire a privileged system object where configuration is stored.
:param force: If a container exists, destroy it and create a new
- container.
+ container.
:type force: bool
:raises RuntimeError: If creating the container or writing the container
- config fails.
+ config fails.
"""
if self.is_container_present():
if force:
-# Copyright (c) 2016 Cisco and/or its affiliates.
+# Copyright (c) 2018 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
:type smt_used: bool
:returns: List of cpu numbers related to numa from argument.
:rtype: list of int
- :raises RuntimeError: If node cpuinfo is not available or if SMT is not
- enabled.
+ :raises RuntimeError: If node cpuinfo is not available
+ or if SMT is not enabled.
"""
cpu_node = int(cpu_node)
:type lcores_list: str
:type queue_nums: str
:type jumbo_frames: str
- :return: none
+ :returns: none
"""
if dut_node['type'] == NodeType.DUT:
adj_mac0, adj_mac1 = L3fwdTest.get_adj_mac(nodes_info, dut_node,
:type node: dict
:returns: PID
:rtype: int
- :raises RuntimeError if it is not possible to get the PID.
+ :raises RuntimeError: If it is not possible to get the PID.
"""
ssh = SSH()
:type vpp_pkg_dir: str
:type vpp_rpm_pkgs: list
:type vpp_deb_pkgs: list
- :raises: RuntimeError if failed to remove or install VPP
+ :raises RuntimeError: If failed to remove or install VPP.
"""
logger.debug("Installing VPP")
:param node: DUT node.
:type node: dict
- :raises: RuntimeError if failed to restart VPP, get VPP version or
- get VPP interfaces
+ :raises RuntimeError: If failed to restart VPP, get VPP version
+ or get VPP interfaces.
"""
logger.debug("Verify VPP on node {0}".format(node['host']))
-# Copyright (c) 2016 Cisco and/or its affiliates.
+# Copyright (c) 2018 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
:param args: List of testpmd parameters.
:type node: dict
:type args: dict
- :return: nothing
+ :returns: nothing
"""
eal_options = DpdkUtil.get_eal_options(**args)
pmd_options = DpdkUtil.get_pmd_options(**args)
:param node: Node to stop testpmd on.
:type node: dict
- :return: nothing
+ :returns: nothing
"""
ssh = SSH()
ssh.connect(node)
-# Copyright (c) 2016 Cisco and/or its affiliates.
+# Copyright (c) 2018 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
:type traffic_type: str
:type traffic_type: bool
:returns: Drop threshold exceeded? (True/False)
- :rtype bool
+ :rtype: bool
"""
pass
:type max_rate: float
:type min_rate: float
:returns: nothing
- :raises: ValueError if min rate is lower than 0 and higher than max rate
+ :raises ValueError: If min rate is lower than 0 or higher than max rate.
"""
if float(min_rate) <= 0:
raise ValueError("min_rate must be higher than 0")
:param loss_acceptance: Loss acceptance treshold for PDR search.
:type loss_acceptance: str
:returns: nothing
- :raises: ValueError if loss acceptance is lower than zero
+ :raises ValueError: If loss acceptance is lower than zero.
"""
if float(loss_acceptance) < 0:
raise ValueError("Loss acceptance must be higher or equal 0")
:param rate_type: Type of rate to set.
:type rate_type: RateType
:returns: nothing
- :raises: Exception if rate type is unknown
+ :raises Exception: If rate type is unknown.
"""
if rate_type not in RateType:
raise Exception("rate_type unknown: {}".format(rate_type))
:returns: String representation of rate type.
:rtype: str
- :raises: ValueError if rate type is unknown
+ :raises ValueError: If rate type is unknown.
"""
if self._rate_type == RateType.PERCENTAGE:
return "%"
:param max_attempts: Number of traffic runs.
:type max_attempts: int
:returns: nothing
- :raises: ValueError if max attempts is lower than zero
+ :raises ValueError: If max attempts is lower than zero.
"""
if int(max_attempts) > 0:
self._max_attempts = int(max_attempts)
:param search_type: Type of search result evaluation to set.
:type search_type: SearchResultType
:returns: nothing
- :raises: ValueError if search type is unknown
+ :raises ValueError: If search type is unknown.
"""
if search_type not in SearchResultType:
raise ValueError("search_type unknown: {}".format(search_type))
:type res_list: list
:returns: Boolean based on search result type.
:rtype: boolean
- :raises: ValueError if search result type is unknown
+ :raises ValueError: If search result type is unknown.
"""
if self._search_result_type == SearchResultType.BEST_OF_N:
return self._get_best_of_n(res_list)
:type start_rate: float
:type traffic_type: str
:returns: nothing
- :raises: ValueError if start rate is not in range
+ :raises ValueError: If start rate is not in range.
"""
if not self._rate_min <= float(start_rate) <= self._rate_max:
:returns: Result rate and latency stats.
:rtype: tuple
- :raises: Exception if search failed
+ :raises Exception: If search failed.
"""
if self._search_result == SearchResults.FAILURE:
raise Exception('Search FAILED')
:type skip_max_rate: bool
:type skip_warmup: bool
:returns: nothing
- :raises: ValueError if input values are not valid
+ :raises ValueError: If input values are not valid.
"""
if not self._rate_min <= float(b_min) <= self._rate_max:
:type start_rate: float
:type traffic_type: str
:returns: nothing
- :raises: RuntimeError if linear search failed
+ :raises RuntimeError: If linear search failed.
"""
self.linear_search(start_rate, traffic_type)
:returns: Returns True if num_a is close in value to num_b or equal.
False otherwise.
:rtype: boolean
- :raises: ValueError if input values are not valid
+ :raises ValueError: If input values are not valid.
"""
if num_a == num_b:
-# Copyright (c) 2017 Cisco and/or its affiliates.
+# Copyright (c) 2018 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
When raising this exception, put this information to the message in this
order:
- - short description of the encountered problem,
- - relevant messages if there are any collected, e.g., from caught
- exception,
- - relevant data if there are any collected.
+
+ - short description of the encountered problem,
+ - relevant messages if there are any collected, e.g., from caught
+ exception,
+ - relevant data if there are any collected.
+
The logging is performed on two levels: 1. error - short description of the
problem; 2. debug - detailed information.
"""
:param msg: Message to be displayed and logged.
:param enable_logging: When True, logging is enabled, otherwise
- logging is disabled.
+ logging is disabled.
:type msg: str
:type enable_logging: bool
"""
:type ip_addr: str
:type port: str or int
:type path: str
- :return: Full url.
+ :returns: Full url.
:rtype: str
"""
:type path: str
:type enable_logging: bool
:type kwargs: dict
- :return: Status code and content of response.
+ :returns: Status code and content of response.
:rtype: tuple
:raises HTTPRequestError: If
1. it is not possible to connect,
:param path: URL path, e.g. /index.html.
:param headers: Dictionary of HTTP Headers to send with the Request.
:param timeout: How long to wait for the server to send data before
- giving up, as a float, or a (connect timeout, read timeout) tuple.
+ giving up, as a float, or a (connect timeout, read timeout) tuple.
:param enable_logging: Used to suppress errors when checking Honeycomb
- state during suite setup and teardown. When True, logging is enabled,
- otherwise logging is disabled.
+ state during suite setup and teardown. When True,
+ logging is enabled, otherwise logging is disabled.
:type node: dict
:type path: str
:type headers: dict
:type timeout: float or tuple
:type enable_logging: bool
- :return: Status code and content of response.
+ :returns: Status code and content of response.
:rtype: tuple
"""
:param path: URL path, e.g. /index.html.
:param headers: Dictionary of HTTP Headers to send with the Request.
:param payload: Dictionary, bytes, or file-like object to send in
- the body of the Request.
+ the body of the Request.
:param json: JSON formatted string to send in the body of the Request.
:param timeout: How long to wait for the server to send data before
- giving up, as a float, or a (connect timeout, read timeout) tuple.
+ giving up, as a float, or a (connect timeout, read timeout) tuple.
:type node: dict
:type path: str
:type headers: dict
:type payload: dict, bytes, or file-like object
:type json: str
:type timeout: float or tuple
- :return: Status code and content of response.
+ :returns: Status code and content of response.
:rtype: tuple
"""
return HTTPRequest._http_request('PUT', node, path, headers=headers,
:param path: URL path, e.g. /index.html.
:param headers: Dictionary of HTTP Headers to send with the Request.
:param payload: Dictionary, bytes, or file-like object to send in
- the body of the Request.
+ the body of the Request.
:param json: JSON formatted string to send in the body of the Request.
:param timeout: How long to wait for the server to send data before
- giving up, as a float, or a (connect timeout, read timeout) tuple.
+ giving up, as a float, or a (connect timeout, read timeout) tuple.
:param enable_logging: Used to suppress errors when checking ODL
- state during suite setup and teardown. When True, logging is enabled,
- otherwise logging is disabled.
+ state during suite setup and teardown. When True,
+ logging is enabled, otherwise logging is disabled.
:type node: dict
:type path: str
:type headers: dict
:type json: str
:type timeout: float or tuple
:type enable_logging: bool
- :return: Status code and content of response.
+ :returns: Status code and content of response.
:rtype: tuple
"""
return HTTPRequest._http_request('POST', node, path,
:param node: Honeycomb node.
:param path: URL path, e.g. /index.html.
:param timeout: How long to wait for the server to send data before
- giving up, as a float, or a (connect timeout, read timeout) tuple.
+ giving up, as a float, or a (connect timeout, read timeout) tuple.
:type node: dict
:type path: str
:type timeout: float or tuple
- :return: Status code and content of response.
+ :returns: Status code and content of response.
:rtype: tuple
"""
return HTTPRequest._http_request('DELETE', node, path, timeout=timeout)
-# Copyright (c) 2016 Cisco and/or its affiliates.
+# Copyright (c) 2018 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
:param integ_alg: The integrity algorithm name.
:param integ_key: The integrity key string.
:param tunnel_src: Tunnel header source IPv4 or IPv6 address. If not
- specified ESP transport mode is used.
+ specified ESP transport mode is used.
:param tunnel_dst: Tunnel header destination IPv4 or IPv6 address. If
- not specified ESP transport mode is used.
+ not specified ESP transport mode is used.
:type node: dict
:type sad_id: int
:type spi: int
:param node: VPP node to add SAD entry on.
:param n_entries: Number of SAD entries to be created.
:param sad_id: First SAD entry ID. All subsequent SAD entries will have
- id incremented by 1.
+ id incremented by 1.
:param spi: Security Parameter Index of first SAD entry. All subsequent
- SAD entries will have spi incremented by 1.
+ SAD entries will have spi incremented by 1.
:param crypto_alg: The encryption algorithm name.
:param crypto_key: The encryption key string.
:param integ_alg: The integrity algorithm name.
:param integ_key: The integrity key string.
:param tunnel_src: Tunnel header source IPv4 or IPv6 address. If not
- specified ESP transport mode is used.
+ specified ESP transport mode is used.
:param tunnel_dst: Tunnel header destination IPv4 or IPv6 address. If
- not specified ESP transport mode is used.
+ not specified ESP transport mode is used.
:type node: dict
:type n_entries: int
:type sad_id: int
:param priority: SPD entry priority, higher number = higher priority.
:param action: Policy action.
:param inbound: If True policy is for inbound traffic, otherwise
- outbound.
+ outbound.
:param sa_id: SAD entry ID for protect action.
:param laddr_range: Policy selector local IPv4 or IPv6 address range in
- format IP/prefix or IP/mask. If no mask is provided, it's considered
- to be /32.
+ format IP/prefix or IP/mask. If no mask is provided,
+ it's considered to be /32.
:param raddr_range: Policy selector remote IPv4 or IPv6 address range in
- format IP/prefix or IP/mask. If no mask is provided, it's considered
- to be /32.
+ format IP/prefix or IP/mask. If no mask is provided,
+ it's considered to be /32.
:param proto: Policy selector next layer protocol number.
:param lport_range: Policy selector local TCP/UDP port range in format
- <port_start>-<port_end>.
+ <port_start>-<port_end>.
:param rport_range: Policy selector remote TCP/UDP port range in format
- <port_start>-<port_end>.
+ <port_start>-<port_end>.
:type node: dict
:type spd_id: int
:type priority: int
:param spd_id: SPD ID to add entries on.
:param priority: SPD entries priority, higher number = higher priority.
:param inbound: If True policy is for inbound traffic, otherwise
- outbound.
+ outbound.
:param sa_id: SAD entry ID for first entry. Each subsequent entry will
- SAD entry ID incremented by 1.
+ SAD entry ID incremented by 1.
:param raddr_ip: Policy selector remote IPv4 start address for the first
- entry. Remote IPv4 end address will be calculated depending on
- raddr_range parameter. Each subsequent entry will have start address
- next after IPv4 end address of previous entry.
+ entry. Remote IPv4 end address will be calculated depending on
+ raddr_range parameter. Each subsequent entry will have start address
+ next after IPv4 end address of previous entry.
:param raddr_range: Mask specifying range of Policy selector Remote IPv4
- addresses. Valid values are from 1 to 32.
+ addresses. Valid values are from 1 to 32.
:type node: dict
:type n_entries: int
:type spd_id: int
:param integ_alg: The integrity algorithm name.
:param integ_key: The integrity key string.
:param raddr_ip1: Policy selector remote IPv4 start address for the
- first tunnel in direction node1->node2.
+ first tunnel in direction node1->node2.
:param raddr_ip2: Policy selector remote IPv4 start address for the
- first tunnel in direction node2->node1.
+ first tunnel in direction node2->node1.
:param raddr_range: Mask specifying range of Policy selector Remote IPv4
- addresses. Valid values are from 1 to 32.
+ addresses. Valid values are from 1 to 32.
:type node1: dict
:type node2: dict
:type if1_ip_addr: str
:param tunnel_ip1: Tunnel node1 IPv4 address.
:param tunnel_ip2: Tunnel node2 IPv4 address.
:param raddr_ip1: Policy selector remote IPv4 start address for the
- first tunnel in direction node1->node2.
+ first tunnel in direction node1->node2.
:param raddr_ip2: Policy selector remote IPv4 start address for the
- first tunnel in direction node2->node1.
+ first tunnel in direction node2->node1.
:param raddr_range: Mask specifying range of Policy selector Remote IPv4
- addresses. Valid values are from 1 to 32.
+ addresses. Valid values are from 1 to 32.
:type node1: dict
:type node2: dict
:type interface1: str or int
-# Copyright (c) 2016 Cisco and/or its affiliates.
+# Copyright (c) 2018 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
def next_network(self):
"""
- :return: Next network in form (IPv4Network, subnet).
- :raises: StopIteration if there are no more elements.
+ :returns: Next network in form (IPv4Network, subnet).
+ :raises StopIteration: If there are no more elements.
"""
if len(self._networks):
return self._networks.pop()
-# Copyright (c) 2016 Cisco and/or its affiliates.
+# Copyright (c) 2018 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
:param interface: Interface name.
:type interface: str
- :return: nothing
+ :returns: nothing
"""
pass
interfaces from topology and use them to setup ARP entries.
:param nodes_info: Dictionary containing information on all nodes
- in topology.
+ in topology.
:param nodes_addr: Nodes IPv4 addresses.
:type nodes_info: dict
:type nodes_addr: dict
-# Copyright (c) 2016 Cisco and/or its affiliates.
+# Copyright (c) 2018 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
:type node: dict
:type port: str
:type nodes_addr: dict
- :return: IPv4 prefix length.
+ :returns: IPv4 prefix length.
:rtype: int
"""
for net in nodes_addr.values():
:type node: dict
:type port: int
:type nodes_addr: dict
- :return: IPv4 subnet.
+ :returns: IPv4 subnet.
:rtype: str
"""
for net in nodes_addr.values():
def flush_ip_addresses(port, node):
"""See IPv4Node.flush_ip_addresses for more information.
- :param port:
- :param node:
- :return:
+ :param port: FIXME
+ :param node: FIXME
+ :returns: FIXME
"""
get_node(node).flush_ip_addresses(port)
:param nodes_addr: Available nodes IPv4 addresses.
:type link: str
:type nodes_addr: dict
- :return: Link IPv4 address.
+ :returns: Link IPv4 address.
:rtype: str
"""
net = nodes_addr.get(link)
:param nodes_addr: Available nodes IPv4 addresses.
:type link: str
:type nodes_addr: dict
- :return: Link IPv4 address prefix.
+ :returns: Link IPv4 address prefix.
:rtype: int
"""
net = nodes_addr.get(link)
-# Copyright (c) 2016 Cisco and/or its affiliates.
+# Copyright (c) 2018 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
def next_network(self):
"""Get the next element of the iterator.
- :return: IPv6 network.
+ :returns: IPv6 network.
:rtype: IPv6Network object
- :raises: StopIteration if there is no more elements.
+ :raises StopIteration: If there is no more elements.
"""
if len(self._networks):
return self._networks.pop()
-# Copyright (c) 2016 Cisco and/or its affiliates.
+# Copyright (c) 2018 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
:type count: int
:type data_size: int
:type timeout: int
- :return: Number of lost packets.
+ :returns: Number of lost packets.
:rtype: int
"""
ssh = SSH()
:type cnt: int
:type size: int
:type timeout: int
- :return: Number of lost packets.
+ :returns: Number of lost packets.
:rtype: int
"""
dst_ip = IPv6Util.get_node_port_ipv6_address(dst_node, port, nodes_ip)
:type node: dict
:type iface_key: str
:type nodes_addr: dict
- :return: IPv6 address string.
+ :returns: IPv6 address string.
:rtype: str
"""
interface = Topology.get_interface_name(node, iface_key)
-# Copyright (c) 2016 Cisco and/or its affiliates.
+# Copyright (c) 2018 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
:type node: dict
:type timeout: int
:returns: Nothing.
- :raises: RuntimeError if the timeout period value has elapsed.
+ :raises RuntimeError: If the timeout period value has elapsed.
"""
if_ready = False
not_ready = []
:type node: dict
:type interface: int or str
:returns: List of dictionaries containing data for each interface, or a
- single dictionary for the specified interface.
+ single dictionary for the specified interface.
:rtype: list or dict
:raises TypeError: if the data type of interface is neither basestring
- nor int.
+ nor int.
"""
with VatTerminal(node) as vat:
response = vat.vat_terminal_exec_cmd_from_template(
:type interface: str
:type ip_version: str
:returns: List of dictionaries, each containing IP address, subnet
- prefix length and also the subnet mask for ipv4 addresses.
- Note: A single interface may have multiple IP addresses assigned.
+ prefix length and also the subnet mask for ipv4 addresses.
+ Note: A single interface may have multiple IP addresses assigned.
:rtype: list
"""
:returns: Interface driver or None if not found.
:rtype: str
:raises RuntimeError: If it is not possible to get the interface driver
- information from the node.
+ information from the node.
.. note::
# lspci -vmmks 0000:00:05.0
def update_tg_interface_data_on_node(node):
"""Update interface name for TG/linux node in DICT__nodes.
- :param node: Node selected from DICT__nodes.
- :type node: dict
- :raises RuntimeError: If getting of interface name and MAC fails.
-
.. note::
# for dev in `ls /sys/class/net/`;
> do echo "\"`cat /sys/class/net/$dev/address`\": \"$dev\""; done
"52:54:00:e1:8a:0f": "eth2"
"00:00:00:00:00:00": "lo"
- .. todo:: parse lshw -json instead
+ .. note:: TODO: parse lshw -json instead
+
+ :param node: Node selected from DICT__nodes.
+ :type node: dict
+ :raises RuntimeError: If getting of interface name and MAC fails.
"""
# First setup interface driver specified in yaml file
InterfaceUtil.tg_set_interfaces_default_driver(node)
:returns: Name and index of created subinterface.
:rtype: tuple
:raises RuntimeError: if it is unable to create VLAN subinterface on the
- node.
+ node.
"""
iface_key = Topology.get_interface_by_name(node, interface)
sw_if_index = Topology.get_interface_sw_index(node, iface_key)
:returns: SW IF INDEX of created interface.
:rtype: int
:raises RuntimeError: if it is unable to create VxLAN interface on the
- node.
+ node.
"""
output = VatExecutor.cmd_from_template(node, "vxlan_create.vat",
src=source_ip,
:param node: VPP node to get interface data from.
:param interface: Numeric index or name string of a specific interface.
- If None, information about all VxLAN interfaces is returned.
+ If None, information about all VxLAN interfaces is returned.
:type node: dict
:type interface: int or str
:returns: Dictionary containing data for the given VxLAN interface or if
- interface=None, the list of dictionaries with all VxLAN interfaces.
+ interface=None, the list of dictionaries with all VxLAN interfaces.
:rtype: dict or list
:raises TypeError: if the data type of interface is neither basestring
- nor int.
+ nor int.
"""
param = "sw_if_index"
if interface is None:
:type node: dict
:type name: str
:returns: Dictionary of information about a specific TAP interface, or
- a List of dictionaries containing all TAP data for the given node.
+ a List of dictionaries containing all TAP data for the given node.
:rtype: dict or list
"""
with VatTerminal(node) as vat:
:param outer_vlan_id: Optional outer VLAN ID.
:param inner_vlan_id: Optional inner VLAN ID.
:param type_subif: Optional type of sub-interface. Values supported by
- VPP: [no_tags] [one_tag] [two_tags] [dot1ad] [exact_match] [default_sub]
+ VPP: [no_tags] [one_tag] [two_tags] [dot1ad] [exact_match]
+ [default_sub]
:type node: dict
:type interface: str or int
:type sub_id: int
:returns: SW interface index.
:rtype: int
:raises RuntimeError: If it is not possible to create loopback on the
- node.
+ node.
"""
out = VatExecutor.cmd_from_template(node, "create_loopback.vat")
if out[0].get('retval') == 0:
:param node: VPP node to get interface data from.
:param interface_name: Name of the specific interface. If None,
- information about all VxLAN GPE interfaces is returned.
+ information about all VxLAN GPE interfaces is returned.
:type node: dict
:type interface_name: str
:returns: Dictionary containing data for the given VxLAN GPE interface
- or if interface=None, the list of dictionaries with all VxLAN GPE
- interfaces.
+ or if interface=None, the list of dictionaries with all VxLAN GPE
+ interfaces.
:rtype: dict or list
"""
-# Copyright (c) 2017 Cisco and/or its affiliates.
+# Copyright (c) 2018 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
:type rtype: str
:type name: str
:raises RuntimeError: If retrieving or deleting Kubernetes resource
- failed.
+ failed.
"""
ssh = SSH()
ssh.connect(node)
-# Copyright (c) 2016 Cisco and/or its affiliates.
+# Copyright (c) 2018 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
:type uu_flood: bool
:type forward: bool
:type learn: bool
- :type arp_term:bool
+ :type arp_term: bool
"""
VatExecutor.cmd_from_template(node, "l2_bd_create.vat",
bd_id=bd_id, flood=flood,
:type sw_if_index: int
:type bd_id: int
:type shg: int
- :return:
+ :returns: None
"""
VatExecutor.cmd_from_template(node, "l2_bd_add_sw_if_index.vat",
bd_id=bd_id, sw_if_index=sw_if_index,
:param node: Node data dictionary.
:param link_names: List of names of links the bridge domain should be
- connecting.
+ connecting.
:param bd_id: Bridge domain index number.
:type node: dict
:type link_names: list
- :return: Dictionary used to generate l2 bridge domain VAT configuration
- from template file.
+ :returns: Dictionary used to generate l2 bridge domain VAT configuration
+ from template file.
:rtype: dict
"""
bd_dict = Topology().get_interfaces_by_link_names(node, link_names)
:param if_1: First interface to be added to the bridge.
:param if_2: Second interface to be added to the bridge.
:param set_up: Change bridge interface state to up after create bridge.
- Optional. Default: True.
+ Optional. Default: True.
:type node: dict
:type br_name: str
:type if_1: str
def linux_del_bridge(node, br_name, set_down=True):
"""Delete bridge from linux node.
+ ..note:: The network interface corresponding to the bridge must be
+ down before it can be deleted!
+
:param node: Node to delete bridge from.
:param br_name: Bridge name.
:param set_down: Change bridge interface state to down before delbr
- command. Optional. Default: True.
+ command. Optional. Default: True.
:type node: str
:type br_name: str
:type set_down: bool
- ..note:: The network interface corresponding to the bridge must be
- down before it can be deleted!
"""
if set_down:
cmd = 'ip link set dev {0} down'.format(br_name)
:param bd_id: Numeric ID of a specific bridge domain.
:type node: dict
:type bd_id: int
- :return: List of dictionaries containing data for each bridge domain, or
- a single dictionary for the specified bridge domain.
+ :returns: List of dictionaries containing data for each bridge domain,
+ or a single dictionary for the specified bridge domain.
:rtype: list or dict
"""
with VatTerminal(node) as vat:
:param interface: Interface on which rewrite tags.
:param tag_rewrite_method: Method of tag rewrite.
:param push_dot1q: Optional parameter to disable to push dot1q tag
- instead of dot1ad.
+ instead of dot1ad.
:param tag1_id: Optional tag1 ID for VLAN.
:param tag2_id: Optional tag2 ID for VLAN.
:type node: dict
:param bd_index: Index of the bridge domain.
:type node: dict
:type bd_index: int
- :return: L2 FIB table.
+ :returns: L2 FIB table.
:rtype: list
"""
:type node: dict
:type bd_index: int
:type mac: str
- :return: L2 FIB entry
+ :returns: L2 FIB entry
:rtype: dict
"""
-# Copyright (c) 2016 Cisco and/or its affiliates.
+# Copyright (c) 2018 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
:param node: VPP node.
:param items_filter: Filter which specifies which items should be
- retrieved - local, remote, empty string = both.
+ retrieved - local, remote, empty string = both.
:type node: dict
:type items_filter: str
:returns: Lisp locator_set data as python list.
:type node: dict
:type locator_set_number: str
:returns: list of lisp locator_set, list of lisp locator_set expected
- from VAT.
+ from VAT.
:rtype: tuple
"""
:type node: dict
:type locator_set_number: str
:returns: list of lisp locator_set, list of lisp locator_set expected
- from VAT.
+ from VAT.
:rtype: tuple
"""
-# Copyright (c) 2016 Cisco and/or its affiliates.
+# Copyright (c) 2018 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
:param interface: Interface id.
:type node: dict
:type interface: str or int
- :return: nothing
+ :returns: nothing
"""
if node['type'] == NodeType.DUT:
sw_if_index = Topology.get_interface_sw_index(node, interface)
:param interface_name: Interface name.
:type node: dict
:type interface_name: str or int
- :return: nothing
+ :returns: nothing
"""
if node['type'] == NodeType.DUT:
-# Copyright (c) 2016 Cisco and/or its affiliates.
+# Copyright (c) 2018 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
:param psid_offset: Port Set Identifier (PSID) offset.
:param psid_len: Port Set Identifier (PSID) length.
:param map_t: Mapping using translation instead of encapsulation.
- Default False.
+ Default False.
:type vpp_node: dict
:type ip4_pfx: str
:type ip6_pfx: str
@staticmethod
def get_psid_from_port(port, psid_len, psid_offset):
- """Return PSID from port.
+ """Return PSID from port.::
+
0 1
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
+-----------+-----------+-------+
:type ea_bit_len: int
:type psid: int
:returns: Number representing interface id field of destination IPv6
- address.
+ address.
:rtype: int
"""
if rule_net.prefixlen + ea_bit_len < 32:
psid_offset, psid_len, ipv4_dst,
dst_port):
"""Compute IPv6 destination address from IPv4 address for MAP algorithm.
- (RFC 7597)
-
- | n bits | o bits | s bits | 128-n-o-s bits |
- +--------------------+-----------+---------+-----------------------+
- | Rule IPv6 prefix | EA bits |subnet ID| interface ID |
- +--------------------+-----------+---------+-----------------------+
- |<--- End-user IPv6 prefix --->|
+ (RFC 7597)::
+ | n bits | o bits | s bits | 128-n-o-s bits |
+ +--------------------+-----------+---------+-----------------------+
+ | Rule IPv6 prefix | EA bits |subnet ID| interface ID |
+ +--------------------+-----------+---------+-----------------------+
+ |<--- End-user IPv6 prefix --->|
:param ipv4_pfx: Domain IPv4 preffix.
:param ipv6_pfx: Domain IPv6 preffix.
-# Copyright (c) 2017 Cisco and/or its affiliates.
+# Copyright (c) 2018 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
:returns: Response of the command.
:rtype: str
:raises RuntimeError: If setting of inside and outside interfaces for
- NAT44 fails.
+ NAT44 fails.
"""
try:
:returns: Response of the command.
:rtype: str
:raises RuntimeError: If setting of deterministic behaviour of NAT44
- fails.
+ fails.
"""
try:
"""Set NAT workers.
:param node: DUT node.
- :param lcores: list of cores, format: range e.g. 1-5 or list of ranges
- e.g.: 1-5,18-22.
+ :param lcores: List of cores, format: range e.g. 1-5 or list of ranges
+ e.g.: 1-5,18-22.
:type node: dict
:type lcores: str
:returns: Response of the command.
:returns: Response of the command.
:rtype: str
:raises RuntimeError: If command 'exec snat deterministic forward'
- fails.
+ fails.
"""
try:
:returns: Response of the command.
:rtype: str
:raises RuntimeError: If command 'exec snat deterministic reverse'
- fails.
+ fails.
"""
try:
-# Copyright (c) 2016 Cisco and/or its affiliates.
+# Copyright (c) 2018 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
def compute_path(self, always_same_link=True):
"""Compute path for added nodes.
+ .. note:: First add at least two nodes to the topology.
+
:param always_same_link: If True use always same link between two nodes
- in path. If False use different link (if available) between two
- nodes if one link was used before.
+ in path. If False use different link (if available)
+ between two nodes if one link was used before.
:type always_same_link: bool
-
- .. note:: First add at least two nodes to the topology.
+ :raises RuntimeError: If not enough nodes for path.
"""
nodes = self._nodes
if len(nodes) < 2:
-# Copyright (c) 2016 Cisco and/or its affiliates.
+# Copyright (c) 2018 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
"""PacketVerifier module.
- :Example:
-
- >>> from scapy.all import *
- >>> from PacketVerifier import *
- >>> rxq = RxQueue('eth1')
- >>> txq = TxQueue('eth1')
- >>> src_mac = "AA:BB:CC:DD:EE:FF"
- >>> dst_mac = "52:54:00:ca:5d:0b"
- >>> src_ip = "11.11.11.10"
- >>> dst_ip = "11.11.11.11"
- >>> sent_packets = []
- >>> pkt_send = Ether(src=src_mac, dst=dst_mac) /
- ... IP(src=src_ip, dst=dst_ip) /
- ... ICMP()
- >>> sent_packets.append(pkt_send)
- >>> txq.send(pkt_send)
- >>> pkt_send = Ether(src=src_mac, dst=dst_mac) /
- ... ARP(hwsrc=src_mac, psrc=src_ip, hwdst=dst_mac, pdst=dst_ip, op=2)
- >>> sent_packets.append(pkt_send)
- >>> txq.send(pkt_send)
- >>> rxq.recv(100, sent_packets).show()
- ###[ Ethernet ]###
- dst = aa:bb:cc:dd:ee:ff
- src = 52:54:00:ca:5d:0b
- type = 0x800
- ###[ IP ]###
- version = 4L
- ihl = 5L
- tos = 0x0
- len = 28
- id = 43183
- flags =
- frag = 0L
- ttl = 64
- proto = icmp
- chksum = 0xa607
- src = 11.11.11.11
- dst = 11.11.11.10
- options
- ###[ ICMP ]###
- type = echo-reply
- code = 0
- chksum = 0xffff
- id = 0x0
- seq = 0x0
- ###[ Padding ]###
- load = 'RT\x00\xca]\x0b\xaa\xbb\xcc\xdd\xee\xff\x08\x06\x00\x01\x08\x00'
+ Example. ::
+
+ | >>> from scapy.all import *
+ | >>> from PacketVerifier import *
+ | >>> rxq = RxQueue('eth1')
+ | >>> txq = TxQueue('eth1')
+ | >>> src_mac = "AA:BB:CC:DD:EE:FF"
+ | >>> dst_mac = "52:54:00:ca:5d:0b"
+ | >>> src_ip = "11.11.11.10"
+ | >>> dst_ip = "11.11.11.11"
+ | >>> sent_packets = []
+ | >>> pkt_send = Ether(src=src_mac, dst=dst_mac) /
+ | ... IP(src=src_ip, dst=dst_ip) /
+ | ... ICMP()
+ | >>> sent_packets.append(pkt_send)
+ | >>> txq.send(pkt_send)
+ | >>> pkt_send = Ether(src=src_mac, dst=dst_mac) /
+ | ... ARP(hwsrc=src_mac, psrc=src_ip, hwdst=dst_mac, pdst=dst_ip, op=2)
+ | >>> sent_packets.append(pkt_send)
+ | >>> txq.send(pkt_send)
+ | >>> rxq.recv(100, sent_packets).show()
+ | ###[ Ethernet ]###
+ | dst = aa:bb:cc:dd:ee:ff
+ | src = 52:54:00:ca:5d:0b
+ | type = 0x800
+ | ###[ IP ]###
+ | version = 4L
+ | ihl = 5L
+ | tos = 0x0
+ | len = 28
+ | id = 43183
+ | flags =
+ | frag = 0L
+ | ttl = 64
+ | proto = icmp
+ | chksum = 0xa607
+ | src = 11.11.11.11
+ | dst = 11.11.11.10
+ | options
+ | ###[ ICMP ]###
+ | type = echo-reply
+ | code = 0
+ | chksum = 0xffff
+ | id = 0x0
+ | seq = 0x0
+ | ###[ Padding ]###
+ | load = 'RT\x00\xca]\x0b\xaa\xbb\xcc\xdd\xee\xff\x08\x06\x00\x01\x08\x00'
+
+ Example end.
"""
import os
-# Copyright (c) 2016 Cisco and/or its affiliates.
+# Copyright (c) 2018 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
def policer_classify_set_interface(self, interface):
"""Set policer classify interface.
+ .. note:: First set node with policer_set_node.
+
:param interface: Interface name or sw_if_index.
:type interface: str or int
- .. note:: First set node with policer_set_node.
"""
if isinstance(interface, basestring):
self._sw_if_index = Topology.get_interface_sw_index(self._node,
def dscp_cs0():
"""Return DSCP CS0.
- :return: DSCP enum CS0 object.
+ :returns: DSCP enum CS0 object.
:rtype: DSCP
"""
return DSCP.CS0
def dscp_cs1():
"""Return DSCP CS1.
- :return: DSCP enum CS1 object.
+ :returns: DSCP enum CS1 object.
:rtype: DSCP
"""
return DSCP.CS1
def dscp_cs2():
"""Return DSCP CS2.
- :return: DSCP enum CS2 object.
+ :returns: DSCP enum CS2 object.
:rtype: DSCP
"""
return DSCP.CS2
def dscp_cs3():
"""Return DSCP CS3.
- :return: DSCP enum CS3 object.
+ :returns: DSCP enum CS3 object.
:rtype: DSCP
"""
return DSCP.CS3
def dscp_cs4():
"""Return DSCP CS4.
- :return: DSCP enum CS4 object.
+ :returns: DSCP enum CS4 object.
:rtype: DSCP
"""
return DSCP.CS4
def dscp_cs5():
"""Return DSCP CS5.
- :return: DSCP enum CS5 object.
+ :returns: DSCP enum CS5 object.
:rtype: DSCP
"""
return DSCP.CS5
def dscp_cs6():
"""Return DSCP CS6.
- :return: DSCP enum CS6 object.
+ :returns: DSCP enum CS6 object.
:rtype: DSCP
"""
return DSCP.CS6
def dscp_cs7():
"""Return DSCP CS7.
- :return: DSCP enum CS7 object.
+ :returns: DSCP enum CS7 object.
:rtype: DSCP
"""
return DSCP.CS7
def dscp_ef():
"""Return DSCP EF.
- :return: DSCP enum EF object.
+ :returns: DSCP enum EF object.
:rtype: DSCP
"""
return DSCP.EF
def dscp_af11():
"""Return DSCP AF11.
- :return: DSCP enum AF11 object.
+ :returns: DSCP enum AF11 object.
:rtype: DSCP
"""
return DSCP.AF11
def dscp_af12():
"""Return DSCP AF12.
- :return: DSCP enum AF12 object.
+ :returns: DSCP enum AF12 object.
:rtype: DSCP
"""
return DSCP.AF12
def dscp_af13():
"""Return DSCP AF13.
- :return: DSCP enum AF13 object.
+ :returns: DSCP enum AF13 object.
:rtype: DSCP
"""
return DSCP.AF13
def dscp_af21():
"""Return DSCP AF21.
- :return: DSCP enum AF21 object.
+ :returns: DSCP enum AF21 object.
:rtype: DSCP
"""
return DSCP.AF21
def dscp_af22():
"""Return DSCP AF22.
- :return: DSCP enum AF22 object.
+ :returns: DSCP enum AF22 object.
:rtype: DSCP
"""
return DSCP.AF22
def dscp_af23():
"""Return DSCP AF23.
- :return: DSCP enum AF23 object.
+ :returns: DSCP enum AF23 object.
:rtype: DSCP
"""
return DSCP.AF23
def dscp_af31():
"""Return DSCP AF31.
- :return: DSCP enum AF31 object.
+ :returns: DSCP enum AF31 object.
:rtype: DSCP
"""
return DSCP.AF31
def dscp_af32():
"""Return DSCP AF32.
- :return: DSCP enum AF32 object.
+ :returns: DSCP enum AF32 object.
:rtype: DSCP
"""
return DSCP.AF32
def dscp_af33():
"""Return DSCP AF33.
- :return: DSCP enum AF33 object.
+ :returns: DSCP enum AF33 object.
:rtype: DSCP
"""
return DSCP.AF33
:param dscp: DSCP enum object.
:type dscp: DSCP
- :return: DSCP numeric value.
+ :returns: DSCP numeric value.
:rtype: int
"""
return dscp.num
-# Copyright (c) 2016 Cisco and/or its affiliates.
+# Copyright (c) 2018 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
"""Set scheduler policy to SCHED_RR with priority 1 for all Qemu CPU
processes.
- :raises RuntimeError: Set scheduler policy failed.
+ :raises RuntimeError: Set scheduler policy failed.
"""
qemu_cpus = self._qemu_qmp_exec('query-cpus')['return']
:param socket: Path of the unix socket.
:param server: If True the socket shall be a listening socket.
:param mac: Vhost-user interface MAC address (optional, otherwise is
- used auto-generated MAC 52:54:00:00:xx:yy).
+ used auto-generated MAC 52:54:00:00:xx:yy).
:param jumbo_frames: Set True if jumbo frames are used in the test.
:type socket: str
:type server: bool
:param cmd: QMP command to execute.
:type cmd: str
- :return: Command output in python representation of JSON format. The
+ :returns: Command output in python representation of JSON format. The
{ "return": {} } response is QMP's success response. An error
response will contain the "error" keyword instead of "return".
"""
:returns: Default size of free huge pages in system.
:rtype: int
- :raises: RuntimeError if reading failed for three times.
+ :raises RuntimeError: If reading failed for three times.
"""
# TODO: remove to dedicated library
cmd_huge_size = "grep Hugepagesize /proc/meminfo | awk '{ print $2 }'"
:type huge_size: int
:returns: Number of free huge pages in system.
:rtype: int
- :raises: RuntimeError if reading failed for three times.
+ :raises RuntimeError: If reading failed for three times.
"""
# TODO: add numa aware option
# TODO: remove to dedicated library
:type huge_size: int
:returns: Total number of huge pages in system.
:rtype: int
- :raises: RuntimeError if reading failed for three times.
+ :raises RuntimeError: If reading failed for three times.
"""
# TODO: add numa aware option
# TODO: remove to dedicated library
def qemu_start(self):
"""Start QEMU and wait until VM boot.
- :return: VM node info.
- :rtype: dict
.. note:: First set at least node to run QEMU on.
.. warning:: Starts only one VM on the node.
+
+ :returns: VM node info.
+ :rtype: dict
"""
# Qemu binary path
bin_path = '{0}{1}'.format(self._qemu_path, self._qemu_bin)
- watchdog: watchdog action has been triggered
- guest-panicked: panicked as a result of guest OS panic
- :return: VM status.
+ :returns: VM status.
:rtype: str
"""
out = self._qemu_qmp_exec('query-status')
:type node: dict
:type force_install: bool
:type apply_patch: bool
- :raises: RuntimeError if building QEMU failed.
+ :raises RuntimeError: If building QEMU failed.
"""
ssh = SSH()
ssh.connect(node)
-# Copyright (c) 2016 Cisco and/or its affiliates.
+# Copyright (c) 2018 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
:param resolve_attempts: Resolve attempts IP route add parameter.
:param count: number of IP addresses to add starting from network IP
:param local: The route is local
- with same prefix (increment is 1). If None, then is not used.
+ with same prefix (increment is 1). If None, then is not used.
:param lookup_vrf: VRF table ID for lookup.
:param multipath: Enable multipath routing.
:param weight: Weight value for unequal cost multipath routing.
-# Copyright (c) 2017 Cisco and/or its affiliates.
+# Copyright (c) 2018 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
:returns: the temporary package file name.
:rtype: str
- :raises: If execute the tar command failed.
+ :raises RuntimeError: If execute the tar command failed.
"""
tmpfile = NamedTemporaryFile(suffix=".tgz", prefix="SFC-testing-")
:type tarball: str
:type node: dict
:returns: nothing
- :raises: If unpack the file failed.
+ :raises RuntimeError: If unpack the file failed.
"""
logger.console('Extracting tarball to {0} on {1}'.format(
con.REMOTE_FW_DIR, node['host']))
-# Copyright (c) 2017 Cisco and/or its affiliates.
+# Copyright (c) 2018 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
:param node: Dictionary created from topology.
:type tarball: str
:type node: dict
- :return: nothing
+ :returns: nothing
:raises RuntimeError: If extract tarball failed.
"""
logger.console('Extracting tarball to {0} on {1}'.format(
-# Copyright (c) 2016 Cisco and/or its affiliates.
+# Copyright (c) 2018 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
:type if_index: int
:type tap_name: str
:type mac: str
- :return: Returns a interface index.
+ :returns: Returns a interface index.
:rtype: int
"""
command = 'modify'
:type skip_warmup: bool
:returns: Drop threshold exceeded? (True/False)
:rtype: bool
- :raises: NotImplementedError if TG is not supported.
- :raises: RuntimeError if TG is not specified.
+ :raises NotImplementedError: If TG is not supported.
+ :raises RuntimeError: If TG is not specified.
"""
# we need instance of TrafficGenerator instantiated by Robot Framework
# to be able to use trex_stl-*()
:type tg_if1_dst_mac: str
:type tg_if2_dst_mac: str
:returns: nothing
- :raises: RuntimeError in case of issue during initialization.
+ :raises RuntimeError: In case of issue during initialization.
"""
if tg_node['type'] != NodeType.TG:
raise RuntimeError('Node type is not a TG')
:type node: dict
:returns: True if TRex is running otherwise False.
:rtype: bool
- :raises: RuntimeError if node type is not a TG.
+ :raises RuntimeError: If node type is not a TG.
"""
if node['type'] != NodeType.TG:
raise RuntimeError('Node type is not a TG')
:param node: Traffic generator node.
:type node: dict
:returns: nothing
- :raises: RuntimeError if TRex teardown failed.
- :raises: RuntimeError if node type is not a TG.
+ :raises RuntimeError: If node type is not a TG,
+ or if TRex teardown fails.
"""
if node['type'] != NodeType.TG:
raise RuntimeError('Node type is not a TG')
:param node: TRex generator node.
:type node: dict
:returns: Nothing
- :raises: RuntimeError if stop traffic script fails.
+ :raises RuntimeError: If stop traffic script fails.
"""
ssh = SSH()
ssh.connect(node)
:type latency: bool
:type warmup_time: int
:returns: Nothing
- :raises: RuntimeError in case of TG driver issue.
+ :raises RuntimeError: In case of TG driver issue.
"""
ssh = SSH()
ssh.connect(self._node)
"""Stop all traffic on TG.
:returns: Nothing
- :raises: RuntimeError if TG is not set.
+ :raises RuntimeError: If TG is not set.
"""
if self._node is None:
raise RuntimeError("TG is not set")
:type latency: bool
:returns: TG output.
:rtype: str
- :raises: RuntimeError if TG is not set.
- :raises: RuntimeError if node is not TG or subtype is not specified.
- :raises: NotImplementedError if TG is not supported.
+ :raises RuntimeError: If TG is not set, or if node is not TG,
+ or if subtype is not specified.
+ :raises NotImplementedError: If TG is not supported.
"""
node = self._node
"""Fail if loss occurred in traffic run.
:returns: nothing
- :raises: Exception if loss occured.
+ :raises Exception: If loss occured.
"""
if self._loss is None:
raise Exception('The traffic generation has not been issued')
:type loss_acceptance: float
:type loss_acceptance_type: LossAcceptanceType
:returns: nothing
- :raises: Exception if loss is above acceptance criteria.
+ :raises Exception: If loss is above acceptance criteria.
"""
if self._loss is None:
raise Exception('The traffic generation has not been issued')
-# Copyright (c) 2016 Cisco and/or its affiliates.
+# Copyright (c) 2018 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
:param arg_name: Argument name.
:type arg_name: str
- :return: Argument value.
+ :returns: Argument value.
:rtype: str
"""
arg_val = self._args.get(arg_name)
-# Copyright (c) 2016 Cisco and/or its affiliates.
+# Copyright (c) 2018 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
:param string: String to escape.
:type string: str
- :return: Escaped string.
+ :returns: Escaped string.
:rtype: str
"""
return string.replace('"', '\\"').replace("$", "\\$")
:type dst_mac: str
:type src_ip: str
:type dst_ip: str
- :return: Traffic script arguments string.
+ :returns: Traffic script arguments string.
:rtype: str
"""
args = ('--rx_if {0} --tx_if {1} --src_mac {2} --dst_mac {3} --src_ip'
-# Copyright (c) 2016 Cisco and/or its affiliates.
+# Copyright (c) 2018 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
:param node: VPP node.
:param additional_cmds: Additional commands that the vpp should print
- settings for.
+ settings for.
:type node: dict
:type additional_cmds: tuple
"""
:param node: DUT node.
:type node: dict
:returns: PID of VPP process / List of PIDs if more VPP processes are
- running on the DUT node.
+ running on the DUT node.
:rtype: int or list
"""
import resources.libraries.python.DUTSetup as PidLib
Path is defined automatically.
:param vat_name: Name of the vat script file. Only the file name of
- the script is required, the resources path is prepended automatically.
+ the script is required, the resources path is prepended
+ automatically.
:param node: Node to execute the VAT script on.
:param timeout: Seconds to allow the script to run.
:param json_out: Require JSON output.
:param copy_on_execute: If true, copy the file from local host to remote
- before executing.
+ before executing.
:type vat_name: str
:type node: dict
:type timeout: int
:type json_out: bool
:type copy_on_execute: bool
- :raises RuntimeError: If VAT script execution failed.
+ :raises SSHException: If cannot open connection for VAT.
+ :raises SSHTimeout: If VAT execution is timed out.
+ :raises RuntimeError: If VAT script execution fails.
"""
ssh = SSH()
try:
"""Pass all arguments to 'execute_script' method, then cleanup returned
json output.
- :param vat_name: Name of the vat script file. Only the file name of
- the script is required, the resources path is prepended automatically.
+ :param vat_name: Name of the vat script file. Only the file name of
+ the script is required, the resources path is prepended
+ automatically.
:param node: Node to execute the VAT script on.
:param timeout: Seconds to allow the script to run.
:type vat_name: str
:param node: Node in topology on witch the script is executed.
:param vat_template_file: Template file of VAT script.
:param vat_args: Arguments to the template file.
- :return: List of JSON objects returned by VAT.
+ :returns: List of JSON objects returned by VAT.
"""
with VatTerminal(node) as vat:
return vat.vat_terminal_exec_cmd_from_template(vat_template_file,
:param node: Node to open VAT terminal on.
:param json_param: Defines if outputs from VAT are in JSON format.
- Default is True.
+ Default is True.
:type node: dict
:type json_param: bool
:param cmd: Command to be executed.
- :return: Command output in python representation of JSON format or
- None if not in JSON mode.
+ :returns: Command output in python representation of JSON format or
+ None if not in JSON mode.
"""
VatHistory.add_to_vat_history(self._node, cmd)
logger.debug("Executing command in VAT terminal: {0}".format(cmd))
:param vat_template_file: Template file name of a VAT script.
:param args: Dictionary of parameters for VAT script.
- :return: List of JSON objects returned by VAT.
+ :returns: List of JSON objects returned by VAT.
"""
file_path = '{}/{}'.format(Constants.RESOURCES_TPL_VAT,
vat_template_file)
-# Copyright (c) 2016 Cisco and/or its affiliates.
+# Copyright (c) 2018 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
:param mac_address: MAC address.
:type mac_address: str
- :return: List representation of MAC address.
+ :returns: List representation of MAC address.
:rtype: list
"""
list_mac = []
:param mac_address: MAC address of interface we are looking for.
:type interfaces_list: dict
:type mac_address: str
- :return: Interface from JSON.
+ :returns: Interface from JSON.
:rtype: dict
"""
interface_dict = {}
:param node: Node dictionary.
:param interface_dump_json: JSON output from dump_interface_list VAT
- command.
+ command.
:type node: dict
:type interface_dump_json: str
"""
"""Get sw_if_index from given JSON output by interface name.
:param interface_dump_json: JSON output from dump_interface_list VAT
- command.
+ command.
:param interface_name: Interface name.
:type interface_dump_json: str
:type interface_name: str
- :return: SW interface index.
+ :returns: SW interface index.
:rtype: int
:raises ValueError: If interface not found in interface_dump_json.
"""
"""Get interface name from given JSON output by sw_if_index.
:param interface_dump_json: JSON output from dump_interface_list VAT
- command.
+ command.
:param sw_if_index: SW interface index.
:type interface_dump_json: str
:type sw_if_index: int
- :return: Interface name.
+ :returns: Interface name.
:rtype: str
:raises ValueError: If interface not found in interface_dump_json.
"""
-# Copyright (c) 2017 Cisco and/or its affiliates.
+# Copyright (c) 2018 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
:returns: Content of response.
:rtype: bytearray
:raises HoneycombError: If the status code in response to PUT is not
- 200 = OK or 201 = ACCEPTED.
+ 200 = OK or 201 = ACCEPTED.
"""
if data is None:
:returns: Content of response.
:rtype: bytearray
:raises HoneycombError: If the status code in response to PUT is not
- 200 = OK or 201 = ACCEPTED.
+ 200 = OK or 201 = ACCEPTED.
"""
if data is None:
:param datastore: Get data from config or operational datastore.
:type node: dict
:type address: str
- :type datastore; str
+ :type datastore: str
:returns: BGP peer configuration data.
:rtype: dict
:raises HoneycombError: If the status code in response is not 200 = OK.
:param ref: Reference data to compare against.
:type data: dict
:type ref: dict
- :raises HoneycombError: If the tables do not match."""
+ :raises HoneycombError: If the tables do not match.
+ """
# Remove runtime attributes from data
for item in data:
-# Copyright (c) 2017 Cisco and/or its affiliates.
+# Copyright (c) 2018 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
:type node: dict
:type path: str
:type data: dict
- :return: Content of response.
+ :returns: Content of response.
:rtype: bytearray
:raises HoneycombError: If the status code in response is not
200 = OK or 201 = ACCEPTED.
-# Copyright (c) 2016 Cisco and/or its affiliates.
+# Copyright (c) 2018 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
:returns: Content of response.
:rtype: bytearray
:raises HoneycombError: If the status code in response to PUT is not
- 200 = OK.
+ 200 = OK.
"""
if data:
:type list_name: str
:type data: dict
:type macip: bool
-
:returns: Content of response.
:rtype: bytearray
:raises HoneycombError: If the operation fails.
:param interface: Name of an interface on the node.
:param acl_name: Name of an ACL chain configured through ACL-plugin.
:param direction: Classify incoming or outgiong packets.
- Valid options are: ingress, egress
+ Valid options are: ingress, egress
:param macip: Use simple MAC+IP classifier. Optional.
:type node: dict
:type interface: str or int
:type acl_name: str
:type direction: str
:type macip: bool
-
:returns: Content of response.
:rtype: bytearray
:raises ValueError: If the direction argument is incorrect.
-# Copyright (c) 2016 Cisco and/or its affiliates.
+# Copyright (c) 2018 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
:type bd_name: str
:type data: dict
:type data_representation: DataRepresentation
- :return: Content of response.
+ :returns: Content of response.
:rtype: bytearray
:raises HoneycombError: If the status code in response on PUT is not
- 200 = OK.
+ 200 = OK.
"""
status_code, resp = HcUtil.\
:param bd_name: The name of bridge domain.
:param path: Path to data we want to change, create or remove.
:param new_value: The new value to be set. If None, the item will be
- removed.
+ removed.
:type node: dict
:type bd_name: str
:type path: tuple
:type new_value: str, dict or list
- :return: Content of response.
+ :returns: Content of response.
:rtype: bytearray
:raises HoneycombError: If it is not possible to get or set the data.
"""
:param bd_name: Bridge domain name.
:param kwargs: Parameters and their values. The accepted parameters are
- defined in BridgeDomainKeywords.PARAMS.
+ defined in BridgeDomainKeywords.PARAMS.
:type bd_name: str
:type kwargs: dict
- :return: Bridge domain data structure.
+ :returns: Bridge domain data structure.
:rtype: dict
"""
:param node: Honeycomb node.
:type node: dict
- :return: Configuration data about all bridge domains from Honeycomb.
+ :returns: Configuration data about all bridge domains from Honeycomb.
:rtype: list
:raises HoneycombError: If it is not possible to get configuration data.
"""
:param bd_name: The name of bridge domain.
:type node: dict
:type bd_name: str
- :return: Configuration data about the given bridge domain from
- Honeycomb.
+ :returns: Configuration data about the given bridge domain from
+ Honeycomb.
:rtype: dict
"""
:param node: Honeycomb node.
:type node: dict
- :return: Operational data about all bridge domains from Honeycomb.
+ :returns: Operational data about all bridge domains from Honeycomb.
:rtype: list
:raises HoneycombError: If it is not possible to get operational data.
"""
:param bd_name: The name of bridge domain.
:type node: dict
:type bd_name: str
- :return: Operational data about the given bridge domain from Honeycomb.
+ :returns: Operational data about the given bridge domain from Honeycomb.
:rtype: dict
"""
:param node: Honeycomb node.
:param bd_name: Bridge domain name.
:param kwargs: Parameters and their values. The accepted parameters are
- defined in BridgeDomainKeywords.PARAMS
+ defined in BridgeDomainKeywords.PARAMS
:type node: dict
:type bd_name: str
:type kwargs: dict
- :return: Bridge domain data structure.
+ :returns: Bridge domain data structure.
:rtype: dict
"""
:param node: Honeycomb node.
:param bd_name: Bridge domain name.
:param kwargs: Parameters and their values. The accepted parameters are
- defined in BridgeDomainKeywords.PARAMS
+ defined in BridgeDomainKeywords.PARAMS
:type node: dict
:type bd_name: str
:type kwargs: dict
- :return: Bridge domain data structure.
+ :returns: Bridge domain data structure.
:rtype: dict
"""
:param node: Honeycomb node.
:type node: dict
- :return: Content of response.
+ :returns: Content of response.
:rtype: bytearray
:raises HoneycombError: If it is not possible to remove all bridge
- domains.
+ domains.
"""
data = {"bridge-domains": {"bridge-domain": []}}
:param bd_name: The name of bridge domain to be removed.
:type node: dict
:type bd_name: str
- :return: Content of response.
+ :returns: Content of response.
:rtype: bytearray
- :raises HoneycombError:If it is not possible to remove the bridge
- domain.
+ :raises HoneycombError: If it is not possible to remove the bridge
+ domain.
"""
path = ("bridge-domains", ("bridge-domain", "name", bd_name))
:param node: Honeycomb node.
:param bd_name: Bridge domain name.
:param param: Parameter to set, change or remove. The accepted
- parameters are defined in BridgeDomainKeywords.PARAMS
+ parameters are defined in BridgeDomainKeywords.PARAMS
:param value: The new value to be set, change or remove. If None, the
- item will be removed.
+ item will be removed.
:type node: dict
:type bd_name: str
:type param: str
:type value: str
- :return: Content of response.
+ :returns: Content of response.
:rtype: bytearray
"""
:type node: dict
:type bd_name: str
:type l2_fib_entry: dict
- :return: Content of response.
+ :returns: Content of response.
:rtype: bytearray
"""
:type mac: str
:type param: str
:type value: str or int
- :return: Content of response.
+ :returns: Content of response.
:rtype: bytearray
"""
:type node: dict
:type bd_name: str
:type mac: str
- :return: Content of response.
+ :returns: Content of response.
:rtype: bytearray
:raises HoneycombError: If it is not possible to remove the specified
- entry.
+ entry.
"""
path = ("bridge-domains",
:param bd_name: Bridge domain's name.
:type node: dict
:type bd_name: str
- :return: Content of response.
+ :returns: Content of response.
:rtype: bytearray
"""
:param bd_name: Bridge domain's name.
:type node: dict
:type bd_name: str
- :return: Bridge domain's L2 FIB table or empty list if the table does
- not exist or it is empty.
+ :returns: Bridge domain's L2 FIB table or empty list if the table does
+ not exist or it is empty.
:rtype: list
"""
:type node: dict
:type bd_name: str
:type mac: str
- :return: The requested entry from bridge domain's L2 FIB table or empty
- dictionary if it does not exist in the L2 FIB table.
+ :returns: The requested entry from bridge domain's L2 FIB table or empty
+ dictionary if it does not exist in the L2 FIB table.
:rtype: dict
"""
-# Copyright (c) 2017 Cisco and/or its affiliates.
+# Copyright (c) 2018 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
:returns: Content of response.
:rtype: bytearray
:raises HoneycombError: If the status code in response on PUT is not
- 200 = OK.
+ 200 = OK.
"""
status_code, resp = HcUtil.\
:param interface: The name of interface.
:param path: Path to data we want to change / create / remove.
:param new_value: The new value to be set. If None, the item will be
- removed.
+ removed.
:type node: dict
:type interface: str
:type path: tuple
:param node: Honeycomb node.
:param interface: Interface name, key, link name or sw_if_index.
:param state: The requested state, only "up" and "down" are valid
- values.
+ values.
:type node: dict
:type interface: str
:type state: str
:param interface: Interface name, key, link name or sw_if_index.
:type node: dict
:type interface: str or int
-
:raises HoneycombError: If the operation fails.
"""
:type node: dict
:type interface: str
:returns: Operational data about bridge domain settings in the
- interface.
+ interface.
:rtype: dict
"""
:param interface: The name of interface.
:param param: Parameter to configure (set, change, remove)
:param value: The value of parameter. If None, the parameter will be
- removed.
+ removed.
:type node: dict
:type interface: str
:type param: str
:param interface: The name of interface.
:param param: Parameter to configure (set, change, remove)
:param value: The value of parameter. If None, the parameter will be
- removed.
+ removed.
:type node: dict
:type interface: str
:type param: str
:param interface: The name of interface.
:param param: Parameter to configure (set, change, remove)
:param value: The value of parameter. If None, the parameter will be
- removed.
+ removed.
:type node: dict
:type interface: str
:type param: str
:param interface: The name of interface.
:param param: Parameter to configure (set, change, remove)
:param value: The value of parameter. If None, the parameter will be
- removed.
+ removed.
:type node: dict
:type interface: str
:type param: str
:param interface: The name of interface.
:param param: Parameter to configure (set, change, remove)
:param value: The value of parameter. If None, the parameter will be
- removed.
+ removed.
:type node: dict
:type interface: str
:type param: str
:param node: Honeycomb node.
:param interface: The name of interface.
:param kwargs: Parameters and their values. The accepted parameters are
- defined in InterfaceKeywords.VXLAN_PARAMS.
+ defined in InterfaceKeywords.VXLAN_PARAMS.
:type node: dict
:type interface: str
:type kwargs: dict
:returns: Content of response.
:rtype: bytearray
:raises HoneycombError: If it is not possible to get information about
- interfaces or it is not possible to delete the interface.
+ interfaces or it is not possible to delete the interface.
"""
path = ("interfaces", ("interface", "name", interface))
:param node: Honeycomb node.
:param interface: The name of interface.
:param kwargs: Parameters and their values. The accepted parameters are
- defined in InterfaceKeywords.VXLAN_PARAMS.
+ defined in InterfaceKeywords.VXLAN_PARAMS.
:type node: dict
:type interface: str
:type kwargs: dict
:param interface: The name of interface.
:param param: Parameter to configure (set, change, remove)
:param value: The value of parameter. If None, the parameter will be
- removed.
+ removed.
:type node: dict
:type interface: str
:type param: str
:param node: Honeycomb node.
:param interface: The name of interface.
:param kwargs: Parameters and their values. The accepted parameters are
- defined in InterfaceKeywords.TAP_PARAMS.
+ defined in InterfaceKeywords.TAP_PARAMS.
:type node: dict
:type interface: str
:type kwargs: dict
:param node: Honeycomb node.
:param interface: The name of interface.
:param kwargs: Parameters and their values. The accepted parameters are
- defined in InterfaceKeywords.TAP_PARAMS.
+ defined in InterfaceKeywords.TAP_PARAMS.
:type node: dict
:type interface: str
:type kwargs: dict
:param node: Honeycomb node.
:param interface: The name of interface.
:param kwargs: Parameters and their values. The accepted parameters are
- defined in InterfaceKeywords.VHOST_USER_PARAMS.
+ defined in InterfaceKeywords.VHOST_USER_PARAMS.
:type node: dict
:type interface: str
:type kwargs: dict
:param node: Honeycomb node.
:param interface: The name of interface.
:param kwargs: Parameters and their values. The accepted parameters are
- defined in InterfaceKeywords.VHOST_USER_PARAMS.
+ defined in InterfaceKeywords.VHOST_USER_PARAMS.
:type node: dict
:type interface: str
:type kwargs: dict
:param node: Honeycomb node.
:param super_interface: Super interface.
:param match: Match type. The valid values are defined in
- InterfaceKeywords.SUB_IF_MATCH.
+ InterfaceKeywords.SUB_IF_MATCH.
:param tags: List of tags.
:param kwargs: Parameters and their values. The accepted parameters are
- defined in InterfaceKeywords.SUB_IF_PARAMS.
+ defined in InterfaceKeywords.SUB_IF_PARAMS.
:type node: dict
:type super_interface: str
:type match: str
:param data: Data to be checked.
:param ref: Referential data used for comparison.
:param _path: Used in recursive calls, stores the path taken down
- the JSON tree.
+ the JSON tree.
:type data: dict
:type ref: dict
:type _path: str
:raises HoneycombError: If the data structures do not match in some way,
- or if they are not in deserialized JSON format.
+ or if they are not in deserialized JSON format.
"""
if data == ref:
:param node: Honeycomb node.
:param interface: The name of interface to be created.
:param kwargs: Parameters and their values. The accepted parameters are
- defined in InterfaceKeywords.VXLAN_GPE_PARAMS.
+ defined in InterfaceKeywords.VXLAN_GPE_PARAMS.
:type node: dict
:type interface: str
:type kwargs: dict
:returns: Content of response.
:rtype: bytearray
:raises HoneycombError: If the configuration of interface is not
- successful.
+ successful.
"""
interface = interface.replace("/", "%2F")
:returns: Content of response.
:rtype: bytearray
:raises HoneycombError: If the configuration of interface is not
- successful.
+ successful.
"""
interface = Topology.convert_interface_reference(
node, interface, "name")
:returns: Content of response.
:rtype: bytearray
:raises HoneycombError: If the configuration of interface is not
- successful.
+ successful.
"""
interface = Topology.convert_interface_reference(
node, interface, "name")
:returns: Content of response.
:rtype: bytearray
:raises HoneycombError: If the configuration of interface is not
- successful.
+ successful.
"""
interface = interface.replace("/", "%2F")
:param node: Honeycomb node.
:param intf: The interface where PBB sub-interface will be configured.
:param params: Configuration parameters of the sub-interface to be
- created.
+ created.
:type node: dict
:type intf: str
:type params: dict
:returns: Content of response.
:rtype: bytearray
:raises HoneycombError: If the configuration of sub-interface is not
- successful.
+ successful.
"""
interface = intf.replace("/", "%2F")
:returns: Content of response.
:rtype: bytearray
:raises HoneycombError: If the removal of sub-interface is not
- successful.
+ successful.
"""
interface = intf.replace("/", "%2F")
:returns: PBB sub-interface operational data.
:rtype: dict
:raises HoneycombError: If the removal of sub-interface is not
- successful.
+ successful.
"""
raise NotImplementedError
:returns: True if the interface exists in disabled interfaces.
:rtype: bool
:raises HoneycombError: If the interface is not present
- in retrieved list of disabled interfaces.
- """
+ in retrieved list of disabled interfaces.
+ """
data = InterfaceKeywords.get_disabled_interfaces_oper_data(node)
# decrement by one = conversion from HC if-index to VPP sw_if_index
interface -= 1
:param node: Honeycomb node.
:param super_interface: Name, link name or sw_if_index
- of the destination interface's super-interface.
+ of the destination interface's super-interface.
:param dst_interface_index: Index of sub-interface to mirror packets to.
:param src_interfaces: List of interfaces to mirror packets from.
:type node: dict
:param node: Honeycomb node.
:param interface: Name, link name or sw_if_index of an interface,
- name of a custom interface or name of a sub-interface.
+ name of a custom interface or name of a sub-interface.
:type node: Honeycomb node.
:type interface: str or int
:returns: Name of interface that can be used in Honeycomb requests.
-# Copyright (c) 2016 Cisco and/or its affiliates.
+# Copyright (c) 2018 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
:type node: dict
:type path: str
:type data: dict
- :return: Content of response.
+ :returns: Content of response.
:rtype: bytearray
:raises HoneycombError: If the status code in response to PUT is not
- OK or ACCEPTED.
+ OK or ACCEPTED.
"""
if data:
:type node: dict
:type name: str
:type data: dict
- :return: Content of response.
+ :returns: Content of response.
:rtype: bytearray
"""
:type node: dict
:type name: str
:type data: dict
- :return: Content of response.
+ :returns: Content of response.
:rtype: bytearray
"""
path = "/nsh-maps/nsh-map/{0}".format(name)
:param name: Name of the NSH entry.
:type node: dict
:type name: str
- :return: Content of response.
+ :returns: Content of response.
:rtype: bytearray
"""
:param name: Name of the NSH map.
:type node: dict
:type name: str
- :return: Content of response.
+ :returns: Content of response.
:rtype: bytearray
"""
:param node: Honeycomb node.
:param entry_name: Name of a specific NSH entry. Optional.
:param map_name: Name of a specific NSH map. Optional. Do not use
- together with entry_name.
+ together with entry_name.
:type node: dict
:type entry_name: str
:type map_name: str
- :return: List of classify tables.
+ :returns: List of classify tables.
:rtype: list
"""
if entry_name:
:param node: Honeycomb node.
:type node: dict
- :return: Content of response.
+ :returns: Content of response.
:rtype: bytearray
"""
-# Copyright (c) 2016 Cisco and/or its affiliates.
+# Copyright (c) 2018 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
:type find: string
:type replace: string
:raises HoneycombError: If persistent configuration couldn't be
- modified.
+ modified.
"""
argument = "\"s/{0}/{1}/g\"".format(find, replace)
-# Copyright (c) 2017 Cisco and/or its affiliates.
+# Copyright (c) 2018 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
Honeycomb is up and running.
Honeycomb must be installed in "/opt" directory, otherwise the start
will fail.
+
:param nodes: List of nodes to start Honeycomb on.
:type nodes: list
:raises HoneycombError: If Honeycomb fails to start.
stops the Honeycomb and does not check its shutdown state. Use the
keyword "Check Honeycomb Shutdown State" to check if Honeycomb has
stopped.
+
:param nodes: List of nodes to stop Honeycomb on.
:type nodes: list
:raises HoneycombError: If Honeycomb failed to stop.
:type retries: int
:type interval: int
:raises HoneycombError: If the Honeycomb process IP cannot be found,
- or if timeout or number of retries is exceeded."""
+ or if timeout or number of retries is exceeded.
+ """
ssh = SSH()
ssh.connect(node)
:param node: List of DUT nodes stopping Honeycomb.
:type node: dict
- :return: True if all GETs fail to connect.
- :rtype bool
+ :returns: True if all GETs fail to connect.
+ :rtype: bool
"""
cmd = "pgrep honeycomb"
"""Configure Honeycomb to accept restconf requests from all IP
addresses. IP version is determined by node data.
- :param node: Information about a DUT node.
- :type node: dict
- :raises HoneycombError: If the configuration could not be changed.
- """
+ :param node: Information about a DUT node.
+ :type node: dict
+ :raises HoneycombError: If the configuration could not be changed.
+ """
find = "restconf-binding-address"
try:
def configure_jvpp_timeout(node, timeout=10):
"""Configure timeout value for Java API commands Honeycomb sends to VPP.
- :param node: Information about a DUT node.
- :param timeout: Timeout value in seconds.
- :type node: dict
- :type timeout: int
- :raises HoneycombError: If the configuration could not be changed.
- """
+ :param node: Information about a DUT node.
+ :param timeout: Timeout value in seconds.
+ :type node: dict
+ :type timeout: int
+ :raises HoneycombError: If the configuration could not be changed.
+ """
find = "jvpp-request-timeout"
replace = '\\"jvpp-request-timeout\\": {0}'.format(timeout)
:type feature: string
:type disable: bool
:raises HoneycombError: If the configuration could not be changed.
- """
+ """
disabled_features = {
"NSH": ["io.fd.hc2vpp.vppnsh.impl.VppNshModule"],
Karaf should be located in the provided path, and VPP and Honeycomb
should already be running, otherwise the start will fail.
+
:param node: Node to start ODL client on.
:param path: Path to ODL client on node.
:type node: dict
def apply_config(self, node):
"""Generate configuration file /opt/honeycomb/honeycomb on the specified
- node.
+ node.
- :param node: Honeycomb node.
- :type node: dict
- """
+ :param node: Honeycomb node.
+ :type node: dict
+ """
self.ssh.connect(node)
_, filename, _ = self.ssh.exec_command("ls /opt/honeycomb | grep .jar")
:param mem_min: Minimum amount of memory (MB).
:param mem_max: Maximum amount of memory (MB). Default is 4 times
- minimum value.
+ minimum value.
:type mem_min: int
:type mem_max: int
"""
:param mem_min: Minimum metaspace size (MB).
:param mem_max: Maximum metaspace size (MB). Defailt is 4 times
- minimum value.
+ minimum value.
:type mem_min: int
:type mem_max: int
"""
-# Copyright (c) 2016 Cisco and/or its affiliates.
+# Copyright (c) 2018 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
When raising this exception, put this information to the message in this
order:
+
- short description of the encountered problem (parameter msg),
- relevant messages if there are any collected, e.g., from caught
exception (optional parameter details),
- relevant data if there are any collected (optional parameter details).
- The logging is performed on two levels: 1. error - short description of the
- problem; 2. debug - detailed information.
+
+ The logging is performed on two levels: 1. error - short description of the
+ problem; 2. debug - detailed information.
"""
def __init__(self, msg, details='', enable_logging=True):
:param msg: Message to be displayed and logged.
:param enable_logging: When True, logging is enabled, otherwise
- logging is disabled.
+ logging is disabled.
:type msg: str
:type enable_logging: bool
"""
structure.
There are also two supportive methods implemented:
- - read_path_from_url_file which reads URL file and returns a path (see
- docs/honeycomb_url_files.rst).
- - parse_json_response which parses data from response in JSON representation
- according to given path.
+
+ - read_path_from_url_file which reads URL file and returns a path (see
+ docs/honeycomb_url_files.rst).
+ - parse_json_response which parses data from response in JSON
+ representation according to given path.
"""
def __init__(self):
@staticmethod
def read_path_from_url_file(url_file):
- """Read path from *.url file.
+ """Read path from .url file.
+
+ For more information about .url file see docs/honeycomb_url_files.rst
- For more information about *.url file see docs/honeycomb_url_files.rst
:param url_file: URL file. The argument contains only the name of file
- without extension, not the full path.
+ without extension, not the full path.
:type url_file: str
:returns: Requested path.
:rtype: str
Path format:
The path is a tuple with items navigating to requested data. The items
can be strings or tuples:
- - string item represents a dictionary key in data,
- - tuple item represents list item in data.
-
- Example:
- data = \
- {
- "interfaces": {
- "interface": [
- {
- "name": "GigabitEthernet0/8/0",
- "enabled": "true",
- "type": "iana-if-type:ethernetCsmacd",
- },
- {
- "name": "local0",
- "enabled": "false",
- "type": "iana-if-type:ethernetCsmacd",
- }
- ]
- }
- }
+
+ - string item represents a dictionary key in data,
+ - tuple item represents list item in data.
+
+ Example::
+
+ data = \
+ {
+ "interfaces": {
+ "interface": [
+ {
+ "name": "GigabitEthernet0/8/0",
+ "enabled": "true",
+ "type": "iana-if-type:ethernetCsmacd",
+ },
+ {
+ "name": "local0",
+ "enabled": "false",
+ "type": "iana-if-type:ethernetCsmacd",
+ }
+ ]
+ }
+ }
path = ("interfaces", ("interface", "name", "local0"), "enabled")
This path points to "false".
- The tuple ("interface", "name", "local0") consists of:
- index 0 - dictionary key pointing to a list,
- index 1 - key which identifies an item in the list, it is also marked as
- the key in corresponding yang file.
- index 2 - key value.
+ The tuple ("interface", "name", "local0") consists of::
+
+ index 0 - dictionary key pointing to a list,
+ index 1 - key which identifies an item in the list, it is also marked
+ as the key in corresponding yang file.
+ index 2 - key value.
:param data: Data received from Honeycomb REST API.
:param path: Path to data we want to find.
:param node: Honeycomb node.
:param url_file: URL file. The argument contains only the name of file
- without extension, not the full path.
+ without extension, not the full path.
:param path: Path which is added to the base path to identify the data.
:type node: dict
:type url_file: str
:type path: str
:returns: Status code and content of response.
- :rtype tuple
+ :rtype: tuple
"""
base_path = HoneycombUtil.read_path_from_url_file(url_file)
:param node: Honeycomb node.
:param url_file: URL file. The argument contains only the name of file
- without extension, not the full path.
+ without extension, not the full path.
:param data: Configuration data to be sent to Honeycomb.
:param path: Path which is added to the base path to identify the data.
:param data_representation: How the data is represented.
:returns: Status code and content of response.
:rtype: tuple
:raises HoneycombError: If the given data representation is not defined
- in HEADERS.
+ in HEADERS.
"""
try:
:param node: Honeycomb node.
:param url_file: URL file. The argument contains only the name of file
- without extension, not the full path.
+ without extension, not the full path.
:param data: Configuration data to be sent to Honeycomb.
:param data_representation: How the data is represented.
:param timeout: How long to wait for the server to send data before
- giving up.
+ giving up.
:type node: dict
:type url_file: str
:type data: dict, str
:returns: Status code and content of response.
:rtype: tuple
:raises HoneycombError: If the given data representation is not defined
- in HEADERS.
+ in HEADERS.
"""
try:
:param node: Honeycomb node.
:param url_file: URL file. The argument contains only the name of file
- without extension, not the full path.
+ without extension, not the full path.
:param path: Path which is added to the base path to identify the data.
:type node: dict
:type url_file: str
:type path: str
:returns: Status code and content of response.
- :rtype tuple
+ :rtype: tuple
"""
base_path = HoneycombUtil.read_path_from_url_file(url_file)
:param node: Honeycomb node.
:param suite_name: Name of the current test suite. ${SUITE_NAME}
- variable in robotframework.
+ variable in robotframework.
:type node: dict
:type suite_name: str
"""
"""Delete the Honeycomb log file for the current test suite.
:param node: Honeycomb node.
- :type node: dict"""
+ :type node: dict
+ """
ssh = SSH()
ssh.connect(node)
-# Copyright (c) 2017 Cisco and/or its affiliates.
+# Copyright (c) 2018 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
:returns: Content of response.
:rtype: bytearray
:raises HoneycombError: If the status code in response to PUT is not
- 200 = OK or 201 = ACCEPTED.
+ 200 = OK or 201 = ACCEPTED.
"""
if data:
:returns: Content of response.
:rtype: bytearray
:raises HoneycombError: If the return code is not 200:OK
- or 404:NOT FOUND.
+ or 404:NOT FOUND.
"""
ret_code, data = HcUtil.get_honeycomb_data(node, "config_lisp")
:param interface: An interface on the node.
:param locator_set: Name for the new locator set.
:param priority: Priority parameter for the locator.
- :param weight. Weight parameter for the locator.
+ :param weight: Weight parameter for the locator.
:type node: dict
:type interface: str
:type locator_set: str
:returns: Content of response.
:rtype: bytearray
:raises HoneycombError: If the status code in response to PUT is not
- 200 = OK or 201 = ACCEPTED.
+ 200 = OK or 201 = ACCEPTED.
"""
if data:
:returns: LISP GPE operational data.
:rtype: bytearray
:raises HoneycombError: If the status code in response to GET is not
- 200 = OK.
+ 200 = OK.
"""
status_code, resp = HcUtil.get_honeycomb_data(node, "oper_lisp_gpe")
:returns: LISP GPE mapping.
:rtype: dict
:raises HoneycombError: If the mapping is not present in operational
- data.
+ data.
"""
data = LispGPEKeywords.get_lispgpe_operational_data(node)
:returns: LISP GPE config data.
:rtype: bytearray
:raises HoneycombError: If the status code in response to GET is not
- 200 = OK.
+ 200 = OK.
"""
status_code, resp = HcUtil.get_honeycomb_data(node, "config_lisp_gpe")
:returns: Content of response.
:rtype: bytearray
:raises HoneycombError: If the return code is not 200:OK
- or 404:NOT FOUND.
+ or 404:NOT FOUND.
"""
ret_code, data = HcUtil.get_honeycomb_data(node, "config_lisp_gpe")
-# Copyright (c) 2016 Cisco and/or its affiliates.
+# Copyright (c) 2018 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
:returns: Content of response.
:rtype: bytearray
:raises HoneycombError: If the status code in response to PUT is not
- OK or ACCEPTED.
+ OK or ACCEPTED.
"""
if data:
:returns: Content of response.
:rtype: bytearray
:raises HoneycombError: If the operation fails or the response
- is not as expected.
+ is not as expected.
"""
status_code, resp = HcUtil.get_honeycomb_data(node, "oper_nat")
-# Copyright (c) 2016 Cisco and/or its affiliates.
+# Copyright (c) 2018 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
:param size: Maximum number of bytes to read in one iteration.
:param time_out: Timeout value for getting the complete response.
:param err: Error message to provide when timeout is reached.
- :type size:int
- :type time_out:int
- :type err:str
+ :type size: int
+ :type time_out: int
+ :type err: str
:returns: Content of response.
:rtype: str
:raises HoneycombError: If the read process times out.
def get_all_responses(self, size=4096, time_out=3):
"""Read responses from the receive buffer and catenate together
- until a read operation times out.
+ until a read operation times out.
:param size: Maximum number of bytes to read in one iteration.
:param time_out: Timeout value for getting the complete response.
- :type size:int
- :type time_out:int
+ :type size: int
+ :type time_out: int
:returns: Content of response.
:rtype: str
"""
-# Copyright (c) 2016 Cisco and/or its affiliates.
+# Copyright (c) 2018 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
:param time_out: Timeout value for the read operation in seconds.
:type time_out: int
- :return: Data received from buffer.
+ :returns: Data received from buffer.
:rtype: str
"""
-# Copyright (c) 2017 Cisco and/or its affiliates.
+# Copyright (c) 2018 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
:param script: Name of the script to execute.
:param cores: Number of processor cores to use.
:param reserved: Number of cores reserved for other tasks. Default is 2,
- one for system tasks and one for VPP main thread.
+ one for system tasks and one for VPP main thread.
:param args: Sequential arguments for the script.
:param kwargs: Named arguments for the script.
:type node: dict
-# Copyright (c) 2017 Cisco and/or its affiliates.
+# Copyright (c) 2018 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
:returns: Content of response.
:rtype: bytearray
:raises HoneycombError: If the status code in response to PUT is not
- 200 = OK or 201 = ACCEPTED.
+ 200 = OK or 201 = ACCEPTED.
"""
data = {
:type state: str
:raises ValueError: If the state argument is incorrect.
:raises HoneycombError: If the status code in response is not
- 200 = OK or 201 = ACCEPTED.
+ 200 = OK or 201 = ACCEPTED.
"""
interface = Topology.convert_interface_reference(
:param node: Honeycomb node.
:param interface: Name of an interface on the node.
:param addresses: IPv6 addresses to configure ND proxy with. If no
- address is provided, ND proxy configuration will be removed.
+ address is provided, ND proxy configuration will be removed.
:type node: dict
:type interface: str
:type addresses: list
-# Copyright (c) 2017 Cisco and/or its affiliates.
+# Copyright (c) 2018 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
:type node: dict
:type path: str
:type data: dict
- :return: Content of response.
+ :returns: Content of response.
:rtype: bytearray
:raises HoneycombError: If the status code in response is not
200 = OK.
-# Copyright (c) 2016 Cisco and/or its affiliates.
+# Copyright (c) 2018 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
:param json_data: Data in JSON format.
:type json_data: str
- :return: JSON data parsed as python list.
+ :returns: JSON data parsed as python list.
:rtype: list
"""
if "4.2.0-42-generic" in uname():
:param json_file: File with JSON type data.
:type json_file: str
- :return: JSON data parsed as python list.
+ :returns: JSON data parsed as python list.
:rtype: list
"""
input_data = open(json_file).read()
-# Copyright (c) 2016 Cisco and/or its affiliates.
+# Copyright (c) 2018 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
:param node: Node in topology.
:type node: dict
- :return: IP address and port for the specified node.
+ :returns: IP address and port for the specified node.
:rtype: int
"""
:param cmd: Command to be executed.
:param cmd_input: Input redirected to the command.
:param timeout: Timeout.
- :return: return_code, stdout, stderr
+ :returns: return_code, stdout, stderr
:Example:
:type lxc_params: str
:type sudo: bool
:type timeout: int
- :return: return_code, stdout, stderr
+ :returns: return_code, stdout, stderr
"""
command = "lxc-attach {p} --name {n} -- /bin/sh -c '{c}'"\
.format(p=lxc_params, n=lxc_name, c=lxc_cmd)
"""Open interactive terminal on a new channel on the connected Node.
:param time_out: Timeout in seconds.
- :return: SSH channel with opened terminal.
+ :returns: SSH channel with opened terminal.
.. warning:: Interruptingcow is used here, and it uses
signal(SIGALRM) to let the operating system interrupt program
:param cmd: Command to be executed.
:param prompt: Command prompt, sequence of characters used to
indicate readiness to accept commands.
- :return: Command output.
+ :returns: Command output.
.. warning:: Interruptingcow is used here, and it uses
signal(SIGALRM) to let the operating system interrupt program
:param node: Node to start HTTP server on.
:param prealloc_fifos: Max number of connections you expect to handle at
- one time.
+ one time.
:param fifo_size: FIFO size in kB.
:param private_segment_size: Private segment size. Number + unit.
:type node: dict
-# Copyright (c) 2016 Cisco and/or its affiliates.
+# Copyright (c) 2018 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
:param node: DUT node.
:param domain: Desired index number of exporting domain.
:param src_port: Source port to use when sending IPFIX packets. Default
- is the standard IPFIX port 4739.
+ is the standard IPFIX port 4739.
:type node: dict
:type domain: int
:type src_port: int
@staticmethod
def assign_classify_table_to_exporter(node, table_id, ip_version='ip4'):
"""Assign a classify table to an IPFIX exporter. Classified packets will
- be included in the IPFIX flow report.
-
- :param node: DUT node.
- :param table_id: ID of a classify table.
- :param ip_version: Version of IP protocol. Valid options are ip4, ip6.
- :type node: dict
- :type table_id: int
- :type ip_version: str
- """
+ be included in the IPFIX flow report.
+
+ :param node: DUT node.
+ :param table_id: ID of a classify table.
+ :param ip_version: Version of IP protocol. Valid options are ip4, ip6.
+ :type node: dict
+ :type table_id: int
+ :type ip_version: str
+ """
with VatTerminal(node, json_param=False) as vat:
vat.vat_terminal_exec_cmd_from_template("ipfix_table_add.vat",
-# Copyright (c) 2016 Cisco and/or its affiliates.
+# Copyright (c) 2018 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
:param node: DUT node.
:type node: dict
:returns: Full SPAN configuration as list. One list entry for every
- source/destination interface pair.
+ source/destination interface pair.
:rtype: list of dict
"""
:type dst_interface: str or int
:type ret_format: string
:returns: List of SPAN source interfaces for the provided destination
- interface.
+ interface.
:rtype: list
"""
"Active topology" contains initially data from the topology file and can be
extended with additional data from the DUTs like internal interface indexes
or names. Additional data which can be filled to the active topology are
+
- additional internal representation (index, name, ...)
- operational data (dynamic ports)
:param node: The node topology directory.
:param link_names: List of names of the link that a interface is
- connected to.
+ connected to.
:type node: dict
:type link_names: list
:returns: Dictionary of interface names that are connected to the given
- links.
+ links.
:rtype: dict
"""
retval = {}
:param node: Node in topology.
:param interface: Name, sw_if_index, link name or key of an interface
- on the node.
- Valid formats are: sw_if_index, key, name.
+ on the node.
:type node: dict
:type interface: str or int
:param node: Node in topology.
:param interface: Name, sw_if_index, link name or key of an interface
- on the node.
+ on the node.
:param wanted_format: Format of return value wanted.
- Valid options are: sw_if_index, key, name.
+ Valid options are: sw_if_index, key, name.
:type node: dict
:type interface: str or int
:type wanted_format: str
-
:returns: Interface name, interface key or sw_if_index.
:rtype: str or int
-
:raises TypeError, ValueError: If provided with invalid arguments.
:raises RuntimeError: If the interface does not exist in topology.
"""
on local network.
:param nodes_info: Dictionary containing information on all nodes
- in topology.
+ in topology.
:param node: Node that contains specified interface.
:param iface_key: Interface key from topology file.
:type nodes_info: dict
:type node2: dict
:returns: Name of link connecting the two nodes together.
:rtype: str
- :raises: RuntimeError
+ :raises RuntimeError: If no links are found.
"""
connecting_links = self.get_active_connecting_links(node1, node2)
if len(connecting_links) == 0: