]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Reset WARN_ON_ONCE() state in the kernel
authorJohannes Berg <johannes.berg@intel.com>
Tue, 12 Dec 2023 08:07:15 +0000 (09:07 +0100)
committerJouni Malinen <j@w1.fi>
Tue, 12 Dec 2023 17:21:22 +0000 (19:21 +0200)
If a tests hits a WARN_ON_ONCE then the retriggering will make it appear
to pass, since the warning will not happen again. Make this more
reliable by resetting the states at the beginning of each test.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
tests/hwsim/run-tests.py

index 0d69f303c1039774e8274c4c01d5dca56e9a7062..30368a97ab96f94c624d43f4a1f2ae49662ac1c2 100755 (executable)
@@ -487,6 +487,12 @@ def main():
             log_handler.setFormatter(log_formatter)
             logger.addHandler(log_handler)
 
+        try:
+            with open('/sys/kernel/debug/clear_warn_once', 'w') as f:
+                f.write('1\n')
+        except FileNotFoundError:
+            pass
+
         reset_ok = True
         with DataCollector(args.logdir, name, args):
             count = count + 1