summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/run_kselftest.sh
diff options
context:
space:
mode:
authorRishabh Bhatnagar <risbhat@amazon.com>2023-06-02 00:11:12 +0300
committerShuah Khan <skhan@linuxfoundation.org>2023-06-13 01:39:11 +0300
commit301d6815cdb3c5de9159d4564cb27e56c6cebd0b (patch)
tree0c3d508c68d60dc4a723e1e4f80e41b419f1fe9f /tools/testing/selftests/run_kselftest.sh
parentbcda4c863efdd038c4f8ade63ff435ed663cc286 (diff)
downloadlinux-301d6815cdb3c5de9159d4564cb27e56c6cebd0b.tar.xz
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>
Diffstat (limited to 'tools/testing/selftests/run_kselftest.sh')
-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)