public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] selftests: tc-testing: preserve list order when removing duplicates
@ 2026-02-22  9:55 mr.navi8680
  2026-02-24 12:19 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: mr.navi8680 @ 2026-02-22  9:55 UTC (permalink / raw)
  To: jhs, jiri, shuah; +Cc: netdev, linux-kselftest, linux-kernel, Naveen Anandhan

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-02-24 12:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-22  9:55 [PATCH] selftests: tc-testing: preserve list order when removing duplicates mr.navi8680
2026-02-24 12:19 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox