aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries
diff options
context:
space:
mode:
authorNaveen Joy <najoy@cisco.com>2023-09-25 15:17:42 -0700
committerDave Wallace <dwallacelf@gmail.com>2023-10-30 13:36:11 +0000
commit4e0ee1b55e6db6d54ad468df42044e853c9272c4 (patch)
tree5a9997ab49be47a4f93ea0de0d90c453ac9a43ad /resources/libraries
parent4f981f97cfe4d61fc156c806a429d8dd9d261a4f (diff)
code and doc updates for vagrant VM dev/test environ setup
Change-Id: I0e4e4758b3abbfc2fe2e18200b85477293de218b Signed-off-by: Naveen Joy <najoy@cisco.com> Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Diffstat (limited to 'resources/libraries')
-rw-r--r--resources/libraries/bash/function/common.sh51
-rw-r--r--resources/libraries/bash/function/device.sh4
-rw-r--r--resources/libraries/python/Constants.py5
-rw-r--r--resources/libraries/python/SetupFramework.py2
4 files changed, 37 insertions, 25 deletions
diff --git a/resources/libraries/bash/function/common.sh b/resources/libraries/bash/function/common.sh
index 78a99dae0d..9db0ac8dcb 100644
--- a/resources/libraries/bash/function/common.sh
+++ b/resources/libraries/bash/function/common.sh
@@ -311,31 +311,37 @@ function deactivate_docker_topology () {
# Variables read:
# - NODENESS - Node multiplicity of desired testbed.
# - FLAVOR - Node flavor string, usually describing the processor.
+ # - CSIT_NO_CLEANUP - Variable to disable cleaning up the environment.
set -exuo pipefail
- case_text="${NODENESS}_${FLAVOR}"
- case "${case_text}" in
- "1n_skx" | "1n_tx2" | "1n_spr")
- ssh="ssh root@172.17.0.1 -p 6022"
- env_vars=$(env | grep CSIT_ | tr '\n' ' ' ) || die
- # The "declare -f" output is long and boring.
- set +x
- ${ssh} "$(declare -f); deactivate_wrapper ${env_vars}" || {
- die "Topology cleanup via shim-dcr failed!"
- }
- set -x
- ;;
- "1n_vbox")
- enter_mutex || die
- clean_environment || {
- die "Topology cleanup locally failed!"
- }
- exit_mutex || die
- ;;
- *)
- die "Unknown specification: ${case_text}!"
- esac
+ if [[ ${CSIT_NO_CLEANUP:-0} -eq 0 ]]; then
+ case_text="${NODENESS}_${FLAVOR}"
+ case "${case_text}" in
+ "1n_skx" | "1n_tx2" | "1n_spr")
+ ssh="ssh root@172.17.0.1 -p 6022"
+ env_vars=$(env | grep CSIT_ | tr '\n' ' ' ) || die
+ # The "declare -f" output is long and boring.
+ set +x
+ ${ssh} "$(declare -f); deactivate_wrapper ${env_vars}" || {
+ die "Topology cleanup via shim-dcr failed!"
+ }
+ set -x
+ ;;
+ "1n_vbox")
+ enter_mutex || die
+ clean_environment || {
+ die "Topology cleanup locally failed!"
+ }
+ exit_mutex || die
+ ;;
+ *)
+ die "Unknown specification: ${case_text}!"
+ esac
+ else
+ echo "CSIT_NO_CLEANUP environment variable is set"
+ echo "Environment Cleanup Abandoned"
+ fi
}
@@ -939,6 +945,7 @@ function select_tags () {
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+='gsub("virtual","1ge1p82540em");'
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-";'
diff --git a/resources/libraries/bash/function/device.sh b/resources/libraries/bash/function/device.sh
index 334fd04bfa..9bf4a85c3b 100644
--- a/resources/libraries/bash/function/device.sh
+++ b/resources/libraries/bash/function/device.sh
@@ -705,7 +705,7 @@ function set_env_variables () {
CSIT_TG_HOST="$(hostname --all-ip-addresses | awk '{print $1}')" || {
die "Reading hostname IP address failed!"
}
- CSIT_TG_PORT="${DCR_PORTS[tg]#*:}"
+ CSIT_TG_PORT="${DCR_PORTS[tg]##*:}"
CSIT_TG_UUID="${DCR_UUIDS[tg]}"
CSIT_TG_ARCH="$(uname -i)" || {
die "Reading machine architecture failed!"
@@ -713,7 +713,7 @@ function set_env_variables () {
CSIT_DUT1_HOST="$(hostname --all-ip-addresses | awk '{print $1}')" || {
die "Reading hostname IP address failed!"
}
- CSIT_DUT1_PORT="${DCR_PORTS[dut1]#*:}"
+ CSIT_DUT1_PORT="${DCR_PORTS[dut1]##*:}"
CSIT_DUT1_UUID="${DCR_UUIDS[dut1]}"
CSIT_DUT1_ARCH="$(uname -i)" || {
die "Reading machine architecture failed!"
diff --git a/resources/libraries/python/Constants.py b/resources/libraries/python/Constants.py
index 01b64c949d..3240a0a33e 100644
--- a/resources/libraries/python/Constants.py
+++ b/resources/libraries/python/Constants.py
@@ -365,6 +365,7 @@ class Constants:
u"Mellanox-CX556A": u"100ge2p1cx556a",
u"Mellanox-CX6DX": u"100ge2p1cx6dx",
u"Mellanox-CX7VEAT": u"200ge2p1cx7veat",
+ "virtual": "1ge1p82540em",
}
# Shortened lowercase NIC model name, useful for presentation.
@@ -382,6 +383,8 @@ class Constants:
u"100ge2p1cx556a": u"cx556a",
u"100ge2p1cx6dx": u"cx6dx",
u"200ge2p1cx7veat": u"cx7veat",
+ "1ge1p82540em": "8250em",
+
}
# Not each driver is supported by each NIC.
@@ -399,6 +402,7 @@ class Constants:
u"Mellanox-CX556A": [u"rdma-core", u"mlx5_core", u"af_xdp"],
u"Mellanox-CX6DX": [u"rdma-core", u"mlx5_core", u"af_xdp"],
u"Mellanox-CX7VEAT": [u"rdma-core", u"mlx5_core", u"af_xdp"],
+ "virtual": ["vfio-pci"],
}
# Each driver needs different plugin to work.
@@ -452,6 +456,7 @@ class Constants:
u"Mellanox-CX556A": [u"mlx5_core"],
u"Mellanox-CX6DX": [u"mlx5_core"],
u"Mellanox-CX7VEAT": [u"mlx5_core"],
+ "virtual": ["vfio-pci"],
}
# Tags to differentiate tests for different NIC driver.
diff --git a/resources/libraries/python/SetupFramework.py b/resources/libraries/python/SetupFramework.py
index 3c381166c2..95ca8a7d51 100644
--- a/resources/libraries/python/SetupFramework.py
+++ b/resources/libraries/python/SetupFramework.py
@@ -106,7 +106,7 @@ def extract_tarball_at_node(tarball, node):
node, cmd,
message=f"Failed to extract {tarball} at node {node[u'type']} "
f"host {node[u'host']}, port {node[u'port']}",
- timeout=240, include_reason=True
+ timeout=600, include_reason=True
)
logger.console(
f"Extracting tarball to {con.REMOTE_FW_DIR} on {node[u'type']} "