Topology: Cascadelake
[csit.git] / resources / libraries / bash / function / common.sh
index 13976ae..b38cd52 100644 (file)
@@ -239,6 +239,9 @@ 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."
     }
@@ -467,6 +470,10 @@ function get_test_code () {
             NODENESS="3n"
             FLAVOR="skx"
             ;;
+        *"2n-clx"*)
+            NODENESS="2n"
+            FLAVOR="clx"
+            ;;
         *"2n-dnv"*)
             NODENESS="2n"
             FLAVOR="dnv"
@@ -553,36 +560,6 @@ function installed () {
 }
 
 
-function remove_topo () {
-
-    # Remove the argument from list of available topologies.
-    #
-    # Just a de-duplicated block of code
-    #
-    # Argument:
-    # - ${1} - The topology item to remove. Required.
-    # Variable read and re-written:
-    # - TOPOLOGIES - Array of paths to topologies, with failed cleanups removed.
-
-    set -exuo pipefail
-
-    warn "Testbed ${topo} seems unsuitable, removing from the list."
-
-    # Build new topology array.
-    #   TOPOLOGIES=("${TOPOLOGIES[@]/$topo}")
-    # does not really work, see:
-    # https://stackoverflow.com/questions/16860877/remove-an-element-from-a-bash-array
-
-    new_topologies=()
-    for item in "${TOPOLOGIES[@]}"; do
-        if [[ "${item}" != "${1}" ]]; then
-            new_topologies+=("${item}")
-        fi
-    done
-    TOPOLOGIES=("${new_topologies[@]}")
-}
-
-
 function reserve_and_cleanup_testbed () {
 
     # Reserve physical testbed, perform cleanup, register trap to unreserve.
@@ -635,11 +612,6 @@ function reserve_and_cleanup_testbed () {
                 fi
                 warn "Testbed cleanup failed: ${topo}"
                 untrap_and_unreserve_testbed "Fail of unreserve after cleanup."
-                # WORKING_TOPOLOGY is now empty again.
-                remove_topo "${topo}"
-            elif [[ "${result}" != "2" ]]; then
-                # 1 or unexpected return code, testbed is probably unusable.
-                remove_topo "${topo}"
             fi
             # Else testbed is accessible but currently reserved, moving on.
         done
@@ -834,6 +806,9 @@ function select_tags () {
             # Not enough nic_intel-xxv710 to support double link tests.
             test_tag_array+=("!3_node_double_link_topoANDnic_intel-xxv710")
             ;;
+        *"2n-clx"*)
+            test_tag_array+=("!ipsechw")
+            ;;
         *"2n-dnv"*)
             test_tag_array+=("!ipsechw")
             test_tag_array+=("!memif")
@@ -939,6 +914,10 @@ function select_topology () {
             TOPOLOGIES=( "${TOPOLOGIES_DIR}"/*3n_skx*.yaml )
             TOPOLOGIES_TAGS="3_node_*_link_topo"
             ;;
+        "2n_clx")
+            TOPOLOGIES=( "${TOPOLOGIES_DIR}"/*2n_clx*.yaml )
+            TOPOLOGIES_TAGS="2_node_*_link_topo"
+            ;;
         "2n_dnv")
             TOPOLOGIES=( "${TOPOLOGIES_DIR}"/*2n_dnv*.yaml )
             TOPOLOGIES_TAGS="2_node_single_link_topo"