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>
This commit is contained in:
Rishabh Bhatnagar 2023-06-01 21:11:12 +00:00 committed by Shuah Khan
parent bcda4c863e
commit 301d6815cd
1 changed files with 1 additions and 1 deletions

View File

@ -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)