From 9f5525de03c3d1cbca8b7e2a324414308645a9f3 Mon Sep 17 00:00:00 2001 From: pmikus Date: Tue, 17 Aug 2021 14:03:58 +0000 Subject: vpp_device: Multiple NICs (suitegen) Signed-off-by: pmikus Change-Id: I81958fbf6ef240d53a0fb8708ca882baf02f606c --- .../libraries/bash/entry/bootstrap_vpp_device.sh | 5 +- resources/libraries/bash/entry/check/tc_naming.sh | 4 +- resources/libraries/bash/function/common.sh | 73 ++++------------------ resources/libraries/bash/function/device.sh | 4 +- 4 files changed, 18 insertions(+), 68 deletions(-) (limited to 'resources/libraries/bash') diff --git a/resources/libraries/bash/entry/bootstrap_vpp_device.sh b/resources/libraries/bash/entry/bootstrap_vpp_device.sh index 95708e888d..ae4c26a1ba 100755 --- a/resources/libraries/bash/entry/bootstrap_vpp_device.sh +++ b/resources/libraries/bash/entry/bootstrap_vpp_device.sh @@ -35,15 +35,16 @@ common_dirs || die check_prerequisites || die get_test_code "${1-}" || die get_test_tag_string || die -select_topology || die select_arch_os || die gather_build || die check_download_dir || die activate_virtualenv || die generate_tests || die archive_tests || die +prepare_topology || die +select_topology || die activate_docker_topology || die -select_vpp_device_tags || die +select_tags || die compose_pybot_arguments || die set_environment_variables || die run_pybot || die diff --git a/resources/libraries/bash/entry/check/tc_naming.sh b/resources/libraries/bash/entry/check/tc_naming.sh index bc2ac32671..f392ad7b9a 100644 --- a/resources/libraries/bash/entry/check/tc_naming.sh +++ b/resources/libraries/bash/entry/check/tc_naming.sh @@ -64,7 +64,7 @@ r_testc_rules=( #'(ipsec[[:digit:]]+tnlhw|ipsec[[:digit:]]+tnlsw|' #'srhip6|tcp|udp|lispip6|lispip4|vxlan){0,1}' #'(http){0,1}-' - '(.*)-(dev|ndrpdr|bps|cps|rps|reconf)$' + '(.*)-(scapy|ndrpdr|bps|cps|rps|reconf)$' ) s_suite_rules=( 'number of SUT nodes' @@ -83,7 +83,7 @@ r_suite_rules=( #'(ipsec[[:digit:]]+tnlhw|ipsec[[:digit:]]+tnlsw|' #'srhip6|tcp|udp|lispip6|lispip4|vxlan){0,1}' #'(http){0,1}-' - '(.*)-(dev|ndrpdr|bps|cps|rps|reconf)$' + '(.*)-(scapy|ndrpdr|bps|cps|rps|reconf)$' ) rm -f "tc_naming.log" || die diff --git a/resources/libraries/bash/function/common.sh b/resources/libraries/bash/function/common.sh index 68ad5ef926..ce0c526863 100644 --- a/resources/libraries/bash/function/common.sh +++ b/resources/libraries/bash/function/common.sh @@ -86,7 +86,7 @@ function activate_docker_topology () { die "Topology file create failed!" } - WORKING_TOPOLOGY="/tmp/topology.yaml" + WORKING_TOPOLOGY="${CSIT_DIR}/topologies/available/vpp_device.yaml" mv topo.yml "${WORKING_TOPOLOGY}" || { die "Topology move failed!" } @@ -864,6 +864,12 @@ function select_tags () { tfd="${JOB_SPECS_DIR}" case "${TEST_CODE}" in # Select specific performance tests based on jenkins job type variable. + *"vpp-device"* ) + readarray -t test_tag_array <<< $(grep -v "#" \ + ${tfd}/vpp_device/${DUT}-${NODENESS}-${FLAVOR}.md | + awk {"$awk_nics_sub_cmd"} || echo "devicetest") || die + SELECTION_MODE="--test" + ;; *"ndrpdr-weekly"* ) readarray -t test_tag_array <<< $(grep -v "#" \ ${tfd}/mlr_weekly/${DUT}-${NODENESS}-${FLAVOR}.md | @@ -922,6 +928,10 @@ function select_tags () { # Reasons for blacklisting: # - ipsechw - Blacklisted on testbeds without crypto hardware accelerator. case "${TEST_CODE}" in + *"1n-vbox"*) + test_tag_array+=("!avf") + test_tag_array+=("!vhost") + ;; *"2n-skx"*) test_tag_array+=("!ipsechw") ;; @@ -1084,67 +1094,6 @@ function select_topology () { } -function select_vpp_device_tags () { - - # Variables read: - # - TEST_CODE - String affecting test selection, usually jenkins job name. - # - TEST_TAG_STRING - String selecting tags, from gerrit comment. - # Can be unset. - # Variables set: - # - TAGS - Array of processed tag boolean expressions. - - set -exuo pipefail - - case "${TEST_CODE}" in - # Select specific device tests based on jenkins job type variable. - * ) - if [[ -z "${TEST_TAG_STRING-}" ]]; then - # If nothing is specified, we will run pre-selected tests by - # following tags. Items of array will be concatenated by OR - # in Robot Framework. - test_tag_array=() - else - # If trigger contains tags, split them into array. - test_tag_array=(${TEST_TAG_STRING//:/ }) - fi - SELECTION_MODE="--include" - ;; - esac - - # Blacklisting certain tags per topology. - # - # Reasons for blacklisting: - # - avf - AVF is not possible to run on enic driver of VirtualBox. - # - vhost - VirtualBox does not support nesting virtualization on Intel CPU. - case "${TEST_CODE}" in - *"1n-vbox"*) - test_tag_array+=("!avf") - test_tag_array+=("!vhost") - ;; - *) - ;; - esac - - TAGS=() - - # We will prefix with devicetest to prevent running other tests - # (e.g. Functional). - prefix="devicetestAND" - if [[ "${TEST_CODE}" == "vpp-"* ]]; then - # Automatic prefixing for VPP jobs to limit testing. - prefix="${prefix}" - fi - for tag in "${test_tag_array[@]}"; do - if [[ ${tag} == "!"* ]]; then - # Exclude tags are not prefixed. - TAGS+=("${tag}") - else - TAGS+=("${prefix}${tag}") - fi - done -} - - function set_environment_variables () { # Depending on testbed topology, overwrite defaults set in the diff --git a/resources/libraries/bash/function/device.sh b/resources/libraries/bash/function/device.sh index 8bfb2e458c..eab31a65a6 100644 --- a/resources/libraries/bash/function/device.sh +++ b/resources/libraries/bash/function/device.sh @@ -527,7 +527,7 @@ function parse_env_variables () { mac_address: "${TG_NETMACS[$((port-1))]}" pci_address: "${TG_PCIDEVS[$((port-1))]}" link: "link$((port-1))" - model: "${TG_MODELS[$((port-1))]}" + model: ${TG_MODELS[$((port-1))]} driver: "${TG_DRIVERS[$((port-1))]}" vlan: ${TG_VLANS[$((port-1))]} EOF @@ -540,7 +540,7 @@ EOF mac_address: "${DUT1_NETMACS[$((port-1))]}" pci_address: "${DUT1_PCIDEVS[$((port-1))]}" link: "link$((port-1))" - model: "${DUT1_MODELS[$((port-1))]}" + model: ${DUT1_MODELS[$((port-1))]} driver: "${DUT1_DRIVERS[$((port-1))]}" vlan: ${DUT1_VLANS[$((port-1))]} EOF -- cgit 1.2.3-korg