# Fail if there are no files visible in ${DOWNLOAD_DIR}.
#
# Variables read:
- # - DOWNLOAD_DIR - Path to directory pybot takes the build to test from.
+ # - DOWNLOAD_DIR - Path to directory robot takes the build to test from.
# Directories read:
# - ${DOWNLOAD_DIR} - Has to be non-empty to proceed.
# Functions called:
TOOLS_DIR=$(readlink -e "${RESOURCES_DIR}/tools") || {
die "Readlink failed."
}
- DOC_GEN_DIR=$(readlink -e "${TOOLS_DIR}/doc_gen") || {
- die "Readlink failed."
- }
PYTHON_SCRIPTS_DIR=$(readlink -e "${TOOLS_DIR}/scripts") || {
die "Readlink failed."
}
}
-function compose_pybot_arguments () {
+function compose_robot_arguments () {
# Variables read:
# - WORKING_TOPOLOGY - Path to topology yaml file of the reserved testbed.
# - TEST_CODE - The test selection string from environment or argument.
# - SELECTION_MODE - Selection criteria [test, suite, include, exclude].
# Variables set:
- # - PYBOT_ARGS - String holding part of all arguments for pybot.
- # - EXPANDED_TAGS - Array of strings pybot arguments compiled from tags.
+ # - ROBOT_ARGS - String holding part of all arguments for robot.
+ # - EXPANDED_TAGS - Array of strings robot arguments compiled from tags.
set -exuo pipefail
# No explicit check needed with "set -u".
- PYBOT_ARGS=("--loglevel" "TRACE")
- PYBOT_ARGS+=("--variable" "TOPOLOGY_PATH:${WORKING_TOPOLOGY}")
+ ROBOT_ARGS=("--loglevel" "TRACE")
+ ROBOT_ARGS+=("--variable" "TOPOLOGY_PATH:${WORKING_TOPOLOGY}")
case "${TEST_CODE}" in
*"device"*)
- PYBOT_ARGS+=("--suite" "tests.${DUT}.device")
+ ROBOT_ARGS+=("--suite" "tests.${DUT}.device")
;;
*"perf"*)
- PYBOT_ARGS+=("--suite" "tests.${DUT}.perf")
+ ROBOT_ARGS+=("--suite" "tests.${DUT}.perf")
;;
*)
die "Unknown specification: ${TEST_CODE}"
}
-function die_on_pybot_error () {
+function die_on_robot_error () {
# Source this fragment if you want to abort on any failed test case.
#
# Variables read:
- # - PYBOT_EXIT_STATUS - Set by a pybot running fragment.
+ # - ROBOT_EXIT_STATUS - Set by a robot running fragment.
# Functions called:
# - die - Print to stderr and exit.
set -exuo pipefail
- if [[ "${PYBOT_EXIT_STATUS}" != "0" ]]; then
- die "Test failures are present!" "${PYBOT_EXIT_STATUS}"
+ if [[ "${ROBOT_EXIT_STATUS}" != "0" ]]; then
+ die "Test failures are present!" "${ROBOT_EXIT_STATUS}"
fi
}
# within any subdirectory after copying.
# This is a separate function, because this code is called
- # both by autogen checker and entries calling run_pybot.
+ # both by autogen checker and entries calling run_robot.
# Directories read:
# - ${CSIT_DIR}/tests - Used as templates for the generated tests.
NODENESS="3n"
FLAVOR="aws"
;;
+ *"1n-c6gn"*)
+ NODENESS="1n"
+ FLAVOR="c6gn"
+ ;;
+ *"2n-c6gn"*)
+ NODENESS="2n"
+ FLAVOR="c6gn"
+ ;;
+ *"3n-c6gn"*)
+ NODENESS="3n"
+ FLAVOR="c6gn"
+ ;;
+ *"1n-c6in"*)
+ NODENESS="1n"
+ FLAVOR="c6in"
+ ;;
+ *"2n-c6in"*)
+ NODENESS="2n"
+ FLAVOR="c6in"
+ ;;
+ *"3n-c6in"*)
+ NODENESS="3n"
+ FLAVOR="c6in"
+ ;;
*"2n-zn2"*)
NODENESS="2n"
FLAVOR="zn2"
}
-function post_process_robot_outputs () {
-
- # Generate INFO level output_info.xml by rebot.
- #
- # Variables read:
- # - ARCHIVE_DIR - Path to post-processed files.
-
- set -exuo pipefail
-
- # Generate INFO level output_info.xml for post-processing.
- all_options=("--loglevel" "INFO")
- all_options+=("--log" "none")
- all_options+=("--report" "none")
- all_options+=("--output" "${ARCHIVE_DIR}/output_info.xml")
- all_options+=("${ARCHIVE_DIR}/output.xml")
- rebot "${all_options[@]}" || true
-}
-
-
function prepare_topology () {
# Prepare virtual testbed topology if needed based on flavor.
export TF_VAR_testbed_name="${TEST_CODE}"
TERRAFORM_MODULE_DIR="terraform-aws-${NODENESS}-${FLAVOR}-c5n"
terraform_init || die "Failed to call terraform init."
- trap 'terraform_destroy' ERR || {
+ trap "terraform_destroy" ERR EXIT || {
+ die "Trap attempt failed, please cleanup manually. Aborting!"
+ }
+ terraform_apply || die "Failed to call terraform apply."
+ ;;
+ "1n_c6gn" | "2n_c6gn" | "3n_c6gn")
+ export TF_VAR_testbed_name="${TEST_CODE}"
+ TERRAFORM_MODULE_DIR="terraform-aws-${NODENESS}-c6gn"
+ terraform_init || die "Failed to call terraform init."
+ trap "terraform_destroy" ERR EXIT || {
+ die "Trap attempt failed, please cleanup manually. Aborting!"
+ }
+ terraform_apply || die "Failed to call terraform apply."
+ ;;
+ "1n_c6in" | "2n_c6in" | "3n_c6in")
+ export TF_VAR_testbed_name="${TEST_CODE}"
+ TERRAFORM_MODULE_DIR="terraform-aws-${NODENESS}-c6in"
+ terraform_init || die "Failed to call terraform init."
+ trap "terraform_destroy" ERR EXIT || {
die "Trap attempt failed, please cleanup manually. Aborting!"
}
terraform_apply || die "Failed to call terraform apply."
}
-function run_pybot () {
+function run_robot () {
- # Run pybot with options based on input variables.
- # Generate INFO level output_info.xml by rebot.
+ # Run robot with options based on input variables.
#
# Variables read:
# - CSIT_DIR - Path to existing root of local CSIT git repository.
# - ARCHIVE_DIR - Path to store robot result files in.
- # - PYBOT_ARGS, EXPANDED_TAGS - See compose_pybot_arguments.sh
+ # - ROBOT_ARGS, EXPANDED_TAGS - See compose_robot_arguments.sh
# - GENERATED_DIR - Tests are assumed to be generated under there.
# Variables set:
- # - PYBOT_EXIT_STATUS - Exit status of most recent pybot invocation.
+ # - ROBOT_EXIT_STATUS - Exit status of most recent robot invocation.
# Functions called:
# - die - Print to stderr and exit.
set -exuo pipefail
- all_options=("--outputdir" "${ARCHIVE_DIR}" "${PYBOT_ARGS[@]}")
+ all_options=("--outputdir" "${ARCHIVE_DIR}" "${ROBOT_ARGS[@]}")
all_options+=("${EXPANDED_TAGS[@]}")
pushd "${CSIT_DIR}" || die "Change directory operation failed."
set +e
robot "${all_options[@]}" "${GENERATED_DIR}/tests/"
- PYBOT_EXIT_STATUS="$?"
+ ROBOT_EXIT_STATUS="$?"
set -e
- post_process_robot_outputs || die
-
popd || die "Change directory operation failed."
}
# NIC SELECTION
case "${TEST_CODE}" in
- *"1n-aws"*)
+ *"1n-aws"* | *"1n-c6gn"* | *"1n-c6in"*)
start_pattern='^ SUT:'
;;
*)
default_nic="nic_intel-x520-da2"
;;
*"3n-icx"* | *"2n-icx"*)
- default_nic="nic_intel-xxv710"
+ default_nic="nic_intel-e810cq"
;;
*"3na-spr"*)
default_nic="nic_mellanox-cx7veat"
*"1n-aws"* | *"2n-aws"* | *"3n-aws"*)
default_nic="nic_amazon-nitro-50g"
;;
+ *"1n-c6gn"* | *"2n-c6gn"* | *"3n-c6gn"*)
+ default_nic="nic_amazon-nitro-100g"
+ ;;
+ *"1n-c6in"* | *"2n-c6in"* | *"3n-c6in"*)
+ default_nic="nic_amazon-nitro-200g"
+ ;;
*)
default_nic="nic_intel-x710"
;;
awk_nics_sub_cmd+='gsub("x520-da2","10ge2p1x520");'
awk_nics_sub_cmd+='gsub("cx556a","100ge2p1cx556a");'
awk_nics_sub_cmd+='gsub("cx7veat","200ge2p1cx7veat");'
+ awk_nics_sub_cmd+='gsub("cx6dx","100ge2p1cx6dx");'
awk_nics_sub_cmd+='gsub("e810cq","100ge2p1e810cq");'
awk_nics_sub_cmd+='gsub("vic1227","10ge2p1vic1227");'
awk_nics_sub_cmd+='gsub("vic1385","40ge2p1vic1385");'
awk_nics_sub_cmd+='gsub("nitro-50g","50ge1p1ENA");'
+ awk_nics_sub_cmd+='gsub("nitro-100g","100ge1p1ENA");'
+ awk_nics_sub_cmd+='gsub("nitro-200g","200ge1p1ENA");'
awk_nics_sub_cmd+='if ($9 =="drv_avf") drv="avf-";'
awk_nics_sub_cmd+='else if ($9 =="drv_rdma_core") drv ="rdma-";'
awk_nics_sub_cmd+='else if ($9 =="drv_mlx5_core") drv ="mlx5-";'
*"1n-aws"* | *"2n-aws"* | *"3n-aws"*)
test_tag_array+=("!ipsechw")
;;
+ *"1n-c6gn"* | *"2n-c6gn"* | *"3n-c6gn"*)
+ test_tag_array+=("!ipsechw")
+ ;;
+ *"1n-c6in"* | *"2n-c6in"* | *"3n-c6in"*)
+ test_tag_array+=("!ipsechw")
+ ;;
esac
# We will add excluded NICs.
TOPOLOGIES=( "${TOPOLOGIES_DIR}"/*3n-aws*.yaml )
TOPOLOGIES_TAGS="3_node_single_link_topo"
;;
+ "1n_c6gn")
+ TOPOLOGIES=( "${TOPOLOGIES_DIR}"/*1n-c6gn*.yaml )
+ TOPOLOGIES_TAGS="1_node_single_link_topo"
+ ;;
+ "2n_c6gn")
+ TOPOLOGIES=( "${TOPOLOGIES_DIR}"/*2n-c6gn*.yaml )
+ TOPOLOGIES_TAGS="2_node_single_link_topo"
+ ;;
+ "3n_c6gn")
+ TOPOLOGIES=( "${TOPOLOGIES_DIR}"/*3n-c6gn*.yaml )
+ TOPOLOGIES_TAGS="3_node_single_link_topo"
+ ;;
+ "1n_c6in")
+ TOPOLOGIES=( "${TOPOLOGIES_DIR}"/*1n-c6in*.yaml )
+ TOPOLOGIES_TAGS="1_node_single_link_topo"
+ ;;
+ "2n_c6in")
+ TOPOLOGIES=( "${TOPOLOGIES_DIR}"/*2n-c6in*.yaml )
+ TOPOLOGIES_TAGS="2_node_single_link_topo"
+ ;;
+ "3n_c6in")
+ TOPOLOGIES=( "${TOPOLOGIES_DIR}"/*3n-c6in*.yaml )
+ TOPOLOGIES_TAGS="3_node_single_link_topo"
+ ;;
*)
# No falling back to default, that should have been done
# by the function which has set NODENESS and FLAVOR.
case "${TEST_CODE}" in
*"1n-aws"* | *"2n-aws"* | *"3n-aws"*)
- # T-Rex 2.88+ workaround for ENA NICs.
+ export TREX_RX_DESCRIPTORS_COUNT=1024
+ export TREX_EXTRA_CMDLINE="--mbuf-factor 19"
+ export TREX_CORE_COUNT=6
+ # Settings to prevent duration stretching.
+ export PERF_TRIAL_STL_DELAY=0.1
+ ;;
+ *"1n-c6gn"* | *"2n-c6gn"* | *"3n-c6gn"*)
+ export TREX_RX_DESCRIPTORS_COUNT=1024
+ export TREX_EXTRA_CMDLINE="--mbuf-factor 19"
+ export TREX_CORE_COUNT=6
+ # Settings to prevent duration stretching.
+ export PERF_TRIAL_STL_DELAY=0.1
+ ;;
+ *"1n-c6in"* | *"2n-c6in"* | *"3n-c6in"*)
export TREX_RX_DESCRIPTORS_COUNT=1024
export TREX_EXTRA_CMDLINE="--mbuf-factor 19"
export TREX_CORE_COUNT=6
TERRAFORM_MODULE_DIR="terraform-aws-${NODENESS}-${FLAVOR}-c5n"
terraform_destroy || die "Failed to call terraform destroy."
;;
+ *"1n-c6gn"* | *"2n-c6gn"* | *"3n-c6gn"*)
+ TERRAFORM_MODULE_DIR="terraform-aws-${NODENESS}-${FLAVOR}"
+ terraform_destroy || die "Failed to call terraform destroy."
+ ;;
+ *"1n-c6in"* | *"2n-c6in"* | *"3n-c6in"*)
+ TERRAFORM_MODULE_DIR="terraform-aws-${NODENESS}-${FLAVOR}"
+ terraform_destroy || die "Failed to call terraform destroy."
+ ;;
*)
;;
esac