From: mr.navi8680@gmail.com
To: jhs@mojatatu.com, jiri@resnulli.us, shuah@kernel.org
Cc: netdev@vger.kernel.org, linux-kselftest@vger.kernel.org,
linux-kernel@vger.kernel.org,
Naveen Anandhan <mr.navi8680@gmail.com>
Subject: [PATCH] selftests: tc-testing: preserve list order when removing duplicates
Date: Sun, 22 Feb 2026 15:25:36 +0530 [thread overview]
Message-ID: <20260222095536.17371-1-mr.navi8680@gmail.com> (raw)
From: Naveen Anandhan <mr.navi8680@gmail.com>
Using set() removes duplicates but breaks ordering.
Test output should be deterministic, so replace with dict.fromkeys().
Signed-off-by: Naveen Anandhan <mr.navi8680@gmail.com>
---
tools/testing/selftests/tc-testing/tdc_helper.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/tc-testing/tdc_helper.py b/tools/testing/selftests/tc-testing/tdc_helper.py
index 0440d252c4c5..e06f03c0fb5d 100644
--- a/tools/testing/selftests/tc-testing/tdc_helper.py
+++ b/tools/testing/selftests/tc-testing/tdc_helper.py
@@ -16,9 +16,9 @@ def get_categorized_testlist(alltests, ucat):
def get_unique_item(lst):
- """ For a list, return a list of the unique items in the list. """
+ """Return unique items while preserving original order."""
if len(lst) > 1:
- return list(set(lst))
+ return list(dict.fromkeys(lst))
else:
return lst
--
2.43.0
next reply other threads:[~2026-02-22 9:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-22 9:55 mr.navi8680 [this message]
2026-02-24 12:19 ` [PATCH] selftests: tc-testing: preserve list order when removing duplicates patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260222095536.17371-1-mr.navi8680@gmail.com \
--to=mr.navi8680@gmail.com \
--cc=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=shuah@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox