[PATCH] tests: hwsim: fix kunit test runner

Johannes Berg johannes at sipsolutions.net
Thu Jul 9 03:33:33 PDT 2026


From: Johannes Berg <johannes.berg at intel.com>

The generator expression will never be evaluated for
mac80211-tests if cfg80211-tests is loaded, since at
that point all() can no longer be true and short-
circuits. Use a list to force evaluation of all.

Signed-off-by: Johannes Berg <johannes.berg at intel.com>
---
 tests/hwsim/test_kernel.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tests/hwsim/test_kernel.py b/tests/hwsim/test_kernel.py
index 75ae16402189..f3c8876402d0 100644
--- a/tests/hwsim/test_kernel.py
+++ b/tests/hwsim/test_kernel.py
@@ -155,8 +155,9 @@ def test_kernel_reg_disconnect(dev, apdev):
 def test_kernel_kunit(dev, apdev):
     """KUnit tests"""
     modules = ('cfg80211-tests', 'mac80211-tests')
-    results = (subprocess.call(['modprobe', mod], stderr=subprocess.PIPE)
-               for mod in modules)
+    # force a list (not generator) to try all of them
+    results = [subprocess.call(['modprobe', mod], stderr=subprocess.PIPE)
+               for mod in modules]
 
     if all((r != 0 for r in results)):
         raise HwsimSkip("KUnit tests not available")
-- 
2.53.0




More information about the Hostap mailing list