From a5895656ed7f352e52bfc46c7efbe9906b5d5746 Mon Sep 17 00:00:00 2001 From: Konrad Sztyber Date: Fri, 4 Feb 2022 11:31:18 +0100 Subject: [PATCH] test/match: support for matching UUIDs The script can now match UUIDs via the $(UUID) marker. Signed-off-by: Konrad Sztyber Change-Id: Ied11f9ce65e4f1102309523f3f8ec0ee7c9e74d0 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11410 Tested-by: SPDK CI Jenkins Community-CI: Broadcom CI Reviewed-by: Jim Harris Reviewed-by: Ben Walker --- test/app/match/match | 2 ++ test/spdkcli/match_files/spdkcli_vhost.test.match | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/test/app/match/match b/test/app/match/match index 63fee5203..eb4d07f6a 100755 --- a/test/app/match/match +++ b/test/app/match/match @@ -58,6 +58,7 @@ # $(OPT) line is optional (may be missing, matched if found) # $(OPX) ends a contiguous list of $(OPT)...$(OPX) lines, at least # one of which must match +# $(UUID) universally unique identifier # # Additionally, if any "X.ignore" file exists, strings or phrases found per # line in the file will be ignored if found as a substring in the @@ -241,6 +242,7 @@ sub match { s/\\\$\\\(W\\\)/\\p{Blank}*/g; s/\\\$\\\(nW\\\)/\\p{Graph}*/g; s/\\\$\\\(DD\\\)/\\d+\\+\\d+ records in\n\\d+\\+\\d+ records out\n\\d+ bytes \\\(\\d+ .B\\\) copied, [.0-9e-]+[^,]*, [.0-9]+ .B.s/g; + s/\\\$\\\(UUID\\\)/\\p{XPosixXDigit}{8}-\\p{XPosixXDigit}{4}-\\p{XPosixXDigit}{4}-\\p{XPosixXDigit}{4}-\\p{XPosixXDigit}{12}/g; if (s/\\\$\\\(OPT\\\)//) { $opt = 1; } elsif (s/\\\$\\\(OPX\\\)//) { diff --git a/test/spdkcli/match_files/spdkcli_vhost.test.match b/test/spdkcli/match_files/spdkcli_vhost.test.match index 2a8c3c738..ed228b0e1 100644 --- a/test/spdkcli/match_files/spdkcli_vhost.test.match +++ b/test/spdkcli/match_files/spdkcli_vhost.test.match @@ -8,8 +8,8 @@ o- / ........................................................................... | | o- EE_Malloc4 ...................................................................................... [Size=$(FP)M, Not claimed] | o- iscsi ............................................................................................................ [Bdevs: 0] | o- logical_volume ................................................................................................... [Bdevs: 2] - | | o- $(X)-$(X)-$(X)-$(X)-$(X) ................................................ [lvs0/lvol$(FP), Size=$(FP)M, Not claimed] - | | o- $(X)-$(X)-$(X)-$(X)-$(X) ................................................ [lvs0/lvol$(FP), Size=$(FP)M, Not claimed] + | | o- $(UUID) ................................................ [lvs0/lvol$(FP), Size=$(FP)M, Not claimed] + | | o- $(UUID) ................................................ [lvs0/lvol$(FP), Size=$(FP)M, Not claimed] | o- malloc ........................................................................................................... [Bdevs: 6] | | o- Malloc0 ............................................................................................. [Size=$(FP)M, Claimed] | | o- Malloc1 ............................................................................................. [Size=$(FP)M, Claimed]