From patchwork Tue Jun 7 13:42:43 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Afek X-Patchwork-Id: 631629 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3rPCcT0DBqz9sCp for ; Tue, 7 Jun 2016 23:50:01 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=wizery-com.20150623.gappssmtp.com header.i=@wizery-com.20150623.gappssmtp.com header.b=yDC6XwZ6; dkim-atps=neutral Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1bAHO7-0003qW-Mt; Tue, 07 Jun 2016 13:49:47 +0000 Received: from casper.infradead.org ([2001:770:15f::2]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1bAHO6-0003hL-0P for hostap@bombadil.infradead.org; Tue, 07 Jun 2016 13:49:46 +0000 Received: from mail-pa0-x243.google.com ([2607:f8b0:400e:c03::243]) by casper.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bAHI0-0002nt-K7 for hostap@lists.infradead.org; Tue, 07 Jun 2016 13:43:29 +0000 Received: by mail-pa0-x243.google.com with SMTP id ug1so4260185pab.1 for ; Tue, 07 Jun 2016 06:43:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wizery-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references; bh=jZ/rhVuXZ9dqDgH+EyuYPkCvjpPn8Sok6RafJkJNQpM=; b=yDC6XwZ6bia64YKJTp3cTmFNbHIZG+eV/HmwlATOA9TgJfJVElM+mU3vt2pF7wBQvo Ve0gU3FVdREHPnraeRyjFuynMXDHbrmVOQ3rLIMBpz7w4n74coqkTG67ZE/kBvddIMt7 Fl9ePTFYudFyyN9k43YXmhprZ9ZhI9L0fgyd5lZJxoztAUMwGf3YBpsiaZt1VcPtLpPw MpkpSl43Asd84XhuEWbG+n4EIlX5g65h+StCQjexu6b6mjw9czXDTqRRJI/zUpsSKPwn kUJ6xkZ/9e6osTsCP2OFaoakp/3Gji5eF+Nb1JZzFMC0tWky8Z32IeC3kg6bNDBWQgH7 G/ng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=jZ/rhVuXZ9dqDgH+EyuYPkCvjpPn8Sok6RafJkJNQpM=; b=hQBc3rKCCKnC1LmfWDgmazxRs71oJ0rhOjJQQPuuD+XjIsPyjT07ZkoPmh+/8/YzZH gDsilR95QNCNaMw2lRifGcWgdQg6Zi2LoMoDRir5VsJwpWWifAkbR9Y5iH1J41okkV/W 74mMyKD4IPMv1Lgqg//F4SXOkyY7+sEYOCxJGsgz/VUDBSObksU/CdKKZFuRflfKTK0A pATdbRiRxOuwBjQ3224d1PqavBNRKGi7QycBoXhNPu1/qGyT5Zw7mC2dGSOml477B3+W l/AXUj4QSdfqYlSOI/5pzG27NoJ5ThOHKRSYnaGmOME/bUt8Y7/JGGZmP/8FrdLYmbbi 6EVA== X-Gm-Message-State: ALyK8tILyLa4Fpye/wFmkHBPU/uWQONGD+zhhVBcev76wtMVSWe3ac6//XJ989qJREt/4g== X-Received: by 10.66.34.68 with SMTP id x4mr5454368pai.1.1465306985223; Tue, 07 Jun 2016 06:43:05 -0700 (PDT) Received: from localhost.localdomain ([192.55.54.44]) by smtp.gmail.com with ESMTPSA id hk7sm33395712pad.25.2016.06.07.06.43.03 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 07 Jun 2016 06:43:04 -0700 (PDT) From: Jonathan Afek To: hostap@lists.infradead.org Subject: [PATCH 6/6] tests: ap_ciphers tests start using general cmd_execute() func Date: Tue, 7 Jun 2016 16:42:43 +0300 Message-Id: <1465306963-22464-6-git-send-email-jonathan@wizery.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1465306963-22464-1-git-send-email-jonathan@wizery.com> References: <1465306963-22464-1-git-send-email-jonathan@wizery.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160607_144328_891671_757DACE2 X-CRM114-Status: GOOD ( 10.43 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.4.0 on casper.infradead.org summary: Content analysis details: (-2.6 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2607:f8b0:400e:c03:0:0:0:243 listed in] [list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org The ap_ciphers tests used to do file operations locally in python. Start using the cmd_execute() general function for file operations so that this would also work on remote setups. Signed-off-by: Jonathan Afek --- tests/hwsim/test_ap_ciphers.py | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/tests/hwsim/test_ap_ciphers.py b/tests/hwsim/test_ap_ciphers.py index bff8906..34dddb9 100644 --- a/tests/hwsim/test_ap_ciphers.py +++ b/tests/hwsim/test_ap_ciphers.py @@ -72,7 +72,7 @@ def test_ap_cipher_tkip_countermeasures_ap(dev, apdev): """WPA-PSK/TKIP countermeasures (detected by AP)""" skip_with_fips(dev[0]) testfile = "/sys/kernel/debug/ieee80211/%s/netdev:%s/tkip_mic_test" % (dev[0].get_driver_status_field("phyname"), dev[0].ifname) - if not os.path.exists(testfile): + if dev[0].cmd_execute(["ls", testfile])[0] != 0: raise HwsimSkip("tkip_mic_test not supported in mac80211") params = { "ssid": "tkip-countermeasures", @@ -86,14 +86,12 @@ def test_ap_cipher_tkip_countermeasures_ap(dev, apdev): pairwise="TKIP", group="TKIP", scan_freq="2412") dev[0].dump_monitor() - with open(testfile, "w") as f: - f.write(apdev[0]['bssid']) + dev[0].cmd_execute(["echo", "-n", apdev[0]['bssid'], ">", testfile]) ev = dev[0].wait_event(["CTRL-EVENT-DISCONNECTED"], timeout=1) if ev is not None: raise Exception("Unexpected disconnection on first Michael MIC failure") - with open(testfile, "w") as f: - f.write("ff:ff:ff:ff:ff:ff") + dev[0].cmd_execute(["echo", "-n", "ff:ff:ff:ff:ff:ff", ">", testfile]) ev = dev[0].wait_disconnected(timeout=10, error="No disconnection after two Michael MIC failures") if "reason=14" not in ev: @@ -113,21 +111,19 @@ def test_ap_cipher_tkip_countermeasures_sta(dev, apdev): hapd = hostapd.add_ap(apdev[0], params) testfile = "/sys/kernel/debug/ieee80211/%s/netdev:%s/tkip_mic_test" % (hapd.get_driver_status_field("phyname"), apdev[0]['ifname']) - if not os.path.exists(testfile): + if hapd.cmd_execute(["ls", testfile])[0] != 0: raise HwsimSkip("tkip_mic_test not supported in mac80211") dev[0].connect("tkip-countermeasures", psk="12345678", pairwise="TKIP", group="TKIP", scan_freq="2412") dev[0].dump_monitor() - with open(testfile, "w") as f: - f.write(dev[0].own_addr()) + hapd.cmd_execute(["echo", "-n", dev[0].own_addr(), ">", testfile]) ev = dev[0].wait_event(["CTRL-EVENT-DISCONNECTED"], timeout=1) if ev is not None: raise Exception("Unexpected disconnection on first Michael MIC failure") - with open(testfile, "w") as f: - f.write("ff:ff:ff:ff:ff:ff") + hapd.cmd_execute(["echo", "-n", "ff:ff:ff:ff:ff:ff", ">", testfile]) ev = dev[0].wait_disconnected(timeout=10, error="No disconnection after two Michael MIC failures") if "reason=14 locally_generated=1" not in ev: