From patchwork Wed Oct 30 21:54:35 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Berg X-Patchwork-Id: 287354 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 622202C03B3 for ; Thu, 31 Oct 2013 08:54:52 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 88EB89C161; Wed, 30 Oct 2013 17:54:50 -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 M0Z0QspLqxRu; Wed, 30 Oct 2013 17:54:50 -0400 (EDT) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 3D0D69C169; Wed, 30 Oct 2013 17:54:46 -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 CA7F79C161 for ; Wed, 30 Oct 2013 17:54:44 -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 Fe3APARGehel for ; Wed, 30 Oct 2013 17:54:40 -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 9F0EF9C169 for ; Wed, 30 Oct 2013 17:54:40 -0400 (EDT) Received: by sipsolutions.net with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Vbdip-00027r-FP; Wed, 30 Oct 2013 22:54:39 +0100 From: Johannes Berg To: hostap@lists.shmoo.com Subject: [PATCH] hwsim tests: reset at the end of a test Date: Wed, 30 Oct 2013 22:54:35 +0100 Message-Id: <1383170075-24567-1-git-send-email-johannes@sipsolutions.net> X-Mailer: git-send-email 1.8.4.rc3 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 Resetting at the beginning causes the reset logging/tracing data to leak from the previous test into the next, and the last one being missed at all - reset at the end of each run instead. Also reset before all tests just in case running a test actually crashed the python script. Signed-off-by: Johannes Berg --- tests/hwsim/run-tests.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/hwsim/run-tests.py b/tests/hwsim/run-tests.py index 080d151..a772e05 100755 --- a/tests/hwsim/run-tests.py +++ b/tests/hwsim/run-tests.py @@ -201,6 +201,10 @@ def main(): skipped = [] failed = [] + # make sure nothing is left over from previous runs + # (if there were any other manual runs or we crashed) + reset_devs(dev, apdev) + if args.dmesg: subprocess.call(['dmesg', '-c'], stdout=open('/dev/null', 'w')) @@ -212,7 +216,6 @@ def main(): if not t.__module__ in args.testmodules: continue with DataCollector(args.logdir, t.__name__, args.tracing, args.dmesg): - reset_devs(dev, apdev) logger.info("START " + t.__name__) if log_to_file: print "START " + t.__name__ @@ -276,9 +279,7 @@ def main(): except Exception, e: logger.info("Failed to issue TEST-STOP after " + t.__name__ + " for " + d.ifname) logger.info(e) - - if not args.tests: - reset_devs(dev, apdev) + reset_devs(dev, apdev) if conn: conn.close()