X-Git-Url: https://gerrit.fd.io/r/gitweb?p=csit.git;a=blobdiff_plain;f=resources%2Flibraries%2Fbash%2Ffunction%2Fcommon.sh;h=399b449fa0cde16ac3a778d2356952e9847c792a;hp=eaad2ab3d5f206a1df1893c4f9b477c1a0acc9f5;hb=ea6e8be86d47b288df5e11ca5515f6bda71dbd08;hpb=cc0c2870a18fb74a56410eca2d1870bddc945397 diff --git a/resources/libraries/bash/function/common.sh b/resources/libraries/bash/function/common.sh index eaad2ab3d5..399b449fa0 100644 --- a/resources/libraries/bash/function/common.sh +++ b/resources/libraries/bash/function/common.sh @@ -33,6 +33,7 @@ function activate_docker_topology () { # - TOPOLOGIES - Available topologies. # - NODENESS - Node multiplicity of desired testbed. # - FLAVOR - Node flavor string, usually describing the processor. + # - IMAGE_VER_FILE - Name of file that contains the image version. # Variables set: # - WORKING_TOPOLOGY - Path to topology file. @@ -40,7 +41,7 @@ function activate_docker_topology () { die "Source failed!" } - device_image="$(< ${CSIT_DIR}/VPP_DEVICE_IMAGE)" + device_image="$(< ${CSIT_DIR}/${IMAGE_VER_FILE})" case_text="${NODENESS}_${FLAVOR}" case "${case_text}" in "1n_skx") @@ -660,12 +661,15 @@ function select_tags () { case "${TEST_CODE}" in *"3n-hsw"*) test_tag_array+=("!drv_avf") + test_tag_array+=("!ipsechwNOTnic_intel-xl710") ;; *"2n-skx"*) test_tag_array+=("!ipsechw") ;; *"3n-skx"*) test_tag_array+=("!ipsechw") + # Not enough nic_intel-xxv710 to support double link tests. + test_tag_array+=("!3_node_double_link_topoANDnic_intel-xxv710") ;; *"3n-tsh"*) test_tag_array+=("!ipsechw") @@ -688,10 +692,15 @@ function select_tags () { # We will prefix with perftest to prevent running other tests # (e.g. Functional). prefix="perftestAND" + set +x if [[ "${TEST_CODE}" == "vpp-"* ]]; then # Automatic prefixing for VPP jobs to limit the NIC used and # traffic evaluation to MRR. - prefix="${prefix}mrrAND${DEFAULT_NIC}AND" + if [[ "${TEST_TAG_STRING-}" == *"nic_"* ]]; then + prefix="${prefix}mrrAND" + else + prefix="${prefix}mrrAND${DEFAULT_NIC}AND" + fi fi for tag in "${test_tag_array[@]}"; do if [[ "${tag}" == "!"* ]]; then @@ -703,6 +712,7 @@ function select_tags () { TAGS+=("${prefix}${tag}") fi done + set -x } @@ -751,6 +761,34 @@ function select_vpp_device_tags () { done } +function select_os () { + + set -exuo pipefail + + # Variables read: + # - OS - os or distro for selecting container image. + # Variables set: + # - VPP_VER_FILE - Name of File in CSIT dir containing vpp stable version. + # - IMAGE_VER_FILE - Name of File in CSIT dir containing the image name. + # - PKG_SUFFIX - Suffix of OS package file name, "rpm" or "deb." + + case "${OS}" in + "ubuntu"*) + IMAGE_VER_FILE="VPP_DEVICE_IMAGE_UBUNTU" + VPP_VER_FILE="VPP_STABLE_VER_UBUNTU_BIONIC" + PKG_SUFFIX="deb" + ;; + "centos"*) + IMAGE_VER_FILE="VPP_DEVICE_IMAGE_CENTOS" + VPP_VER_FILE="VPP_STABLE_VER_CENTOS" + PKG_SUFFIX="rpm" + ;; + *) + die "Unable to identify distro or os from ${OS}" + ;; + esac +} + function select_topology () { @@ -770,45 +808,27 @@ function select_topology () { case_text="${NODENESS}_${FLAVOR}" case "${case_text}" in "1n_vbox") - TOPOLOGIES=( - "${TOPOLOGIES_DIR}/vpp_device.template" - ) + TOPOLOGIES=( "${TOPOLOGIES_DIR}"/*vpp_device*.template ) TOPOLOGIES_TAGS="2_node_single_link_topo" ;; "1n_skx") - TOPOLOGIES=( - "${TOPOLOGIES_DIR}/vpp_device.template" - ) + TOPOLOGIES=( "${TOPOLOGIES_DIR}"/*vpp_device*.template ) TOPOLOGIES_TAGS="2_node_single_link_topo" ;; "2n_skx") - TOPOLOGIES=( - "${TOPOLOGIES_DIR}/lf_2n_skx_testbed21.yaml" - #"${TOPOLOGIES_DIR}/lf_2n_skx_testbed22.yaml" - "${TOPOLOGIES_DIR}/lf_2n_skx_testbed23.yaml" - "${TOPOLOGIES_DIR}/lf_2n_skx_testbed24.yaml" - ) + TOPOLOGIES=( "${TOPOLOGIES_DIR}"/*2n_skx*.yaml ) TOPOLOGIES_TAGS="2_node_*_link_topo" ;; "3n_skx") - TOPOLOGIES=( - "${TOPOLOGIES_DIR}/lf_3n_skx_testbed31.yaml" - "${TOPOLOGIES_DIR}/lf_3n_skx_testbed32.yaml" - ) + TOPOLOGIES=( "${TOPOLOGIES_DIR}"/*3n_skx*.yaml ) TOPOLOGIES_TAGS="3_node_*_link_topo" ;; "3n_hsw") - TOPOLOGIES=( - "${TOPOLOGIES_DIR}/lf_3n_hsw_testbed1.yaml" - "${TOPOLOGIES_DIR}/lf_3n_hsw_testbed2.yaml" - "${TOPOLOGIES_DIR}/lf_3n_hsw_testbed3.yaml" - ) + TOPOLOGIES=( "${TOPOLOGIES_DIR}"/*3n_hsw*.yaml ) TOPOLOGIES_TAGS="3_node_single_link_topo" ;; "3n_tsh") - TOPOLOGIES=( - "${TOPOLOGIES_DIR}/lf_3n_tsh_testbed33.yaml" - ) + TOPOLOGIES=( "${TOPOLOGIES_DIR}"/*3n_tsh*.yaml ) TOPOLOGIES_TAGS="3_node_*_link_topo" ;; *)