Remove the leftovers of the old testbed cleanup
[csit.git] / resources / libraries / bash / function / common.sh
index e4783dd..491b47f 100644 (file)
@@ -182,19 +182,6 @@ function check_prerequisites () {
     fi
 }
 
-function cleanup_topo () {
-
-    # Variables read:
-    # - WORKING_TOPOLOGY - Path to topology yaml file of the reserved testbed.
-    # - PYTHON_SCRIPTS_DIR - Path to directory holding the reservation script.
-
-    set -exuo pipefail
-
-    python "${PYTHON_SCRIPTS_DIR}/topo_cleanup.py" -t "${WORKING_TOPOLOGY}"
-    # Not using "|| die" as some callers might want to ignore errors,
-    # e.g. in teardowns, such as unreserve.
-}
-
 
 function common_dirs () {
 
@@ -515,8 +502,8 @@ function get_test_tag_string () {
             *"device"*)
                 # On parsing error, ${trigger} stays empty.
                 trigger="$(echo "${GERRIT_EVENT_COMMENT_TEXT}" \
-                    | grep -oE '(devicetest$|devicetest[[:space:]].+$)')" \
-                    || true
+                    | grep -oE '(devicetest$|devicetest[[:space:]].+$)' \
+                    || true)"
                 # Set test tags as string.
                 TEST_TAG_STRING="${trigger#$"devicetest"}"
                 ;;
@@ -760,7 +747,7 @@ function select_tags () {
         *"3n-skx"* | *"2n-skx"* | *"2n-clx"*)
             default_nic="nic_intel-xxv710"
             ;;
-        *"3n-hsw"*)
+        *"3n-hsw"* | *"mrr-daily-master")
             default_nic="nic_intel-xl710"
             ;;
         *)
@@ -876,6 +863,12 @@ function select_tags () {
         if [[ "${tag}" == "!"* ]]; then
             # Exclude tags are not prefixed.
             TAGS+=("${tag}")
+        elif [[ "${tag}" == " "* || "${tag}" == *"perftest"* ]]; then
+            # Badly formed tag expressions can trigger way too much tests.
+            set -x
+            warn "The following tag expression hints at bad trigger: ${tag}"
+            warn "Possible cause: Multiple triggers in a single comment."
+            die "Aborting to avoid triggering too many tests."
         elif [[ "${tag}" != "" && "${tag}" != "#"* ]]; then
             # Empty and comment lines are skipped.
             # Other lines are normal tags, they are to be prefixed.