tests: Reset WARN_ON_ONCE() state in the kernel

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>
This commit is contained in:
Johannes Berg 2023-12-12 09:07:15 +01:00 committed by Jouni Malinen
parent 29e998d75e
commit 31792fa8d9

View file

@ -487,6 +487,12 @@ def main():
log_handler.setFormatter(log_formatter) log_handler.setFormatter(log_formatter)
logger.addHandler(log_handler) 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 reset_ok = True
with DataCollector(args.logdir, name, args): with DataCollector(args.logdir, name, args):
count = count + 1 count = count + 1