make graph node variant can be configured from gerrit trigger 96/27396/7
authorYulong Pei <yulong.pei@intel.com>
Tue, 2 Jun 2020 16:32:40 +0000 (00:32 +0800)
committerVratko Polak <vrpolak@cisco.com>
Tue, 30 Jun 2020 11:03:49 +0000 (11:03 +0000)
for example, below will trigger VPP with default code path test in CSIT,
"csit-2n-clx-perftest mrrAND64bANDnic_intel-xxv710ANDeth-l2bdbasemaclrnNOTdrv_avf"
and below will trigger VPP with avx512 code path test in CSIT,
"csit-2n-clx-perftest icl mrrAND64bANDnic_intel-xxv710ANDeth-l2bdbasemaclrnNOTdrv_avf"

Change-Id: Id3abf932203ce00f34f8643c5bc4d5fc4d3e6efb
Signed-off-by: Yulong Pei <yulong.pei@intel.com>
resources/libraries/bash/function/common.sh
resources/libraries/python/Constants.py
resources/libraries/python/VppConfigGenerator.py
resources/libraries/robot/shared/default.robot

index ec335f1..f724e53 100644 (file)
@@ -524,6 +524,19 @@ function get_test_tag_string () {
         cmd=("grep" "-oP" '\S*'"${trigger}"'\S*\s\K.+$') || die "Unset trigger?"
         # On parsing error, TEST_TAG_STRING probably stays empty.
         TEST_TAG_STRING=$("${cmd[@]}" <<< "${comment}") || true
         cmd=("grep" "-oP" '\S*'"${trigger}"'\S*\s\K.+$') || die "Unset trigger?"
         # On parsing error, TEST_TAG_STRING probably stays empty.
         TEST_TAG_STRING=$("${cmd[@]}" <<< "${comment}") || true
+        if [[ -n "${TEST_TAG_STRING-}" ]]; then
+            test_tag_array=(${TEST_TAG_STRING})
+            if [[ "${test_tag_array[0]}" == "icl" ]]; then
+                export GRAPH_NODE_VARIANT="icl"
+                TEST_TAG_STRING="${test_tag_array[@]:1}" || true
+            elif [[ "${test_tag_array[0]}" == "skx" ]]; then
+                export GRAPH_NODE_VARIANT="skx"
+                TEST_TAG_STRING="${test_tag_array[@]:1}" || true
+            elif [[ "${test_tag_array[0]}" == "hsw" ]]; then
+                export GRAPH_NODE_VARIANT="hsw"
+                TEST_TAG_STRING="${test_tag_array[@]:1}" || true
+            fi
+        fi
     fi
 }
 
     fi
 }
 
index ac3715b..6bf503d 100644 (file)
@@ -203,6 +203,10 @@ class Constants:
     TREX_EXTRA_CMDLINE = get_str_from_env(
         u"TREX_EXTRA_CMDLINE", u"--mbuf-factor 32")
 
     TREX_EXTRA_CMDLINE = get_str_from_env(
         u"TREX_EXTRA_CMDLINE", u"--mbuf-factor 32")
 
+    # graph node variant value
+    GRAPH_NODE_VARIANT = get_str_from_env(
+        u"GRAPH_NODE_VARIANT", u"")
+
     # Sysctl kernel.core_pattern
     KERNEL_CORE_PATTERN = u"/tmp/%p-%u-%g-%s-%t-%h-%e.core"
 
     # Sysctl kernel.core_pattern
     KERNEL_CORE_PATTERN = u"/tmp/%p-%u-%g-%s-%t-%h-%e.core"
 
index b769b89..f192949 100644 (file)
@@ -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:
 # 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:
@@ -205,6 +205,20 @@ class VppConfigGenerator:
         path = [u"socksvr", u"socket-name"]
         self.add_config_item(self._nodeconfig, socket, path)
 
         path = [u"socksvr", u"socket-name"]
         self.add_config_item(self._nodeconfig, socket, path)
 
+    def add_graph_node_variant(self, variant=Constants.GRAPH_NODE_VARIANT):
+        """Add default graph node variant.
+
+        :param value: Graph node variant default value.
+        :type value: str
+        """
+        if variant == u"":
+            return
+        variant_list = [u"hsw", u"skx", u"icl"]
+        if variant not in variant_list:
+            raise ValueError("Invalid graph node variant value")
+        path = [u"node", u"default", u"variant"]
+        self.add_config_item(self._nodeconfig, variant, path)
+
     def add_api_segment_gid(self, value=u"vpp"):
         """Add API-SEGMENT gid configuration.
 
     def add_api_segment_gid(self, value=u"vpp"):
         """Add API-SEGMENT gid configuration.
 
index 609da92..6e1e541 100644 (file)
 | | | 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 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
 | | END
 
 | Add worker threads to all DUTs