Per patch: multiple BMRR calls
[csit.git] / resources / libraries / bash / function / common.sh
index a8ce456..69c7093 100644 (file)
@@ -82,6 +82,20 @@ function check_download_dir () {
 }
 
 
+function cleanup_topo () {
+
+    set -exuo pipefail
+
+    # Variables read:
+    # - WORKING_TOPOLOGY - Path to topology yaml file of the reserved testbed.
+    # - PYTHON_SCRIPTS_DIR - Path to directory holding the reservation script.
+
+    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 () {
 
     set -exuo pipefail
@@ -178,7 +192,7 @@ function copy_archives () {
     # automatically archived to logs.fd.io.
     if [[ -n "${WORKSPACE-}" ]]; then
         mkdir -p "${WORKSPACE}/archives/" || die "Archives dir create failed."
-        cp -r "${ARCHIVE_DIR}"/* "${WORKSPACE}/archives" || die "Copy failed."
+        cp -rf "${ARCHIVE_DIR}"/* "${WORKSPACE}/archives" || die "Copy failed."
     fi
 }
 
@@ -310,7 +324,7 @@ function reserve_testbed () {
                     }
                     die "Trap attempt failed, unreserve succeeded. Aborting."
                 }
-                python "${PYTHON_SCRIPTS_DIR}/topo_cleanup.py" -t "${topo}" || {
+                cleanup_topo || {
                     die "Testbed cleanup failed."
                 }
                 break
@@ -410,8 +424,8 @@ function select_tags () {
                             "mrrANDnic_cisco-vic-1227AND64b"
                             "mrrANDnic_cisco-vic-1385AND64b"
                             # memif
-                            "mrrANDmemifAND64b"
-                            "mrrANDmemifANDimix"
+                            "mrrANDmemifANDethAND64b"
+                            "mrrANDmemifANDethANDimix"
                             # crypto
                             "mrrANDipsecAND64b"
                             # ip4 base
@@ -430,6 +444,10 @@ function select_tags () {
                             "mrrANDip4fwdANDnat44ANDsrc_user_4000AND64b"
                             # ip4 features
                             "mrrANDip4fwdANDfeatureANDnic_intel-*710AND64b"
+                            # TODO: Remove when tags in
+                            # tests/vpp/perf/ip4/*-ipolicemarkbase-*.robot
+                            # are fixed
+                            "mrrANDip4fwdANDpolice_markANDnic_intel-*710AND64b"
                             # ip4 tunnels
                             "mrrANDip4fwdANDencapANDip6unrlayANDip4ovrlayANDnic_intel-x520-da2AND64b"
                             "mrrANDip4fwdANDencapANDnic_intel-*710AND64b"
@@ -463,11 +481,11 @@ function select_tags () {
                             "mrrANDl2bdmaclrnANDacl1AND10k_flowsAND64b"
                             "mrrANDl2bdmaclrnANDacl50AND10k_flowsAND64b"
                             # l2bd scale FIB 2M
-                            "mrrANDl2bdmaclrnANDfib_2mAND64b"
+                            "mrrANDl2bdmaclrnANDfib_1mAND64b"
                             # l2bd scale FIB 200k
-                            "mrrANDl2bdmaclrnANDfib_200kANDnic_intel-*710AND64b"
+                            "mrrANDl2bdmaclrnANDfib_100kANDnic_intel-*710AND64b"
                             # l2bd scale FIB 20k
-                            "mrrANDl2bdmaclrnANDfib_20kANDnic_intel-*710AND64b"
+                            "mrrANDl2bdmaclrnANDfib_10kANDnic_intel-*710AND64b"
                             # l2 patch base
                             "mrrANDl2patchAND64b"
                             # srv6
@@ -481,9 +499,10 @@ function select_tags () {
                             "mrrANDvhostANDl2bdmaclrnANDbaseAND64b"
                             "mrrANDvhostANDl2bdmaclrnANDbaseANDimix"
                             # vm vhost ip4 base
-                            "mrrANDvhostANDip4baseAND64b"
-                            "mrrANDvhostANDip4baseANDimix"
+                            "mrrANDvhostANDip4fwdANDbaseAND64b"
+                            "mrrANDvhostANDip4fwdANDbaseANDimix"
                             # Exclude
+                            "!mrrANDip6baseANDdot1qAND78b"
                             "!vhost_256ANDnic_intel-x520-da2"
                             "!vhostANDnic_intel-xl710"
                             "!cfs_opt"
@@ -625,9 +644,9 @@ function untrap_and_unreserve_testbed () {
     wt="${WORKING_TOPOLOGY}"  # Just to avoid too long lines.
     if [[ -z "${wt-}" ]]; then
         set -eu
-        echo "Testbed looks unreserved already. Trap removal failed before?"
+        warn "Testbed looks unreserved already. Trap removal failed before?"
     else
-        python "${PYTHON_SCRIPTS_DIR}/topo_cleanup.py" -t "${wt}" || true
+        cleanup_topo || true
         python "${PYTHON_SCRIPTS_DIR}/topo_reservation.py" -c -t "${wt}" || {
             die "${1:-FAILED TO UNRESERVE, FIX MANUALLY.}" 2
         }