[PATCH 2/2] hwsim tests: check kernel messages for warnings/bugs
Johannes Berg
johannes
Thu Oct 31 07:02:51 PDT 2013
From: Johannes Berg <johannes.berg at intel.com>
When a test passes but the kernel printed warnings, consider
the test to have failed.
Signed-hostap: Johannes Berg <johannes.berg at intel.com>
---
tests/hwsim/check_kernel.py | 13 +++++++++++++
tests/hwsim/run-tests.py | 16 +++++++++++++---
2 files changed, 26 insertions(+), 3 deletions(-)
create mode 100644 tests/hwsim/check_kernel.py
diff --git a/tests/hwsim/check_kernel.py b/tests/hwsim/check_kernel.py
new file mode 100644
index 0000000..aa1aa3a
--- /dev/null
+++ b/tests/hwsim/check_kernel.py
@@ -0,0 +1,13 @@
+"""
+Tests for kernel messages to find if there were any issues in them.
+"""
+
+import re
+
+issue = re.compile('(\[[0-9 .]*\] )?(WARNING:|BUG:).*')
+
+def check_kernel(logfile):
+ for line in open(logfile, 'r'):
+ if issue.match(line):
+ return False
+ return True
diff --git a/tests/hwsim/run-tests.py b/tests/hwsim/run-tests.py
index b40c971..8735dc2 100755
--- a/tests/hwsim/run-tests.py
+++ b/tests/hwsim/run-tests.py
@@ -21,6 +21,7 @@ sys.path.append('../../wpaspy')
from wpasupplicant import WpaSupplicant
from hostapd import HostapdGlobal
+from check_kernel import check_kernel
def reset_devs(dev, apdev):
hapd = HostapdGlobal()
@@ -246,15 +247,12 @@ def main():
else:
res = t(dev)
if res == "skip":
- skipped.append(name)
result = "SKIP"
else:
- passed.append(name)
result = "PASS"
except Exception, e:
logger.info(e)
result = "FAIL"
- failed.append(name)
for d in dev:
try:
d.request("NOTE TEST-STOP " + name)
@@ -282,6 +280,18 @@ def main():
end = datetime.now()
diff = end - start
+
+ if result == 'PASS' and args.dmesg:
+ if not check_kernel(os.path.join(args.logdir, name + '.dmesg')):
+ result = 'FAIL'
+
+ if result == 'PASS':
+ passed.append(name)
+ elif result == 'SKIP':
+ skipped.append(name)
+ else:
+ failed.append(name)
+
report(conn, args.build, args.commit, run, name, result, diff)
result = result + " " + name + " "
result = result + str(diff.total_seconds()) + " " + str(end)
--
1.8.4.rc3
More information about the Hostap
mailing list