aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/python
diff options
context:
space:
mode:
authorYulong Pei <yulong.pei@intel.com>2020-06-03 00:32:40 +0800
committerVratko Polak <vrpolak@cisco.com>2020-06-30 11:03:49 +0000
commitb9457dab3abab7b16f5766c93de6d4d3ca0d03c2 (patch)
tree3a42200549b55fedef677c1407d6535c2fe94c6b /resources/libraries/python
parent4cbb1b7c9aa616e377b73b9d22ed2b5ac1735b65 (diff)
make graph node variant can be configured from gerrit trigger
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>
Diffstat (limited to 'resources/libraries/python')
-rw-r--r--resources/libraries/python/Constants.py4
-rw-r--r--resources/libraries/python/VppConfigGenerator.py16
2 files changed, 19 insertions, 1 deletions
diff --git a/resources/libraries/python/Constants.py b/resources/libraries/python/Constants.py
index ac3715b289..6bf503da51 100644
--- a/resources/libraries/python/Constants.py
+++ b/resources/libraries/python/Constants.py
@@ -203,6 +203,10 @@ class Constants:
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"
diff --git a/resources/libraries/python/VppConfigGenerator.py b/resources/libraries/python/VppConfigGenerator.py
index b769b89acd..f19294965a 100644
--- a/resources/libraries/python/VppConfigGenerator.py
+++ b/resources/libraries/python/VppConfigGenerator.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:
@@ -205,6 +205,20 @@ class VppConfigGenerator:
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.