From ff1f49d9ba97ddfee3229907e3a344503e072578 Mon Sep 17 00:00:00 2001 From: Jan Gelety Date: Thu, 6 Aug 2020 03:34:31 +0200 Subject: Perf: NAT44 endpoint-dependent mode - udp, part I - continuation of https://gerrit.fd.io/r/c/csit/+/26898 as there was reached limit of changes (1000) Jira: CSIT-1711 - udp synthetic profiles w/o data packets - udp cps perf tests, phase I (no special "search cps" KW) Part I means that we are using MRR tests to collect traffic data until there is ready new CPS test type with corresponding algorithm. Change-Id: I0d30feb9ecf1d0bff937152656f8eb422f831378 Signed-off-by: Jan Gelety --- resources/libraries/python/Constants.py | 6 +- resources/libraries/python/IPUtil.py | 18 +++ resources/libraries/python/NATUtil.py | 148 ++++++++++++++----- resources/libraries/python/TrafficGenerator.py | 77 ++++++++-- resources/libraries/python/VppConfigGenerator.py | 13 +- resources/libraries/robot/ip/ip4.robot | 13 +- resources/libraries/robot/ip/nat.robot | 127 ++++++++--------- .../robot/performance/performance_limits.robot | 88 +++++++++--- .../robot/performance/performance_utils.robot | 158 +++++++++++++-------- resources/libraries/robot/shared/default.robot | 101 ++++++++----- .../libraries/robot/shared/test_teardown.robot | 11 ++ 11 files changed, 525 insertions(+), 235 deletions(-) (limited to 'resources/libraries') diff --git a/resources/libraries/python/Constants.py b/resources/libraries/python/Constants.py index 90d60ad4e2..73d8b63a0b 100644 --- a/resources/libraries/python/Constants.py +++ b/resources/libraries/python/Constants.py @@ -187,13 +187,17 @@ class Constants: # TRex install directory TREX_INSTALL_DIR = u"/opt/trex-core-2.73" + # TODO: Find the right way how to use it in trex profiles + # TRex pcap files directory + TREX_PCAP_DIR = f"{TREX_INSTALL_DIR}/scripts/avl" + # TRex limit memory. TREX_LIMIT_MEMORY = get_int_from_env(u"TREX_LIMIT_MEMORY", 8192) # TRex number of cores TREX_CORE_COUNT = get_int_from_env(u"TREX_CORE_COUNT", 7) - # Trex force start regardles ports state + # Trex force start regardless ports state TREX_SEND_FORCE = get_pessimistic_bool_from_env(u"TREX_SEND_FORCE") # TRex extra commandline arguments diff --git a/resources/libraries/python/IPUtil.py b/resources/libraries/python/IPUtil.py index 946f2f7b72..10a231f9df 100644 --- a/resources/libraries/python/IPUtil.py +++ b/resources/libraries/python/IPUtil.py @@ -139,6 +139,24 @@ class IPUtil: PapiSocketExecutor.run_cli_cmd(node, u"show ip6 fib") PapiSocketExecutor.run_cli_cmd(node, u"show ip6 fib summary") + @staticmethod + def vpp_get_ip_table_summary(node): + """Get IPv4 FIB table summary on a VPP node. + + :param node: VPP node. + :type node: dict + """ + PapiSocketExecutor.run_cli_cmd(node, u"show ip fib summary") + + @staticmethod + def vpp_get_ip_table(node): + """Get IPv4 FIB table on a VPP node. + + :param node: VPP node. + :type node: dict + """ + PapiSocketExecutor.run_cli_cmd(node, u"show ip fib") + @staticmethod def vpp_get_ip_tables_prefix(node, address): """Get dump of all IP FIB tables on a VPP node. diff --git a/resources/libraries/python/NATUtil.py b/resources/libraries/python/NATUtil.py index 2d5c1c7b76..b43058b23f 100644 --- a/resources/libraries/python/NATUtil.py +++ b/resources/libraries/python/NATUtil.py @@ -1,4 +1,4 @@ -# Copyright (c) 2019 Cisco and/or its affiliates. +# Copyright (c) 2020 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: @@ -14,16 +14,17 @@ """NAT utilities library.""" from pprint import pformat -from socket import AF_INET, inet_pton from enum import IntEnum +from ipaddress import IPv4Address from robot.api import logger +from resources.libraries.python.Constants import Constants from resources.libraries.python.InterfaceUtil import InterfaceUtil from resources.libraries.python.PapiExecutor import PapiSocketExecutor -class NATConfigFlags(IntEnum): +class NatConfigFlags(IntEnum): """Common NAT plugin APIs""" NAT_IS_NONE = 0x00 NAT_IS_TWICE_NAT = 0x01 @@ -36,6 +37,13 @@ class NATConfigFlags(IntEnum): NAT_IS_EXT_HOST_VALID = 0x80 +class NatAddrPortAllocAlg(IntEnum): + """NAT Address and port assignment algorithms.""" + NAT_ALLOC_ALG_DEFAULT = 0 + NAT_ALLOC_ALG_MAP_E = 1 + NAT_ALLOC_ALG_PORT_RANGE = 2 + + class NATUtil: """This class defines the methods to set NAT.""" @@ -43,41 +51,42 @@ class NATUtil: pass @staticmethod - def set_nat44_interfaces(node, int_in, int_out): + def set_nat44_interface(node, interface, flag): """Set inside and outside interfaces for NAT44. :param node: DUT node. - :param int_in: Inside interface. - :param int_out: Outside interface. + :param interface: Inside interface. + :param flag: Interface NAT configuration flag name. :type node: dict - :type int_in: str - :type int_out: str + :type interface: str + :type flag: str """ cmd = u"nat44_interface_add_del_feature" - int_in_idx = InterfaceUtil.get_sw_if_index(node, int_in) - err_msg = f"Failed to set inside interface {int_in} for NAT44 " \ + err_msg = f"Failed to set {flag} interface {interface} for NAT44 " \ f"on host {node[u'host']}" args_in = dict( - sw_if_index=int_in_idx, + sw_if_index=InterfaceUtil.get_sw_if_index(node, interface), is_add=1, - flags=getattr(NATConfigFlags, u"NAT_IS_INSIDE").value + flags=getattr(NatConfigFlags, flag).value ) with PapiSocketExecutor(node) as papi_exec: papi_exec.add(cmd, **args_in).get_reply(err_msg) - int_out_idx = InterfaceUtil.get_sw_if_index(node, int_out) - err_msg = f"Failed to set outside interface {int_out} for NAT44 " \ - f"on host {node[u'host']}" - args_in = dict( - sw_if_index=int_out_idx, - is_add=1, - flags=getattr(NATConfigFlags, u"NAT_IS_OUTSIDE").value - ) + @staticmethod + def set_nat44_interfaces(node, int_in, int_out): + """Set inside and outside interfaces for NAT44. - with PapiSocketExecutor(node) as papi_exec: - papi_exec.add(cmd, **args_in).get_reply(err_msg) + :param node: DUT node. + :param int_in: Inside interface. + :param int_out: Outside interface. + :type node: dict + :type int_in: str + :type int_out: str + """ + NATUtil.set_nat44_interface(node, int_in, u"NAT_IS_INSIDE") + NATUtil.set_nat44_interface(node, int_out, u"NAT_IS_OUTSIDE") @staticmethod def set_nat44_deterministic(node, ip_in, subnet_in, ip_out, subnet_out): @@ -99,9 +108,9 @@ class NATUtil: f"on host {node[u'host']}" args_in = dict( is_add=True, - in_addr=inet_pton(AF_INET, str(ip_in)), + in_addr=IPv4Address(str(ip_in)).packed, in_plen=int(subnet_in), - out_addr=inet_pton(AF_INET, str(ip_out)), + out_addr=IPv4Address(str(ip_out)).packed, out_plen=int(subnet_out) ) @@ -109,26 +118,76 @@ class NATUtil: papi_exec.add(cmd, **args_in).get_reply(err_msg) @staticmethod - def show_nat(node): - """Show the NAT configuration and data. + def set_nat44_address_range( + node, start_ip, end_ip, vrf_id=Constants.BITWISE_NON_ZERO, + flag=u"NAT_IS_NONE"): + """Set NAT44 address range. + + :param node: DUT node. + :param start_ip: IP range start. + :param end_ip: IP range end. + :param vrf_id: VRF index (Optional). + :param flag: NAT flag name. + :type node: dict + :type start_ip: str + :type end_ip: str + :type vrf_id: int + :type flag: str + """ + cmd = u"nat44_add_del_address_range" + err_msg = f"Failed to set NAT44 address range on host {node[u'host']}" + args_in = dict( + is_add=True, + first_ip_address=IPv4Address(str(start_ip)).packed, + last_ip_address=IPv4Address(str(end_ip)).packed, + vrf_id=vrf_id, + flags=getattr(NatConfigFlags, flag).value + ) + + with PapiSocketExecutor(node) as papi_exec: + papi_exec.add(cmd, **args_in).get_reply(err_msg) + + @staticmethod + def show_nat_config(node): + """Show the NAT configuration. + + :param node: DUT node. + :type node: dict + """ + cmd = u"nat_show_config" + err_msg = f"Failed to get NAT configuration on host {node[u'host']}" + + with PapiSocketExecutor(node) as papi_exec: + reply = papi_exec.add(cmd).get_reply(err_msg) + + logger.debug(f"NAT Configuration:\n{pformat(reply)}") + + @staticmethod + def show_nat44_summary(node): + """Show NAT44 summary on the specified topology node. + + :param node: Topology node. + :type node: dict + """ + PapiSocketExecutor.run_cli_cmd(node, u"show nat44 summary") + + @staticmethod + def show_nat_base_data(node): + """Show the NAT base data. Used data sources: - nat_show_config nat_worker_dump nat44_interface_addr_dump nat44_address_dump nat44_static_mapping_dump - nat44_user_dump nat44_interface_dump - nat44_user_session_dump - nat_det_map_dump :param node: DUT node. :type node: dict """ cmd = u"nat_show_config" - err_msg = f"Failed to get NAT configuration on host {node[u'host']}" + err_msg = f"Failed to get NAT base data on host {node[u'host']}" with PapiSocketExecutor(node) as papi_exec: reply = papi_exec.add(cmd).get_reply(err_msg) @@ -140,9 +199,32 @@ class NATUtil: u"nat44_interface_addr_dump", u"nat44_address_dump", u"nat44_static_mapping_dump", - u"nat44_user_dump", u"nat44_interface_dump", + ] + PapiSocketExecutor.dump_and_log(node, cmds) + + @staticmethod + def show_nat_user_data(node): + """Show the NAT user data. + + Used data sources: + + nat44_user_dump + nat44_user_session_dump + + :param node: DUT node. + :type node: dict + """ + cmd = u"nat_show_config" + err_msg = f"Failed to get NAT user data on host {node[u'host']}" + + with PapiSocketExecutor(node) as papi_exec: + reply = papi_exec.add(cmd).get_reply(err_msg) + + logger.debug(f"NAT Configuration:\n{pformat(reply)}") + + cmds = [ + u"nat44_user_dump", u"nat44_user_session_dump", - u"nat_det_map_dump" ] PapiSocketExecutor.dump_and_log(node, cmds) diff --git a/resources/libraries/python/TrafficGenerator.py b/resources/libraries/python/TrafficGenerator.py index 119702c15b..54d0fbd502 100644 --- a/resources/libraries/python/TrafficGenerator.py +++ b/resources/libraries/python/TrafficGenerator.py @@ -466,9 +466,9 @@ class TrafficGenerator(AbstractMeasurer): if subtype == NodeSubTypeTG.TREX: # Last line from console output line = stdout.splitlines()[-1] - results = line.split(",") - if results[-1] == u" ": - results.remove(u" ") + results = line.split(u",") + if results[-1] in (u" ", u""): + results.pop(-1) self._result = dict() for result in results: key, value = result.split(u"=", maxsplit=1) @@ -490,22 +490,48 @@ class TrafficGenerator(AbstractMeasurer): self._result.get(u"client_active_flows") self._l7_data[u"client"][u"established_flows"] = \ self._result.get(u"client_established_flows") + self._l7_data[u"client"][u"err_rx_throttled"] = \ + self._result.get(u"client_err_rx_throttled") + self._l7_data[u"client"][u"err_c_nf_throttled"] = \ + self._result.get(u"client_err_nf_throttled") + self._l7_data[u"client"][u"err_flow_overflow"] = \ + self._result.get(u"client_err_flow_overflow") self._l7_data[u"server"] = dict() self._l7_data[u"server"][u"active_flows"] = \ self._result.get(u"server_active_flows") self._l7_data[u"server"][u"established_flows"] = \ self._result.get(u"server_established_flows") + self._l7_data[u"server"][u"err_rx_throttled"] = \ + self._result.get(u"client_err_rx_throttled") if u"udp" in self.traffic_profile: self._l7_data[u"client"][u"udp"] = dict() self._l7_data[u"client"][u"udp"][u"established_flows"] = \ self._result.get(u"client_udp_connects") self._l7_data[u"client"][u"udp"][u"closed_flows"] = \ self._result.get(u"client_udp_closed") + self._l7_data[u"client"][u"udp"][u"tx_bytes"] = \ + self._result.get(u"client_udp_tx_bytes") + self._l7_data[u"client"][u"udp"][u"rx_bytes"] = \ + self._result.get(u"client_udp_rx_bytes") + self._l7_data[u"client"][u"udp"][u"tx_packets"] = \ + self._result.get(u"client_udp_tx_packets") + self._l7_data[u"client"][u"udp"][u"rx_packets"] = \ + self._result.get(u"client_udp_rx_packets") + self._l7_data[u"client"][u"udp"][u"keep_drops"] = \ + self._result.get(u"client_udp_keep_drops") self._l7_data[u"server"][u"udp"] = dict() self._l7_data[u"server"][u"udp"][u"accepted_flows"] = \ self._result.get(u"server_udp_accepts") self._l7_data[u"server"][u"udp"][u"closed_flows"] = \ self._result.get(u"server_udp_closed") + self._l7_data[u"server"][u"udp"][u"tx_bytes"] = \ + self._result.get(u"server_udp_tx_bytes") + self._l7_data[u"server"][u"udp"][u"rx_bytes"] = \ + self._result.get(u"server_udp_rx_bytes") + self._l7_data[u"server"][u"udp"][u"tx_packets"] = \ + self._result.get(u"server_udp_tx_packets") + self._l7_data[u"server"][u"udp"][u"rx_packets"] = \ + self._result.get(u"server_udp_rx_packets") elif u"tcp" in self.traffic_profile: self._l7_data[u"client"][u"tcp"] = dict() self._l7_data[u"client"][u"tcp"][u"initiated_flows"] = \ @@ -514,6 +540,10 @@ class TrafficGenerator(AbstractMeasurer): self._result.get(u"client_tcp_connects") self._l7_data[u"client"][u"tcp"][u"closed_flows"] = \ self._result.get(u"client_tcp_closed") + self._l7_data[u"client"][u"tcp"][u"tx_bytes"] = \ + self._result.get(u"client_tcp_tx_bytes") + self._l7_data[u"client"][u"tcp"][u"rx_bytes"] = \ + self._result.get(u"client_tcp_rx_bytes") self._l7_data[u"server"][u"tcp"] = dict() self._l7_data[u"server"][u"tcp"][u"accepted_flows"] = \ self._result.get(u"server_tcp_accepts") @@ -521,6 +551,10 @@ class TrafficGenerator(AbstractMeasurer): self._result.get(u"server_tcp_connects") self._l7_data[u"server"][u"tcp"][u"closed_flows"] = \ self._result.get(u"server_tcp_closed") + self._l7_data[u"server"][u"tcp"][u"tx_bytes"] = \ + self._result.get(u"server_tcp_tx_bytes") + self._l7_data[u"server"][u"tcp"][u"rx_bytes"] = \ + self._result.get(u"server_tcp_rx_bytes") def trex_astf_stop_remote_exec(self, node): """Execute T-Rex ASTF script on remote node over ssh to stop running @@ -668,6 +702,7 @@ class TrafficGenerator(AbstractMeasurer): self._loss = None self._latency = None xstats = [None, None] + self._l7_data = dict() self._l7_data[u"client"] = dict() self._l7_data[u"client"][u"active_flows"] = None self._l7_data[u"client"][u"established_flows"] = None @@ -849,12 +884,11 @@ class TrafficGenerator(AbstractMeasurer): """ subtype = check_subtype(self._node) if subtype == NodeSubTypeTG.TREX: - self.set_rate_provider_defaults( - frame_size, traffic_profile, - traffic_directions=traffic_directions) + if self.traffic_profile != str(traffic_profile): + self.traffic_profile = str(traffic_profile) if u"trex-astf" in self.traffic_profile: self.trex_astf_start_remote_exec( - duration, int(rate), frame_size, traffic_profile, + duration, int(rate), frame_size, self.traffic_profile, async_call, latency, warmup_time, traffic_directions, tx_port, rx_port ) @@ -862,7 +896,7 @@ class TrafficGenerator(AbstractMeasurer): elif u"trex-sl" in self.traffic_profile: unit_rate_str = str(rate) + u"pps" self.trex_stl_start_remote_exec( - duration, unit_rate_str, frame_size, traffic_profile, + duration, unit_rate_str, frame_size, self.traffic_profile, async_call, latency, warmup_time, traffic_directions, tx_port, rx_port ) @@ -999,8 +1033,12 @@ class TrafficGenerator(AbstractMeasurer): # TG needs target Tr per stream, but reports aggregate Tx and Dx. unit_rate_int = transmit_rate / float(self.traffic_directions) self.send_traffic_on_tg( - duration, unit_rate_int, self.frame_size, self.traffic_profile, - warmup_time=self.warmup_time, latency=self.use_latency, + duration, + unit_rate_int, + self.frame_size, + self.traffic_profile, + warmup_time=self.warmup_time, + latency=self.use_latency, traffic_directions=self.traffic_directions ) return self.get_measurement_result(duration, transmit_rate) @@ -1019,7 +1057,7 @@ class OptimizedSearch: maximum_transmit_rate, packet_loss_ratio=0.005, final_relative_width=0.005, final_trial_duration=30.0, initial_trial_duration=1.0, number_of_intermediate_phases=2, - timeout=720.0, doublings=1, traffic_directions=2): + timeout=720.0, doublings=1, traffic_directions=2, latency=False): """Setup initialized TG, perform optimized search, return intervals. :param frame_size: Frame size identifier or value [B]. @@ -1044,6 +1082,8 @@ class OptimizedSearch: less stable tests might get better overal duration with 2 or more. :param traffic_directions: Traffic is bi- (2) or uni- (1) directional. Default: 2 + :param latency: Whether to measure latency during the trial. + Default: False. :type frame_size: str or int :type traffic_profile: str :type minimum_transmit_rate: float @@ -1056,6 +1096,7 @@ class OptimizedSearch: :type timeout: float :type doublings: int :type traffic_directions: int + :type latency: bool :returns: Structure containing narrowed down NDR and PDR intervals and their measurements. :rtype: NdrPdrResult @@ -1069,7 +1110,11 @@ class OptimizedSearch: u"resources.libraries.python.TrafficGenerator" ) tg_instance.set_rate_provider_defaults( - frame_size, traffic_profile, traffic_directions=traffic_directions) + frame_size, + traffic_profile, + traffic_directions=traffic_directions, + latency=latency + ) algorithm = MultipleLossRatioSearch( measurer=tg_instance, final_trial_duration=final_trial_duration, final_relative_width=final_relative_width, @@ -1130,8 +1175,12 @@ class OptimizedSearch: u"resources.libraries.python.TrafficGenerator" ) tg_instance.set_rate_provider_defaults( - frame_size, traffic_profile, traffic_directions=traffic_directions, - negative_loss=False, latency=latency) + frame_size, + traffic_profile, + traffic_directions=traffic_directions, + negative_loss=False, + latency=latency + ) algorithm = PLRsearch( measurer=tg_instance, trial_duration_per_trial=tdpt, packet_loss_ratio_target=plr_target, diff --git a/resources/libraries/python/VppConfigGenerator.py b/resources/libraries/python/VppConfigGenerator.py index f19294965a..68a4e22e6b 100644 --- a/resources/libraries/python/VppConfigGenerator.py +++ b/resources/libraries/python/VppConfigGenerator.py @@ -501,12 +501,21 @@ class VppConfigGenerator: self.add_config_item(self._nodeconfig, u"", path) def add_nat(self, value=u"deterministic"): - """Add NAT configuration. + """Add NAT mode configuration. :param value: NAT mode. :type value: str """ - path = [u"nat"] + path = [u"nat", value] + self.add_config_item(self._nodeconfig, u"", path) + + def add_nat_max_translations_per_thread(self, value): + """Add NAT max. translations per thread number configuration. + + :param value: NAT mode. + :type value: str + """ + path = [u"nat", u"max translations per thread"] self.add_config_item(self._nodeconfig, value, path) def add_nsim_poll_main_thread(self): diff --git a/resources/libraries/robot/ip/ip4.robot b/resources/libraries/robot/ip/ip4.robot index 2dc2a72857..9855e129a4 100644 --- a/resources/libraries/robot/ip/ip4.robot +++ b/resources/libraries/robot/ip/ip4.robot @@ -32,13 +32,16 @@ | | ... | Type: string | | ... | - remote_host2_ip - IP address of remote host2 (Optional). | | ... | Type: string +| | ... | - remote_host_mask - Mask of remote host IP addresses (Optional). +| | ... | Type: string | | | | ... | *Example:* | | | | ... | \| Initialize IPv4 forwarding in circular topology \ -| | ... | \| 192.168.0.1 \| 192.168.0.2 \| +| | ... | \| 192.168.0.1 \| 192.168.0.2 \| 24 \| | | | | [Arguments] | ${remote_host1_ip}=${NONE} | ${remote_host2_ip}=${NONE} +| | ... | ${remote_host_mask}=32 | | | | ${dut2_status} | ${value}= | Run Keyword And Ignore Error | | ... | Variable Should Exist | ${dut2} @@ -81,18 +84,18 @@ | | ... | interface=${DUT2_${int}1}[0] | | | | Run Keyword Unless | '${remote_host1_ip}' == '${NONE}' -| | ... | Vpp Route Add | ${dut1} | ${remote_host1_ip} | 24 +| | ... | Vpp Route Add | ${dut1} | ${remote_host1_ip} | ${remote_host_mask} | | ... | gateway=10.10.10.2 | interface=${DUT1_${int}1}[0] | | Run Keyword Unless | '${remote_host2_ip}' == '${NONE}' -| | ... | Vpp Route Add | ${dut} | ${remote_host2_ip} | 24 +| | ... | Vpp Route Add | ${dut} | ${remote_host2_ip} | ${remote_host_mask} | | ... | gateway=20.20.20.2 | interface=${dut_if2} | | Run Keyword Unless | '${remote_host1_ip}' == '${NONE}' | | ... | Run Keyword If | '${dut2_status}' == 'PASS' -| | ... | Vpp Route Add | ${dut1} | ${remote_host1_ip} | 24 +| | ... | Vpp Route Add | ${dut1} | ${remote_host1_ip} | ${remote_host_mask} | | ... | gateway=1.1.1.2 | interface=${DUT1_${int}2}[0] | | Run Keyword Unless | '${remote_host2_ip}' == '${NONE}' | | ... | Run Keyword If | '${dut2_status}' == 'PASS' -| | ... | Vpp Route Add | ${dut2} | ${remote_host2_ip} | 24 +| | ... | Vpp Route Add | ${dut2} | ${remote_host2_ip} | ${remote_host_mask} | | ... | gateway=1.1.1.1 | interface=${DUT2_${int}1}[0] | Initialize IPv4 forwarding with scaling in circular topology diff --git a/resources/libraries/robot/ip/nat.robot b/resources/libraries/robot/ip/nat.robot index e1c302e98a..8a970cf556 100644 --- a/resources/libraries/robot/ip/nat.robot +++ b/resources/libraries/robot/ip/nat.robot @@ -72,86 +72,81 @@ | | | | Show NAT | ${node} -| Initialize NAT44 in circular topology -| | [Documentation] | Initialization of 2-node / 3-node topology with NAT44 -| | ... | between DUTs: +| Initialize NAT44 deterministic mode in circular topology +| | [Documentation] | Initialization of NAT44 deterministic mode on DUT1 +| | +| | Configure inside and outside interfaces +| | ... | ${dut1} | ${DUT1_${int}1}[0] | ${DUT1_${int}2}[0] +| | Configure deterministic mode for NAT44 +| | ... | ${dut1} | ${in_net} | ${in_mask} | ${out_net} | ${out_mask} + +| Initialize NAT44 endpoint-dependent mode in circular topology +| | [Documentation] | Initialization of NAT44 endpoint-dependent mode on DUT1 +| | +| | Configure inside and outside interfaces +| | ... | ${dut1} | ${DUT1_${int}1}[0] | ${DUT1_${int}2}[0] +| | Set NAT44 Address Range +| | ... | ${dut1} | ${out_net} | ${out_net_end} + +# TODO: Remove when 'ip4.Initialize IPv4 forwarding in circular topology' KW +# adapted to use IP values from variables +| Initialize IPv4 forwarding for NAT44 in circular topology +| | [Documentation] +| | ... | Set IPv4 forwarding for NAT44: | | ... | - set interfaces up | | ... | - set IP addresses | | ... | - set ARP | | ... | - create routes -| | ... | - set NAT44 - only on DUT1 | | -| | ${dut2_status} | ${value}= | Run Keyword And Ignore Error +| | ${status} | ${value}= | Run Keyword And Ignore Error | | ... | Variable Should Exist | ${dut2} +| | ${dut2_status}= | Set Variable If | '${status}' == 'PASS' | ${True} +| | ... | ${False} | | | | Set interfaces in path up | | -| | ${tg_if1_ip4}= | Get Variable Value | ${tg_if1_ip4} | 10.0.0.2 -| | ${tg_if1_mask}= | Get Variable Value | ${tg_if1_mask} | 20 -| | ${tg_if2_ip4}= | Get Variable Value | ${tg_if2_ip4} | 12.0.0.2 -| | ${tg_if2_mask}= | Get Variable Value | ${tg_if2_mask} | 20 -| | ${dut1_if1_ip4}= | Get Variable Value | ${dut1_if1_ip4} | 10.0.0.1 -| | ${dut1_if1_mask}= | Get Variable Value | ${dut1_if1_mask} | 20 -| | ${dut1_if2_ip4}= | Get Variable Value | ${dut1_if2_ip4} | 11.0.0.1 -| | ${dut1_if2_mask}= | Get Variable Value | ${dut2_if2_mask} | 20 -| | ${dut2_if1_ip4}= | Get Variable Value | ${dut2_if1_ip4} | 11.0.0.2 -| | ${dut2_if1_mask}= | Get Variable Value | ${dut2_if1_mask} | 20 -| | ${dut2_if2_ip4}= | Get Variable Value | ${dut2_if2_ip4} | 12.0.0.1 -| | ${dut2_if2_mask}= | Get Variable Value | ${dut2_if2_mask} | 20 -| | ${inside_net}= | Get Variable Value | ${inside_net} | 192.168.0.0 -| | ${inside_mask}= | Get Variable Value | ${inside_mask} | 16 -| | ${nat_net}= | Get Variable Value | ${nat_net} | 109.146.163.128 -| | ${nat_mask}= | Get Variable Value | ${nat_mask} | 26 -| | ${dest_net}= | Get Variable Value | ${dest_net} | 20.0.0.0 -| | ${dest_mask}= | Get Variable Value | ${dest_mask} | 24 -| | -| | VPP Interface Set IP Address | ${dut1} | ${DUT1_${int}1}[0] -| | ... | ${dut1_if1_ip4} | ${dut1_if1_mask} -| | Run Keyword If | '${dut2_status}' == 'PASS' -| | ... | VPP Interface Set IP Address | ${dut1} | ${DUT1_${int}2}[0] -| | ... | ${dut1_if2_ip4} | ${dut1_if2_mask} -| | Run Keyword If | '${dut2_status}' == 'PASS' -| | ... | VPP Interface Set IP Address | ${dut2} | ${DUT2_${int}1}[0] -| | ... | ${dut2_if1_ip4} | ${dut2_if1_mask} -| | ${dut}= | Run Keyword If | '${dut2_status}' == 'PASS' -| | ... | Set Variable | ${dut2} -| | ... | ELSE | Set Variable | ${dut1} -| | ${dut_if2}= | Run Keyword If | '${dut2_status}' == 'PASS' -| | ... | Set Variable | ${DUT2_${int}2}[0] -| | ... | ELSE | Set Variable | ${DUT1_${int}2}[0] -| | VPP Interface Set IP Address | ${dut} | ${dut_if2} | ${dut2_if2_ip4} -| | ... | ${dut2_if2_mask} +| | VPP Interface Set IP Address +| | ... | ${dut1} | ${DUT1_${int}1}[0] | ${dut1_if1_ip4} | ${dut1_if1_mask} +| | VPP Interface Set IP Address +| | ... | ${dut1} | ${DUT1_${int}2}[0] | ${dut1_if2_ip4} | ${dut1_if2_mask} +| | Run Keyword If | ${dut2_status} +| | ... | VPP Interface Set IP Address +| | ... | ${dut2} | ${DUT2_${int}1}[0] | ${dut2_if1_ip4} | ${dut2_if1_mask} +| | Run Keyword If | ${dut2_status} +| | ... | VPP Interface Set IP Address +| | ... | ${dut2} | ${DUT2_${int}2}[0] | ${dut2_if2_ip4} | ${dut2_if2_mask} | | | | VPP Add IP Neighbor | | ... | ${dut1} | ${DUT1_${int}1}[0] | ${tg_if1_ip4} | ${TG_pf1_mac}[0] -| | Run Keyword If | '${dut2_status}' == 'PASS' +| | Run Keyword If | ${dut2_status} | | ... | VPP Add IP Neighbor | | ... | ${dut1} | ${DUT1_${int}2}[0] | ${dut2_if1_ip4} | | ... | ${DUT2_${int}1_mac}[0] -| | Run Keyword If | '${dut2_status}' == 'PASS' +| | ... | ELSE | VPP Add IP Neighbor +| | ... | ${dut1} | ${DUT1_${int}2}[0] | ${tg_if2_ip4} | ${TG_pf2_mac}[0] +| | Run Keyword If | ${dut2_status} | | ... | VPP Add IP Neighbor -| | ... | ${dut2} | ${DUT2_${int}1}[0] | ${dut1_if2_ip4} +| | ... | ${dut2} | ${DUT2_${int}1}[0] | ${dut1_if1_ip4} | | ... | ${DUT1_${int}2_mac}[0] -| | VPP Add IP Neighbor -| | ... | ${dut} | ${dut_if2} | ${tg_if2_ip4} | ${TG_pf2_mac}[0] -| | -| | Vpp Route Add | ${dut1} | ${inside_net} | ${inside_mask} -| | ... | gateway=${tg_if1_ip4} | interface=${DUT1_${int}1}[0] -| | Run Keyword If | '${dut2_status}' == 'PASS' -| | ... | Vpp Route Add | ${dut1} | ${dest_net} | ${dest_mask} -| | ... | gateway=${dut2_if1_ip4} | interface=${DUT1_${int}2}[0] -| | Run Keyword Unless | '${dut2_status}' == 'PASS' -| | ... | Vpp Route Add | ${dut1} | ${dest_net} | ${dest_mask} -| | ... | gateway=${tg_if2_ip4} | interface=${DUT1_${int}2}[0] -| | Run Keyword If | '${dut2_status}' == 'PASS' -| | ... | Vpp Route Add | ${dut2} | ${dest_net} | ${dest_mask} -| | ... | gateway=${tg_if2_ip4} | interface=${DUT2_${int}2}[0] -| | Run Keyword If | '${dut2_status}' == 'PASS' -| | ... | Vpp Route Add | ${dut2} | ${nat_net} | ${nat_mask} -| | ... | gateway=${dut1_if2_ip4} | interface=${DUT2_${int}1}[0] -| | -| | Configure inside and outside interfaces -| | ... | ${dut1} | ${DUT1_${int}1}[0] | ${DUT1_${int}2}[0] -| | Configure deterministic mode for NAT44 -| | ... | ${dut1} | ${inside_net} | ${inside_mask} | ${nat_net} | ${nat_mask} - +| | Run Keyword If | ${dut2_status} +| | ... | VPP Add IP Neighbor +| | ... | ${dut2} | ${DUT2_${int}2}[0] | ${tg_if2_ip4}| ${TG_pf2_mac}[0] +| | +| | Vpp Route Add +| | ... | ${dut1} | ${in_net} | ${in_mask} | gateway=${tg_if1_ip4} +| | ... | interface=${DUT1_${int}1}[0] +| | Run Keyword If | ${dut2_status} +| | ... | Vpp Route Add +| | ... | ${dut1} | ${dest_net} | ${dest_mask} | gateway=${dut2_if1_ip4} +| | ... | interface=${DUT1_${int}2}[0] +| | ... | ELSE | Vpp Route Add +| | ... | ${dut1} | ${dest_net} | ${dest_mask} | gateway=${tg_if2_ip4} +| | ... | interface=${DUT1_${int}2}[0] +| | Run Keyword If | ${dut2_status} +| | ... | Vpp Route Add +| | ... | ${dut2} | ${dest_net} | ${dest_mask} | gateway=${tg_if2_ip4} +| | ... | interface=${DUT2_${int}2}[0] +| | Run Keyword If | ${dut2_status} +| | ... | Vpp Route Add +| | ... | ${dut2} | ${out_net} | ${out_mask} | gateway=${dut1_if2_ip4} +| | ... | interface=${DUT2_${int}1}[0] diff --git a/resources/libraries/robot/performance/performance_limits.robot b/resources/libraries/robot/performance/performance_limits.robot index 82688ac9c6..332ed9368b 100644 --- a/resources/libraries/robot/performance/performance_limits.robot +++ b/resources/libraries/robot/performance/performance_limits.robot @@ -1,4 +1,4 @@ -# Copyright (c) 2019 Cisco and/or its affiliates. +# Copyright (c) 2020 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: @@ -24,19 +24,48 @@ | | | | ... | *Arguments:* | | ... | - frame_size - Framesize. Type: integer or string +| | ... | - overhead - Overhead in bytes; default value: ${0}. Type: integer | | | | ... | *Returns:* -| | ... | Average frame size. Type: float +| | ... | Average frame size including overhead. Type: float | | | | ... | *Example:* | | | | ... | \| Get Average Frame Size \| IMIX_v4_1 \| | | -| | [Arguments] | ${frame_size} +| | [Arguments] | ${frame_size} | ${overhead}=${0} | | -| | Return From Keyword If | '${frame_size}' == 'IMIX_v4_1' | ${353.83333} -| | ${frame_size} = | Convert To Number | ${frame_size} -| | Return From Keyword | ${frame_size} +| | ${frame_size} = | Run Keyword If | '${frame_size}' == 'IMIX_v4_1' +| | ... | Set Variable | ${353.83333} +| | ... | ELSE +| | ... | Convert To Number | ${frame_size} +| | ${avg_frame_size} = | Evaluate | ${frame_size} + ${overhead} +| | Return From Keyword | ${avg_frame_size} + +| Get Maximum Frame Size +| | [Documentation] +| | ... | Framesize can be either integer in case of a single packet +| | ... | in stream, or set of packets in case of IMIX type or simmilar. +| | +| | ... | *Arguments:* +| | ... | - frame_size - Framesize. Type: integer or string +| | ... | - overhead - Overhead in bytes; default value: ${0}. Type: integer +| | +| | ... | *Returns:* +| | ... | Maximum frame size including overhead. Type: float +| | +| | ... | *Example:* +| | +| | ... | \| Get Maximum Frame Size \| IMIX_v4_1 \| +| | +| | [Arguments] | ${frame_size} | ${overhead}=${0} +| | +| | ${frame_size} = | Run Keyword If | '${frame_size}' == 'IMIX_v4_1' +| | ... | Set Variable | ${1518} +| | ... | ELSE +| | ... | Convert To Number | ${frame_size} +| | ${max_frame_size} = | Evaluate | ${frame_size} + ${overhead} +| | Return From Keyword | ${max_frame_size} | Set Max Rate And Jumbo | | [Documentation] @@ -61,8 +90,9 @@ | | | | ... | *Test (or broader scope) variables read:* | | ... | - nic_name - Name of bottleneck NIC. Type: string -| | ... | - overhead - Overhead in bytes. Default: 0. Type: integer -| | ... | - frame_size - L2 Frame Size [B] or IMIX string. Type: int or str +| | ... | - overhead - Overhead in bytes; default value: 0. Type: integer +| | ... | - frame_size - L2 Frame Size [B] or IMIX string. Type: integer or +| | ... | string | | | | ... | *Test variables set:* | | ... | - max_rate - Calculated unidirectional maximal transmit rate [pps]. @@ -72,7 +102,7 @@ | | | | ... | *Example:* | | -| | ... | \| Set test Variable \| \${frame_size} \| IMIX_v4_1 \| +| | ... | \| Set Test Variable \| \${frame_size} \| IMIX_v4_1 \| | | ... | \| Set Max Rate And Jumbo \| | | | | # Negative overhead is possible, if DUT-DUT traffic is less encapsulated @@ -84,16 +114,40 @@ | | ... | ${NIC_NAME_TO_PPS_LIMIT} | ${nic_name} | | ${bps_limit} = | Get From Dictionary | | ... | ${NIC_NAME_TO_BPS_LIMIT} | ${nic_name} -| | ${avg_size} = | Get Average Frame Size | ${frame_size} -| | ${max_size} = | Set Variable If | '${frame_size}' == 'IMIX_v4_1' -| | ... | ${1518} | ${frame_size} | | # swo := size_with_overhead -| | ${avg_swo} = | Evaluate | ${avg_size} + ${overhead} -| | ${max_swo} = | Evaluate | ${max_size} + ${overhead} -| | ${jumbo} = | Set Variable If | ${max_swo} < 1522 -| | ... | ${False} | ${True} +| | ${avg_swo} = | Get Average Frame Size | ${frame_size} | ${overhead} | | ${rate} = | Evaluate | ${bps_limit} / ((${avg_swo} + 20.0) * 8) | | ${max_rate} = | Set Variable If | ${rate} > ${pps_limit} | | ... | ${pps_limit} | ${rate} -| | Set Test Variable | \${jumbo} | | Set Test Variable | \${max_rate} +| | Set Jumbo + +| Set Jumbo +| | [Documentation] +| | ... | For jumbo frames detection, the maximal packet size is relevant, +| | ... | encapsulation overhead (if any) has effect. +| | +| | ... | This keyword computes jumbo boolean (some suites need that for +| | ... | configuration decisions). +| | ... | To streamline suite autogeneration, both input and output values +| | ... | are communicated as test (or broader scope) variables, +| | ... | instead of explicit arguments and return values. +| | +| | ... | *Test (or broader scope) variables read:* +| | ... | - overhead - Overhead in bytes; default value: 0. Type: integer +| | ... | - frame_size - L2 Frame Size [B] or IMIX string. Type: integer or +| | ... | string +| | +| | ... | *Test variables set:* +| | ... | - jumbo - Jumbo boolean, true if jumbo packet support has to be +| | ... | enabled. Type: boolean +| | +| | ... | *Example:* +| | +| | ... | \| Set Jumnbo \| +| | +| | ${overhead} = | Set Variable If | ${overhead} >= 0 | ${overhead} | ${0} +| | ${max_swo} = | Get Maximum Frame Size | ${frame_size} | ${overhead} +| | ${jumbo} = | Set Variable If | ${max_swo} < 1522 +| | ... | ${False} | ${True} +| | Set Test Variable | \${jumbo} diff --git a/resources/libraries/robot/performance/performance_utils.robot b/resources/libraries/robot/performance/performance_utils.robot index dcabbb9fac..84113709cf 100644 --- a/resources/libraries/robot/performance/performance_utils.robot +++ b/resources/libraries/robot/performance/performance_utils.robot @@ -50,7 +50,8 @@ | | ... | *Test (or broader scope) variables read:* | | ... | - traffic_profile - Name of module defining traffc for measurements. | | ... | Type: string -| | ... | - frame_size - L2 Frame Size [B] or IMIX string. Type: int or str +| | ... | - frame_size - L2 Frame Size [B] or IMIX string. Type: integer or +| | ... | string | | ... | - max_rate - Calculated unidirectional maximal transmit rate [pps]. | | ... | Type: float | | @@ -59,12 +60,16 @@ | | ... | - final_relative_width - Maximal width multiple of upper. Type: float | | ... | - final_trial_duration - Duration of final trials [s]. Type: float | | ... | - initial_trial_duration - Duration of initial trials [s]. Type: float -| | ... | - intermediate phases - Number of intermediate phases [1]. Type: int +| | ... | - intermediate phases - Number of intermediate phases [1]. +| | ... | Type: integer | | ... | - timeout - Fail if search duration is longer [s]. Type: float -| | ... | - doublings - How many doublings to do when expanding [1]. Type: int +| | ... | - doublings - How many doublings to do when expanding [1]. +| | ... | Type: integer | | ... | - traffic_directions - Bi- (2) or uni- (1) directional traffic. -| | ... | Type: int +| | ... | Type: integer | | ... | - latency_duration - Duration for latency-specific trials. Type: float +| | ... | - latency - False to disable latency measurement; default value: True. +| | ... | Type: boolean | | | | ... | *Example:* | | @@ -78,6 +83,7 @@ | | ... | ${number_of_intermediate_phases}=${2} | ${timeout}=${720.0} | | ... | ${doublings}=${2} | ${traffic_directions}=${2} | | ... | ${latency_duration}=${PERF_TRIAL_LATENCY_DURATION} +| | ... | ${latency}=${True} | | | | # Latency measurements will need more than 9000 pps. | | ${result} = | Perform optimized ndrpdr search | ${frame_size} @@ -86,6 +92,7 @@ | | ... | ${final_trial_duration} | ${initial_trial_duration} | | ... | ${number_of_intermediate_phases} | timeout=${timeout} | | ... | doublings=${doublings} | traffic_directions=${traffic_directions} +| | ... | latency=${latency} | | Display result of NDRPDR search | ${result} | | Check NDRPDR interval validity | ${result.pdr_interval} | | ... | ${packet_loss_ratio} @@ -95,18 +102,22 @@ | | ${ndr_sum}= | Set Variable | ${result.ndr_interval.measured_low.target_tr} | | ${ndr_per_stream}= | Evaluate | ${ndr_sum} / float(${traffic_directions}) | | ${rate}= | Evaluate | 0.9 * ${pdr_per_stream} -| | Measure and show latency at specified rate | Latency at 90% PDR: +| | Run Keyword If | ${latency} +| | ... | Measure and show latency at specified rate | Latency at 90% PDR: | | ... | ${latency_duration} | ${rate} | ${framesize} | | ... | ${traffic_profile} | ${traffic_directions} | | ${rate}= | Evaluate | 0.5 * ${pdr_per_stream} -| | Measure and show latency at specified rate | Latency at 50% PDR: +| | Run Keyword If | ${latency} +| | ... | Measure and show latency at specified rate | Latency at 50% PDR: | | ... | ${latency_duration} | ${rate} | ${framesize} | | ... | ${traffic_profile} | ${traffic_directions} | | ${rate}= | Evaluate | 0.1 * ${pdr_per_stream} -| | Measure and show latency at specified rate | Latency at 10% PDR: +| | Run Keyword If | ${latency} +| | ... | Measure and show latency at specified rate | Latency at 10% PDR: | | ... | ${latency_duration} | ${rate} | ${framesize} | | ... | ${traffic_profile} | ${traffic_directions} -| | Measure and show latency at specified rate | Latency at 0% PDR: +| | Run Keyword If | ${latency} +| | ... | Measure and show latency at specified rate | Latency at 0% PDR: | | ... | ${latency_duration} | ${0} | ${framesize} | | ... | ${traffic_profile} | ${traffic_directions} | | # Finally, trials with runtime and other stats. @@ -128,7 +139,8 @@ | | ... | *Test (or broader scope) variables read:* | | ... | - traffic_profile - Name of module defining traffc for measurements. | | ... | Type: string -| | ... | - frame_size - L2 Frame Size [B] or IMIX string. Type: int or str +| | ... | - frame_size - L2 Frame Size [B] or IMIX string. Type: integer or +| | ... | string | | ... | - max_rate - Calculated unidirectional maximal transmit rate [pps]. | | ... | Type: float | | @@ -137,11 +149,15 @@ | | ... | - final_relative_width - Maximal width multiple of upper. Type: float | | ... | - final_trial_duration - Duration of final trials [s]. Type: float | | ... | - initial_trial_duration - Duration of initial trials [s]. Type: float -| | ... | - intermediate phases - Number of intermediate phases [1]. Type: int +| | ... | - intermediate phases - Number of intermediate phases [1]. +| | ... | Type: integer | | ... | - timeout - Fail if search duration is longer [s]. Type: float -| | ... | - doublings - How many doublings to do when expanding [1]. Type: int +| | ... | - doublings - How many doublings to do when expanding [1]. +| | ... | Type: integer | | ... | - traffic_directions - Bi- (2) or uni- (1) directional traffic. -| | ... | Type: int +| | ... | Type: integer +| | ... | - latency - True to enable latency measurement; default value: False. +| | ... | Type: boolean | | | | ... | *Returns:* | | ... | - Lower bound for bi-directional throughput at given PLR. Type: float @@ -156,7 +172,7 @@ | | ... | ${final_relative_width}=${0.001} | ${final_trial_duration}=${10.0} | | ... | ${initial_trial_duration}=${1.0} | | ... | ${number_of_intermediate_phases}=${1} | ${timeout}=${720.0} -| | ... | ${doublings}=${2} | ${traffic_directions}=${2} +| | ... | ${doublings}=${2} | ${traffic_directions}=${2} | ${latency}=${False} | | | | ${result} = | Perform optimized ndrpdr search | ${frame_size} | | ... | ${traffic_profile} | ${10000} | ${max_rate} @@ -164,6 +180,7 @@ | | ... | ${final_trial_duration} | ${initial_trial_duration} | | ... | ${number_of_intermediate_phases} | timeout=${timeout} | | ... | doublings=${doublings} | traffic_directions=${traffic_directions} +| | ... | latency=${latency} | | Check NDRPDR interval validity | ${result.pdr_interval} | | ... | ${packet_loss_ratio} | | Return From Keyword | ${result.pdr_interval.measured_low.target_tr} @@ -181,7 +198,8 @@ | | ... | *Test (or broader scope) variables read:* | | ... | - traffic_profile - Name of module defining traffc for measurements. | | ... | Type: string -| | ... | - frame_size - L2 Frame Size [B] or IMIX string. Type: int or str +| | ... | - frame_size - L2 Frame Size [B] or IMIX string. Type: integer or +| | ... | string | | ... | - max_rate - Calculated unidirectional maximal transmit rate [pps]. | | ... | Type: float | | @@ -189,7 +207,9 @@ | | ... | - packet_loss_ratio - Accepted loss during search. Type: float | | ... | - timeout - Stop when search duration is longer [s]. Type: float | | ... | - traffic_directions - Bi- (2) or uni- (1) directional traffic. -| | ... | Type: int +| | ... | Type: integer +| | ... | - latency - True to enable latency measurement; default value: False. +| | ... | Type: boolean | | | | ... | *Example:* | | @@ -197,13 +217,13 @@ | | ... | \| \${2} \| | | | | [Arguments] | ${packet_loss_ratio}=${1e-7} | ${timeout}=${1800.0} -| | ... | ${traffic_directions}=${2} +| | ... | ${traffic_directions}=${2} | ${latency}=${False} | | | | ${min_rate} = | Set Variable | ${10000} | | ${average} | ${stdev} = | Perform soak search | ${frame_size} | | ... | ${traffic_profile} | ${min_rate} | ${max_rate} | | ... | ${packet_loss_ratio} | timeout=${timeout} -| | ... | traffic_directions=${traffic_directions} +| | ... | traffic_directions=${traffic_directions} | latency=${latency} | | ${lower} | ${upper} = | Display result of soak search | | ... | ${average} | ${stdev} | | Should Not Be True | 1.1 * ${traffic_directions} * ${min_rate} > ${lower} @@ -229,7 +249,7 @@ | | ... | *Example:* | | | | ... | \| Display single bound \| NDR lower bound \| \${12345.67} \ -| | ... | \| \${64} \| show_latency=\${EMPTY} \| +| | ... | \| \${64} \| latency=\${EMPTY} \| | | | | [Arguments] | ${text} | ${rate_total} | ${frame_size} | ${latency}=${EMPTY} | | @@ -271,7 +291,8 @@ | | ... | The given result should contain latency data as well. | | | | ... | *Test (or broader scope) variables read:* -| | ... | - frame_size - L2 Frame Size [B] or IMIX string. Type: int or str +| | ... | - frame_size - L2 Frame Size [B] or IMIX string. Type: integer or +| | ... | string | | ... | *Arguments:* | | ... | - result - Measured result data per stream [pps]. Type: NdrPdrResult | | @@ -304,7 +325,8 @@ | | ... | (Throughput * (L2 Frame Size + IPG) * 8) | | | | ... | *Test (or broader scope) variables read:* -| | ... | - frame_size - L2 Frame Size [B] or IMIX string. Type: int or str +| | ... | - frame_size - L2 Frame Size [B] or IMIX string. Type: integer or +| | ... | string | | ... | *Arguments:* | | ... | - avg - Estimated average critical load [pps]. Type: float | | ... | - stdev - Standard deviation of critical load [pps]. Type: float @@ -360,36 +382,36 @@ | | ... | Send traffic at maximum rate. | | | | ... | *Test (or broader scope) variables read:* -| | ... | - traffic_profile - Name of module defining traffc for measurements. +| | ... | - traffic_profile - Name of module defining traffic for measurements. | | ... | Type: string -| | ... | - frame_size - L2 Frame Size [B] or IMIX string. Type: int or str +| | ... | - frame_size - L2 Frame Size [B] or IMIX string. Type: integer or +| | ... | string | | ... | - max_rate - Calculated unidirectional maximal transmit rate [pps]. | | ... | Type: float | | | | ... | *Arguments:* -| | ... | - trial_duration - Duration of single trial [s]. -| | ... | Type: float -| | ... | - fail_no_traffic - Whether to fail on zero receive count. -| | ... | Type: boolean +| | ... | - trial_duration - Duration of single trial [s]. Type: float +| | ... | - fail_no_traffic - Whether to fail on zero receive count; +| | ... | default value: True. Type: boolean | | ... | - trial_multiplicity - How many trials in this measurement. -| | ... | Type: int -| | ... | - traffic_directions - Bi- (2) or uni- (1) directional traffic. -| | ... | Type: int -| | ... | - tx_port - TX port of TG, default 0. -| | ... | Type: integer -| | ... | - rx_port - RX port of TG, default 1. | | ... | Type: integer +| | ... | - traffic_directions - Bi- (2) or uni- (1) directional traffic; +| | ... | default value: 2. Type: integer +| | ... | - tx_port - TX port of TG; default value: 0. Type: integer +| | ... | - rx_port - RX port of TG; default value: 1. Type: integer +| | ... | - latency - True to enable latency measurement; default value: False. +| | ... | Type: boolean | | | | ... | *Example:* | | -| | ... | \| Traffic should pass with maximum rate \| \${1} \| \${10.0} \ -| | ... | \| \${False} \| \${2} \| \${0} \| \${1} \| +| | ... | \| Traffic should pass with maximum rate \| \${1} \| \${False} \ +| | ... | \| \${10.0} \| \${2} \| \${0} \| \${1} \| \${True} \| | | | | [Arguments] | ${trial_duration}=${trial_duration} | | ... | ${fail_no_traffic}=${True} | | ... | ${trial_multiplicity}=${trial_multiplicity} | | ... | ${traffic_directions}=${2} | ${tx_port}=${0} | ${rx_port}=${1} -| | ... | ${latency}=${True} +| | ... | ${latency}=${False} | | | | ${results}= | Send traffic at specified rate | | ... | ${trial_duration} | ${max_rate} | ${frame_size} @@ -411,35 +433,39 @@ | | ... | - trial_duration - Duration of single trial [s]. Type: float | | ... | - rate - Target aggregate transmit rate [pps] / Connections per second | | ... | (CPS) for UDP/TCP flows. Type: float -| | ... | - frame_size - L2 Frame Size [B]. Type: integer/string +| | ... | - frame_size - L2 Frame Size [B]. Type: integer or string | | ... | - traffic_profile - Name of module defining traffc for measurements. | | ... | Type: string | | ... | - trial_multiplicity - How many trials in this measurement. -| | ... | Type: int -| | ... | - traffic_directions - Bi- (2) or uni- (1) directional traffic. -| | ... | Type: int -| | ... | - tx_port - TX port of TG, default 0. | | ... | Type: integer -| | ... | - rx_port - RX port of TG, default 1. +| | ... | - traffic_directions - Bi- (2) or uni- (1) directional traffic. | | ... | Type: integer -| | ... | - extended_debug- True to enable extended debug. +| | ... | - tx_port - TX port of TG; default value: 0. Type: integer +| | ... | - rx_port - RX port of TG; default value: 1. Type: integer +| | ... | - extended_debug - True to enable extended debug. +| | ... | Type: boolean +| | ... | - latency - True to enable latency measurement; default value: False. | | ... | Type: boolean | | | | ... | *Example:* | | | | ... | \| Send traffic at specified rate \| \${1.0} \| ${4000000.0} \ | | ... | \| \${64} \| 3-node-IPv4 \| \${10} \| \${2} \| \${0} \| \${1} \ -| | ... | \${False} \| +| | ... | \| ${False} \| ${True} \| | | | | [Arguments] | ${trial_duration} | ${rate} | ${frame_size} | | ... | ${traffic_profile} | ${trial_multiplicity}=${trial_multiplicity} | | ... | ${traffic_directions}=${2} | ${tx_port}=${0} | ${rx_port}=${1} -| | ... | ${extended_debug}=${extended_debug} | ${latency}=${True} +| | ... | ${extended_debug}=${extended_debug} | ${latency}=${False} | | | | Set Test Variable | ${extended_debug} -| | Clear and show runtime counters with running traffic | ${trial_duration} -| | ... | ${rate} | ${frame_size} | ${traffic_profile} -| | ... | ${traffic_directions} | ${tx_port} | ${rx_port} +| | # Following setting of test variables is needed as +| | # "Clear and show runtime counters with running traffic" has been moved to +| | # pre_stats actions. +| | Set Test Variable | ${rate} +| | Set Test Variable | ${traffic_directions} +| | Set Test Variable | ${tx_port} +| | Set Test Variable | ${rx_port} | | FOR | ${action} | IN | @{pre_stats} | | | Run Keyword | Additional Statistics Action For ${action} | | END @@ -473,15 +499,15 @@ | | ... | - rate - Rate [pps] for sending packets in case of T-Rex stateless | | ... | mode or multiplier of profile CPS in case of T-Rex astf mode. | | ... | Type: float -| | ... | - frame_size - L2 Frame Size [B]. Type: integer/string +| | ... | - frame_size - L2 Frame Size [B]. Type: integer or string | | ... | - traffic_profile - Name of module defining traffic for measurements. | | ... | Type: string | | ... | - traffic_directions - Bi- (2) or uni- (1) directional traffic. -| | ... | Type: int -| | ... | - tx_port - TX port of TG, default 0. Type: integer -| | ... | - rx_port - RX port of TG, default 1. Type: integer +| | ... | Type: integer +| | ... | - tx_port - TX port of TG; default value: 0. Type: integer +| | ... | - rx_port - RX port of TG; default value: 1. Type: integer | | ... | - safe_rate - To apply if rate is below this, as latency pps is fixed. -| | ... | In pps, type int. +| | ... | In pps. Type: integer. | | | | ... | *Example:* | | @@ -514,13 +540,13 @@ | | ... | - rate - Rate [pps] for sending packets in case of T-Rex stateless | | ... | mode or multiplier of profile CPS in case of T-Rex astf mode. | | ... | Type: float -| | ... | - frame_size - L2 Frame Size [B] or IMIX_v4_1. Type: integer/string +| | ... | - frame_size - L2 Frame Size [B] or IMIX_v4_1. Type: integer or string | | ... | - traffic_profile - Name of module defining traffc for measurements. | | ... | Type: string | | ... | - traffic_directions - Bi- (2) or uni- (1) directional traffic. -| | ... | Type: int -| | ... | - tx_port - TX port of TG, default 0. Type: integer -| | ... | - rx_port - RX port of TG, default 1. Type: integer +| | ... | Type: integer +| | ... | - tx_port - TX port of TG; default value: 0. Type: integer +| | ... | - rx_port - RX port of TG, default value: 1. Type: integer | | | | ... | *Example:* | | @@ -553,15 +579,16 @@ | | ... | *Test (or broader scope) variables read:* | | ... | - traffic_profile - Name of module defining traffc for measurements. | | ... | Type: string -| | ... | - frame_size - L2 Frame Size [B] or IMIX string. Type: int or str +| | ... | - frame_size - L2 Frame Size [B] or IMIX string. Type: integer or +| | ... | string | | ... | *Arguments:* | | ... | - rate - Rate [pps] for sending packets in case of T-Rex stateless | | ... | mode or multiplier of profile CPS in case of T-Rex astf mode. | | ... | Type: float | | ... | - traffic_directions - Bi- (2) or uni- (1) directional traffic. -| | ... | Type: int -| | ... | - tx_port - TX port of TG, default 0. Type: integer -| | ... | - rx_port - RX port of TG, default 1. Type: integer +| | ... | Type: integer +| | ... | - tx_port - TX port of TG; default value: 0. Type: integer +| | ... | - rx_port - RX port of TG; default value: 1. Type: integer | | | | ... | *Example:* | | @@ -647,4 +674,13 @@ | | ... | Additional Statistics Action for bash command "perf stat". | | | | Run Keyword If | ${extended_debug}==${True} -| | ... | Perf Stat On All DUTs | ${nodes} \ No newline at end of file +| | ... | Perf Stat On All DUTs | ${nodes} + +| Additional Statistics Action For vpp-clear-show-runtime-with-traffic +| | [Documentation] +| | ... | Additional Statistics Action for clear and show runtime counters with +| | ... | running traffic. +| | +| | Clear and show runtime counters with running traffic +| | ... | ${trial_duration} | ${rate} | ${frame_size} | ${traffic_profile} +| | ... | ${traffic_directions} | ${tx_port} | ${rx_port} diff --git a/resources/libraries/robot/shared/default.robot b/resources/libraries/robot/shared/default.robot index 6e1e5416e2..51ce513078 100644 --- a/resources/libraries/robot/shared/default.robot +++ b/resources/libraries/robot/shared/default.robot @@ -77,10 +77,10 @@ | | ... | try to initialize/disable. | | | | ... | *Arguments:* -| | ... | - crypto_type - Crypto device type - HW_DH895xcc or HW_C3xxx. -| | ... | Type: string, default value: HW_DH895xcc -| | ... | - numvfs - Number of VFs to initialize, 0 - disable the VFs -| | ... | Type: integer, default value: ${32} +| | ... | - crypto_type - Crypto device type - HW_DH895xcc or HW_C3xxx; default +| | ... | value: HW_DH895xcc. Type: string +| | ... | - numvfs - Number of VFs to initialize, 0 - disable the VFs; default +| | ... | value: ${32} Type: integer | | ... | - force_init - Force to initialize. Type: boolean | | | | ... | *Example:* @@ -127,7 +127,7 @@ | | [Arguments] | ${dutx} | ${dut_keys} | | | | FOR | ${key} | IN | @{dut_keys} -| | | ${found_key} | ${value}= | Run Keyword and Ignore Error +| | | ${found_key} | ${value}= | Run Keyword And Ignore Error | | | ... | Dictionaries Should Be Equal | ${nodes['${key}']} | ${dutx} | | | Run Keyword If | '${found_key}' == 'PASS' | EXIT FOR LOOP | | END @@ -142,21 +142,21 @@ | | FOR | ${dut} | IN | @{duts} | | | Import Library | resources.libraries.python.VppConfigGenerator | | | ... | WITH NAME | ${dut} -| | | Run keyword | ${dut}.Set Node | ${nodes['${dut}']} | node_key=${dut} -| | | Run keyword | ${dut}.Add Unix Log -| | | Run keyword | ${dut}.Add Unix CLI Listen -| | | Run keyword | ${dut}.Add Unix Nodaemon -| | | Run keyword | ${dut}.Add Unix Coredump -| | | Run keyword | ${dut}.Add Socksvr | ${SOCKSVR_PATH} -| | | Run keyword | ${dut}.Add Heapsize | 4G -| | | Run keyword | ${dut}.Add Statseg size | 4G -| | | Run keyword | ${dut}.Add Statseg Per Node Counters | on -| | | Run keyword | ${dut}.Add Plugin | disable | default -| | | Run keyword | ${dut}.Add Plugin | enable | @{plugins_to_enable} -| | | Run keyword | ${dut}.Add IP6 Hash Buckets | 2000000 -| | | Run keyword | ${dut}.Add IP6 Heap Size | 4G -| | | Run keyword | ${dut}.Add IP Heap Size | 4G -| | | Run keyword | ${dut}.Add Graph Node Variant | ${GRAPH_NODE_VARIANT} +| | | Run Keyword | ${dut}.Set Node | ${nodes['${dut}']} | node_key=${dut} +| | | Run Keyword | ${dut}.Add Unix Log +| | | Run Keyword | ${dut}.Add Unix CLI Listen +| | | Run Keyword | ${dut}.Add Unix Nodaemon +| | | Run Keyword | ${dut}.Add Unix Coredump +| | | Run Keyword | ${dut}.Add Socksvr | ${SOCKSVR_PATH} +| | | Run Keyword | ${dut}.Add Heapsize | 4G +| | | Run Keyword | ${dut}.Add Statseg size | 4G +| | | Run Keyword | ${dut}.Add Statseg Per Node Counters | on +| | | Run Keyword | ${dut}.Add Plugin | disable | default +| | | Run Keyword | ${dut}.Add Plugin | enable | @{plugins_to_enable} +| | | Run Keyword | ${dut}.Add IP6 Hash Buckets | 2000000 +| | | Run Keyword | ${dut}.Add IP6 Heap Size | 4G +| | | Run Keyword | ${dut}.Add IP Heap Size | 4G +| | | Run Keyword | ${dut}.Add Graph Node Variant | ${GRAPH_NODE_VARIANT} | | END | Add worker threads to all DUTs @@ -194,26 +194,26 @@ | | | ${cpu_main}= | Cpu list per node str | ${nodes['${dut}']} | ${numa} | | | ... | skip_cnt=${skip_cnt} | cpu_cnt=${CPU_CNT_MAIN} | | | ${skip_cnt}= | Evaluate | ${CPU_CNT_SYSTEM} + ${CPU_CNT_MAIN} -| | | ${cpu_wt}= | Run keyword if | ${cpu_count_int} > 0 | +| | | ${cpu_wt}= | Run Keyword If | ${cpu_count_int} > 0 | | | | ... | Cpu list per node str | ${nodes['${dut}']} | ${numa} | | | ... | skip_cnt=${skip_cnt} | cpu_cnt=${cpu_count_int} | | | ... | smt_used=${smt_used} -| | | ${thr_count_int}= | Run keyword if | ${smt_used} +| | | ${thr_count_int}= | Run Keyword If | ${smt_used} | | | ... | Evaluate | int(${cpu_count_int}*2) | | | ... | ELSE | Set variable | ${thr_count_int} -| | | ${rxq_count_int}= | Run keyword if | ${rx_queues} +| | | ${rxq_count_int}= | Run Keyword If | ${rx_queues} | | | ... | Set variable | ${rx_queues} | | | ... | ELSE | Evaluate | int(${thr_count_int}/2) -| | | ${rxq_count_int}= | Run keyword if | ${rxq_count_int} == 0 +| | | ${rxq_count_int}= | Run Keyword If | ${rxq_count_int} == 0 | | | ... | Set variable | ${1} | | | ... | ELSE | Set variable | ${rxq_count_int} | | | Run Keyword | ${dut}.Add CPU Main Core | ${cpu_main} -| | | Run keyword if | ${cpu_count_int} > 0 +| | | Run Keyword If | ${cpu_count_int} > 0 | | | ... | ${dut}.Add CPU Corelist Workers | ${cpu_wt} -| | | Run keyword if | ${smt_used} -| | | ... | Run keyword | ${dut}.Add Buffers Per Numa | ${215040} | ELSE -| | | ... | Run keyword | ${dut}.Add Buffers Per Numa | ${107520} -| | | Run keyword if | ${thr_count_int} > 1 +| | | Run Keyword If | ${smt_used} +| | | ... | Run Keyword | ${dut}.Add Buffers Per Numa | ${215040} | ELSE +| | | ... | Run Keyword | ${dut}.Add Buffers Per Numa | ${107520} +| | | Run Keyword If | ${thr_count_int} > 1 | | | ... | Set Tags | MTHREAD | ELSE | Set Tags | STHREAD | | | Set Tags | ${thr_count_int}T${cpu_count_int}C | | END @@ -245,15 +245,44 @@ | Add NAT to all DUTs | | [Documentation] | Add NAT configuration to all DUTs. | | +| | ... | *Arguments:* +| | ... | - nat_mode - NAT mode; default value: deterministic. Type: string +| | +| | ... | *Example:* +| | +| | ... | \| Add NAT to all DUTs \| nat_mode=endpoint-dependent \| +| | +| | [Arguments] | ${nat_mode}=deterministic +| | +| | FOR | ${dut} | IN | @{duts} +| | | Run Keyword | ${dut}.Add NAT | value=${nat_mode} +| | END + +| Add NAT max translations per thread to all DUTs +| | [Documentation] | Add NAT maximum number of translations per thread +| | ... | configuration. +| | +| | ... | *Arguments:* +| | ... | - max_translations_per_thread - NAT maximum number of translations per +| | ... | thread. Type: string +| | +| | ... | *Example:* +| | +| | ... | \| Add NAT translation memory to all DUTs \ +| | ... | \| max_translations_per_thread=2048 \| +| | +| | [Arguments] | ${max_translations_per_thread}=1024 +| | | | FOR | ${dut} | IN | @{duts} -| | | Run keyword | ${dut}.Add NAT +| | | Run Keyword | ${dut}.Add NAT max translations per thread +| | | ... | value=${max_translations_per_thread} | | END | Write startup configuration on all VPP DUTs | | [Documentation] | Write VPP startup configuration without restarting VPP. | | | | FOR | ${dut} | IN | @{duts} -| | | Run keyword | ${dut}.Write Config +| | | Run Keyword | ${dut}.Write Config | | END | Apply startup configuration on all VPP DUTs @@ -270,12 +299,12 @@ | | [Arguments] | ${with_trace}=${False} | | | | FOR | ${dut} | IN | @{duts} -| | | Run keyword | ${dut}.Apply Config +| | | Run Keyword | ${dut}.Apply Config | | END | | Save VPP PIDs | | Enable Coredump Limit VPP on All DUTs | ${nodes} | | Update All Interface Data On All Nodes | ${nodes} | skip_tg=${True} -| | Run keyword If | ${with_trace} | VPP Enable Traces On All Duts | ${nodes} +| | Run Keyword If | ${with_trace} | VPP Enable Traces On All Duts | ${nodes} | Apply startup configuration on VPP DUT | | [Documentation] | Write VPP startup configuration and restart VPP DUT. @@ -286,13 +315,13 @@ | | | | [Arguments] | ${dut} | ${with_trace}=${False} | | -| | Run keyword | ${dut}.Apply Config +| | Run Keyword | ${dut}.Apply Config | | Save VPP PIDs on DUT | ${dut} | | Enable Coredump Limit VPP on DUT | ${nodes['${dut}']} | | ${dutnode}= | Copy Dictionary | ${nodes} | | Keep In Dictionary | ${dutnode} | ${dut} | | Update All Interface Data On All Nodes | ${dutnode} | skip_tg=${True} -| | Run keyword If | ${with_trace} | VPP Enable Traces On Dut +| | Run Keyword If | ${with_trace} | VPP Enable Traces On Dut | | ... | ${nodes['${dut}']} | Save VPP PIDs @@ -335,7 +364,7 @@ | | ${err_msg}= | Catenate | ${SUITE NAME} - ${TEST NAME} | | ... | \nThe VPP PIDs are not equal!\nTest Setup VPP PIDs: | | ... | ${setup_vpp_pids}\nTest Teardown VPP PIDs: ${teardown_vpp_pids} -| | ${rc} | ${msg}= | Run keyword and ignore error +| | ${rc} | ${msg}= | Run Keyword And Ignore Error | | ... | Dictionaries Should Be Equal | | ... | ${setup_vpp_pids} | ${teardown_vpp_pids} | | Run Keyword And Return If | '${rc}'=='FAIL' | Log | ${err_msg} diff --git a/resources/libraries/robot/shared/test_teardown.robot b/resources/libraries/robot/shared/test_teardown.robot index b5cdab0664..5d71db4edc 100644 --- a/resources/libraries/robot/shared/test_teardown.robot +++ b/resources/libraries/robot/shared/test_teardown.robot @@ -110,6 +110,17 @@ | | | ... | Show NAT verbose | ${nodes['${dut}']} | | END +| Additional Test Tear Down Action For nat-ed +| | [Documentation] +| | ... | Additional teardown for tests which uses NAT feature. +| | +| | FOR | ${dut} | IN | @{duts} +| | | Show NAT Config | ${nodes['${dut}']} +| | | Show NAT44 Summary | ${nodes['${dut}']} +| | | Show NAT Base Data | ${nodes['${dut}']} +| | | Vpp Get Ip Table Summary | ${nodes['${dut}']} +| | END + | Additional Test Tear Down Action For namespace | | [Documentation] | | ... | Additional teardown for tests which uses namespace. -- cgit 1.2.3-korg