perf: Add hoststack NSIM+LDPRELOAD+IPERF3 test suite 37/24337/31
authorDave Wallace <dwallacelf@gmail.com>
Wed, 15 Jan 2020 06:29:16 +0000 (06:29 +0000)
committerVratko Polak <vrpolak@cisco.com>
Thu, 30 Jan 2020 12:33:16 +0000 (12:33 +0000)
Change-Id: Ia7a876b1aa240676e1f2d23618c1d4e09ead14f0
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
resources/api/vpp/supported_crcs.yaml
resources/libraries/python/NsimUtil.py
resources/libraries/python/VppConfigGenerator.py
resources/libraries/python/autogen/Regenerator.py
resources/libraries/robot/hoststack/hoststack.robot
tests/vpp/perf/hoststack/10ge2p1x710-eth-ip4tcp-nsim-ldpreload-iperf3-bps.robot [new file with mode: 0644]

index ea4358e..f7a943b 100644 (file)
     nat_show_config_reply: '0x006a0786'  # perf teardown
     # 6x^ tc01-64B-1c-ethip4udp-ip4base-nat44-mrr
     # ^ nat44NOTscaleNOTsrc_user_1
+    nsim_configure: '0x16ed400f'  # perf
+    nsim_configure_reply: '0xe8d4e804'  # perf
+    nsim_output_feature_enable_disable: '0x3865946c'  # perf
+    nsim_output_feature_enable_disable_reply: '0xe8d4e804'  # perf
     policer_add_del: '0xdfea2be8'  # dev
     policer_add_del_reply: '0xa177cef2'  # dev
     policer_classify_set_interface: '0xde7ad708'  # dev
index 9d60a91..bd319e6 100644 (file)
 
 """VPP Network Simulator Plugin util library."""
 
-from robot.api import logger
-
-from resources.libraries.python.Constants import Constants
 from resources.libraries.python.PapiExecutor import PapiSocketExecutor
 from resources.libraries.python.InterfaceUtil import InterfaceUtil
 
 
-class NsimUtil(object):
+class NsimUtil():
     """VPP NSIM Plugin Keywords."""
 
     @staticmethod
@@ -33,14 +30,14 @@ class NsimUtil(object):
         :param interface1: 2nd Interface name for cross-connect feature
         :type node: dict
         :type vpp_nsim_attr: dict
-        :type interface0: string or int
-        :type interface1: string or int
+        :type interface0: str or int
+        :type interface1: str or int
         :raises RuntimeError: if no NSIM features are enabled or
                 vpp papi command fails.
         """
         host = node[u"host"]
-        if vpp_nsim_attr[u"output_feature_enable"] == False \
-                and vpp_nsim_attr[u"cross_connect_feature_enable"] == False:
+        if not vpp_nsim_attr[u"output_feature_enable"] \
+                and not vpp_nsim_attr[u"cross_connect_feature_enable"]:
             raise RuntimeError(f"No NSIM features enabled on host {host}:\n"
                                f"vpp_nsim_attr = {vpp_nsim_attr}")
         cmd = u"nsim_configure"
@@ -56,7 +53,7 @@ class NsimUtil(object):
         with PapiSocketExecutor(node) as papi_exec:
             papi_exec.add(cmd, **args).get_reply(err_msg)
 
-        if vpp_nsim_attr[u"output_feature_enable"] == True:
+        if vpp_nsim_attr[u"output_feature_enable"]:
             cmd = u"nsim_output_feature_enable_disable"
             args = dict(
                 enable_disable=vpp_nsim_attr[u"output_feature_enable"],
@@ -67,7 +64,7 @@ class NsimUtil(object):
             with PapiSocketExecutor(node) as papi_exec:
                 papi_exec.add(cmd, **args).get_reply(err_msg)
 
-        elif vpp_nsim_attr[u"cross_connect_feature_enable"] == True:
+        elif vpp_nsim_attr[u"cross_connect_feature_enable"]:
             cmd = u"nsim_cross_connect_feature_enable_disable"
             args = dict(
                 enable_disable=vpp_nsim_attr[u"cross_connect_feature_enable"],
index 7a687ae..b769b89 100644 (file)
@@ -495,6 +495,11 @@ class VppConfigGenerator:
         path = [u"nat"]
         self.add_config_item(self._nodeconfig, value, path)
 
+    def add_nsim_poll_main_thread(self):
+        """Add NSIM poll-main-thread configuration."""
+        path = [u"nsim", u"poll-main-thread"]
+        self.add_config_item(self._nodeconfig, u"", path)
+
     def add_tcp_congestion_control_algorithm(self, value=u"cubic"):
         """Add TCP congestion control algorithm.
 
index f065887..3ef4e85 100644 (file)
@@ -512,10 +512,12 @@ class Regenerator:
             elif in_filename[-10:] in (u"-cps.robot", u"-rps.robot"):
                 write_tcp_files(in_filename, in_prolog,
                                 hoststack_wrk_kwargs_list)
-            elif in_filename[-10:] in u"-bps.robot":
-                write_tcp_files(in_filename, in_prolog,
-                                hoststack_iperf3_kwargs_list if u"iperf3"
-                                in in_filename else hoststack_quic_kwargs_list)
+            elif in_filename[-10:] in (u"-bps.robot"):
+                if u"ldpreload-iperf3" in in_filename:
+                    hoststack_kwargs_list = hoststack_iperf3_kwargs_list
+                else:
+                    hoststack_kwargs_list = hoststack_quic_kwargs_list
+                write_tcp_files(in_filename, in_prolog, hoststack_kwargs_list)
             else:
                 raise RuntimeError(
                     f"Error in {in_filename}: non-primary suite type found."
index e765169..16a390a 100644 (file)
 | | | ... | ${namespace} | ${core_list} | ${cfg_vpp_feature}
 | | | ... | ${test_program}
 | |
-| | Run Keyword If | ${vpp_nsim_attr}[output_feature_enable]
+| | ${is_dut1}= | Run Keyword And Return Status
+| | ... | Dictionaries should be equal | ${node} | ${dut1}
+| | Run Keyword If
+| | ... | ${is_dut1} and ${vpp_nsim_attr}[output_feature_enable]
 | | ... | Configure VPP NSIM | ${node} | ${vpp_nsim_attr} | ${intf}
 | | Run Keyword If | '${cfg_vpp_feature}' != ''
 | | ... | Additional VPP Config for Feature ${cfg_vpp_feature} | ${node}
 | | | ... | ${vpp_hoststack_attr}[api_seg_global_size]
 | | | Run keyword | ${dut}.Add api segment api size
 | | | ... | ${vpp_hoststack_attr}[api_seg_api_size]
+| | | Run Keyword If
+| | | ... | '${dut}' == 'DUT1' and ${vpp_nsim_attr}[output_feature_enable]
+| | | ... | ${dut}.Add Nsim poll main thread
 | | | Run keyword | ${dut}.Add api segment gid | testuser
 | | | Run keyword | ${dut}.Add tcp congestion control algorithm
 | | | ... | ${vpp_hoststack_attr}[tcp_cc_algo]
diff --git a/tests/vpp/perf/hoststack/10ge2p1x710-eth-ip4tcp-nsim-ldpreload-iperf3-bps.robot b/tests/vpp/perf/hoststack/10ge2p1x710-eth-ip4tcp-nsim-ldpreload-iperf3-bps.robot
new file mode 100644 (file)
index 0000000..0a98ee3
--- /dev/null
@@ -0,0 +1,66 @@
+# 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:
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+*** Settings ***
+| Library  | resources.libraries.python.HoststackUtil
+| Resource | resources/libraries/robot/shared/default.robot
+| Resource | resources/libraries/robot/hoststack/hoststack.robot
+|
+| Force Tags | 3_NODE_SINGLE_LINK_TOPO | PERFTEST | HW_ENV
+| ... | TCP | NIC_Intel-X710 | DRV_VFIO_PCI | HOSTSTACK
+| ... | NSIM | LDPRELOAD | IPERF3 | eth-ip4tcp-nsim-ldpreload-iperf3
+|
+| Suite Setup | Setup suite single link no tg
+| Suite Teardown | Tear down suite
+| Test Setup | Setup test
+| Test Teardown | Tear down test
+|
+| Test Template | Local template
+|
+| Documentation | *Iperf3 client -> Iperf3 server throughput.
+|
+| ... | *[Top] Network Topologies:* DUT-DUT 2-node topology
+| ... | with single link between nodes.
+| ... | *[Enc] Packet Encapsulations:* Eth-IPv4-TCP
+| ... | *[Cfg] DUT configuration:*
+| ... | *[Ref] Applicable standard specifications:*
+
+*** Variables ***
+| @{plugins_to_enable}= | dpdk_plugin.so | nsim_plugin.so
+| ${nic_name}= | Intel-X710
+| ${nic_driver}= | vfio-pci
+| ${overhead}= | ${0}
+| ${frame_size}= | ${9000}
+| ${crypto_type}= | ${None}
+| ${pkts_per_drop}= | ${100}
+
+*** Keywords ***
+| Local template
+| | [Arguments] | ${phy_cores} | ${clients} |  ${streams}
+| |
+| | Set VPP Hoststack Attributes | phy_cores=${phy_cores}
+| | Set Iperf3 Client Attributes | parallel=${streams}
+| | Set VPP NSIM Attributes | output_feature_enable=${True} |
+| | ... | packets_per_drop=${pkts_per_drop}
+| | ${no_results}= | Get Test Results From Hoststack Iperf3 Test
+| | Run Keyword If | ${no_results}==True | FAIL
+| | ... | No Test Results From Iperf3 client
+
+*** Test Cases ***
+| tc01-9000B-1c-eth-ip4tcp-nsim-ldpreload-iperf3-bps
+| | [Tags] | 1C | 1CLIENT | 1STREAM
+| | phy_cores=${1} | clients=${1} | streams=${1}
+
+| tc02-9000B-1c-eth-ip4tcp-nsim-ldpreload-iperf3-bps
+| | [Tags] | 1C | 1CLIENT | 10STREAM
+| | phy_cores=${1} | clients=${1} | streams=${10}