]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
kselftests: Sort the collections list to avoid duplicate tests
authorRishabh Bhatnagar <risbhat@amazon.com>
Thu, 1 Jun 2023 21:11:12 +0000 (21:11 +0000)
committerShuah Khan <skhan@linuxfoundation.org>
Mon, 12 Jun 2023 22:39:11 +0000 (16:39 -0600)
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>
tools/testing/selftests/run_kselftest.sh

index 9a981b36bd7ff28e552d76149284c3e2a0a7d274..92743980e553b89d98dc4f34859bed9115d4d0f0 100755 (executable)
@@ -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)