Allow more perftest strings in get_test_tag_string 55/17655/2
authorVratko Polak <vrpolak@cisco.com>
Mon, 18 Feb 2019 15:53:17 +0000 (16:53 +0100)
committerVratko Polak <vrpolak@cisco.com>
Tue, 19 Feb 2019 17:35:06 +0000 (17:35 +0000)
This is needed to support other TBs in perpatch job.

Change-Id: I9de70e818a32fa9990d90cb14498a26570b774a4
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
resources/libraries/bash/function/common.sh

index 5982af9..7f64067 100644 (file)
@@ -415,11 +415,16 @@ function get_test_tag_string () {
                 ;;
             *"perf"*)
                 # On parsing error, ${trigger} stays empty.
-                trigger="$(echo "${GERRIT_EVENT_COMMENT_TEXT}" \
-                    | grep -oE '(perftest$|perftest[[:space:]].+$)')" \
-                    || true
+                comment="${GERRIT_EVENT_COMMENT_TEXT}"
+                # As "perftest" can be followed by something, we substitute it.
+                comment="${comment/perftest-2n/perftest}"
+                comment="${comment/perftest-3n/perftest}"
+                comment="${comment/perftest-hsw/perftest}"
+                comment="${comment/perftest-skx/perftest}"
+                tag_string="$(echo "${comment}" \
+                    | grep -oE '(perftest$|perftest[[:space:]].+$)' || true)"
                 # Set test tags as string.
-                TEST_TAG_STRING="${trigger#$"perftest"}"
+                TEST_TAG_STRING="${tag_string#$"perftest"}"
                 ;;
             *)
                 die "Unknown specification: ${TEST_CODE}"

©2016 FD.io a Linux Foundation Collaborative Project. All Rights Reserved.
Linux Foundation is a registered trademark of The Linux Foundation. Linux is a registered trademark of Linus Torvalds.
Please see our privacy policy and terms of use.