From: Yulong Pei Date: Tue, 2 Jun 2020 16:32:40 +0000 (+0800) Subject: make graph node variant can be configured from gerrit trigger X-Git-Url: https://gerrit.fd.io/r/gitweb?p=csit.git;a=commitdiff_plain;h=b9457dab3abab7b16f5766c93de6d4d3ca0d03c2 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 --- diff --git a/resources/libraries/bash/function/common.sh b/resources/libraries/bash/function/common.sh index ec335f171f..f724e53ea0 100644 --- a/resources/libraries/bash/function/common.sh +++ b/resources/libraries/bash/function/common.sh @@ -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 + 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 } 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. diff --git a/resources/libraries/robot/shared/default.robot b/resources/libraries/robot/shared/default.robot index 609da92ca0..6e1e5416e2 100644 --- a/resources/libraries/robot/shared/default.robot +++ b/resources/libraries/robot/shared/default.robot @@ -156,6 +156,7 @@ | | | 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