summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRishabh Bhatnagar <risbhat@amazon.com>2023-06-01 21:11:12 +0000
committerShuah Khan <skhan@linuxfoundation.org>2023-06-12 16:39:11 -0600
commit301d6815cdb3c5de9159d4564cb27e56c6cebd0b (patch)
tree0c3d508c68d60dc4a723e1e4f80e41b419f1fe9f
parentbcda4c863efdd038c4f8ade63ff435ed663cc286 (diff)
downloadlinux-stable-301d6815cdb3c5de9159d4564cb27e56c6cebd0b.tar.gz
linux-stable-301d6815cdb3c5de9159d4564cb27e56c6cebd0b.tar.bz2
linux-stable-301d6815cdb3c5de9159d4564cb27e56c6cebd0b.zip
kselftests: Sort the collections list to avoid duplicate tests
If the collections list is not sorted uniq doesn't weed out duplicate tests correctly. Make sure to sort it before running uniq. Signed-off-by: Rishabh Bhatnagar <risbhat@amazon.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
-rwxr-xr-xtools/testing/selftests/run_kselftest.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/testing/selftests/run_kselftest.sh b/tools/testing/selftests/run_kselftest.sh
index 9a981b36bd7f..92743980e553 100755
--- a/tools/testing/selftests/run_kselftest.sh
+++ b/tools/testing/selftests/run_kselftest.sh
@@ -90,7 +90,7 @@ if [ -n "$TESTS" ]; then
available="$(echo "$valid" | sed -e 's/ /\n/g')"
fi
-collections=$(echo "$available" | cut -d: -f1 | uniq)
+collections=$(echo "$available" | cut -d: -f1 | sort | uniq)
for collection in $collections ; do
[ -w /dev/kmsg ] && echo "kselftest: Running tests in $collection" >> /dev/kmsg
tests=$(echo "$available" | grep "^$collection:" | cut -d: -f2)