feat(infra): Add Mellanox CX6 to 3n-icx
[csit.git] / resources / libraries / bash / function / common.sh
index ec2fffd..c9845c1 100644 (file)
@@ -236,9 +236,6 @@ function common_dirs () {
     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."
     }
@@ -659,7 +656,7 @@ function prepare_topology () {
             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."
@@ -870,7 +867,7 @@ function select_tags () {
             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"
@@ -903,6 +900,7 @@ function select_tags () {
     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");'
@@ -1123,6 +1121,14 @@ function select_topology () {
             TOPOLOGIES=( "${TOPOLOGIES_DIR}"/*3n_icx*.yaml )
             TOPOLOGIES_TAGS="3_node_*_link_topo"
             ;;
+        "3na_spr")
+            TOPOLOGIES=( "${TOPOLOGIES_DIR}"/*3na_spr*.yaml )
+            TOPOLOGIES_TAGS="3_node_*_link_topo"
+            ;;
+        "3nb_spr")
+            TOPOLOGIES=( "${TOPOLOGIES_DIR}"/*3nb_spr*.yaml )
+            TOPOLOGIES_TAGS="3_node_*_link_topo"
+            ;;
         "2n_clx")
             TOPOLOGIES=( "${TOPOLOGIES_DIR}"/*2n_clx*.yaml )
             TOPOLOGIES_TAGS="2_node_*_link_topo"