From: Rishabh Bhatnagar Date: Thu, 1 Jun 2023 21:11:12 +0000 (+0000) Subject: kselftests: Sort the collections list to avoid duplicate tests X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=301d6815cdb3c5de9159d4564cb27e56c6cebd0b;p=linux.git 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 Signed-off-by: Shuah Khan --- diff --git a/tools/testing/selftests/run_kselftest.sh b/tools/testing/selftests/run_kselftest.sh index 9a981b36bd7ff..92743980e553b 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)