From patchwork Thu Oct 31 14:02:51 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Berg X-Patchwork-Id: 287499 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from maxx.maxx.shmoo.com (maxx.shmoo.com [205.134.188.171]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "maxx.shmoo.com", Issuer "CA Cert Signing Authority" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 646DD2C00C1 for ; Fri, 1 Nov 2013 01:03:22 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 962AE17C019; Thu, 31 Oct 2013 10:03:18 -0400 (EDT) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Iyy3Gi5hvQpT; Thu, 31 Oct 2013 10:03:18 -0400 (EDT) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 5B85E9C2E4; Thu, 31 Oct 2013 10:03:07 -0400 (EDT) X-Original-To: mailman-post+hostap@maxx.shmoo.com Delivered-To: mailman-post+hostap@maxx.shmoo.com Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 1A0419C2E4 for ; Thu, 31 Oct 2013 10:03:06 -0400 (EDT) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id SNGHspWGnn3X for ; Thu, 31 Oct 2013 10:03:01 -0400 (EDT) Received: from sipsolutions.net (s3.sipsolutions.net [144.76.43.152]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (Client did not present a certificate) by maxx.maxx.shmoo.com (Postfix) with ESMTPS id 4D3AC9C24C for ; Thu, 31 Oct 2013 10:02:56 -0400 (EDT) Received: by sipsolutions.net with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Vbspr-0003MF-4b; Thu, 31 Oct 2013 15:02:55 +0100 From: Johannes Berg To: hostap@lists.shmoo.com Subject: [PATCH 2/2] hwsim tests: check kernel messages for warnings/bugs Date: Thu, 31 Oct 2013 15:02:51 +0100 Message-Id: <1383228171-30313-2-git-send-email-johannes@sipsolutions.net> X-Mailer: git-send-email 1.8.4.rc3 In-Reply-To: <1383228171-30313-1-git-send-email-johannes@sipsolutions.net> References: <1383228171-30313-1-git-send-email-johannes@sipsolutions.net> Cc: Johannes Berg X-BeenThere: hostap@lists.shmoo.com X-Mailman-Version: 2.1.11 Precedence: list List-Id: HostAP Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: hostap-bounces@lists.shmoo.com Errors-To: hostap-bounces@lists.shmoo.com From: Johannes Berg When a test passes but the kernel printed warnings, consider the test to have failed. Signed-hostap: Johannes Berg --- 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)