From patchwork Sat Apr 2 06:24:21 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janusz.Dziedzic@tieto.com X-Patchwork-Id: 605387 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 3qcSsl2myHz9ssP for ; Sat, 2 Apr 2016 17:25:14 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=tieto.com header.i=@tieto.com header.b=m9gV3TjM; 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 1amEzW-0006aY-1H; Sat, 02 Apr 2016 06:25:02 +0000 Received: from mail-lb0-x22a.google.com ([2a00:1450:4010:c04::22a]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1amEzR-0006Wj-Pq for hostap@lists.infradead.org; Sat, 02 Apr 2016 06:24:59 +0000 Received: by mail-lb0-x22a.google.com with SMTP id vo2so89132352lbb.1 for ; Fri, 01 Apr 2016 23:24:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tieto.com; s=google; h=from:to:cc:subject:date:message-id; bh=JWTchwL0vl+ehey2gTVYgNVq/OpiYVfTsYbYWJjZ+nw=; b=m9gV3TjMIggL0J+UKvBruIS5riixc1uIsxa5Du+sSBCt44D3cstVDifV7inAxD4kh7 0pgCl3OpxYo9Fm9fzEWBwIjMNcI4v89iRleFhDFYcuVijzvA4/ZX1dWsnDeW0IGrUEKG +CYrSXdSduEaXtuyTztSrNmkjHn4NAdWq+odU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=JWTchwL0vl+ehey2gTVYgNVq/OpiYVfTsYbYWJjZ+nw=; b=TEE5Xm41mvynFBxwWJvkB5c3JRFR9YZGqqtDL0DAu4KSEjlR+Q0Uesu4x+c2TvuIbF X7tVqe9g9tKPUEAJGwW6BDe5X2aq1G36107GDf1RZRcPGms/QHjYg5dEfzH5dcS4/ANz G/gQUXAKmUnVyh7sFVlZetANB5RxJdPlq8EGX63FVIV4mBsp37dme/RlOuvOB5NrHnRY 4QorhsOeLCB+VPKKGC8+Wa4pjLvX8RDbc2xP+yFytaQYakKnyZa2OFzBve3E/XzVfiBO Y3iTDEY8iHnvtlEkyDH5/1fSTo3b5yRGL+VyPLYutWwp2b+/8oZ3Oo0Ts0DIYlw3Ecg0 QH8g== X-Gm-Message-State: AD7BkJK8faQeu48dJ3Iq+fAKcU3qPH64SINOqCLeAuDAQ6hCiHUNJHZyUDFe0iJgDq57uhrMdrF+FvIFp/oG+25GymbUQJ9VF1+lDrumowD9Hx5KUDnCHzLk5DapQPOWyG4vRtVcd8wKphqqRsCXpLIRJdHA5clctbw5aqy5frQSSjXgI0ESH+GVBaOirKgFwk0P X-Received: by 10.112.151.207 with SMTP id us15mr2818459lbb.28.1459578271056; Fri, 01 Apr 2016 23:24:31 -0700 (PDT) Received: from localhost.localdomain (host-62-141-193-85.swidnica.mm.pl. [62.141.193.85]) by smtp.gmail.com with ESMTPSA id xg1sm2751372lbb.10.2016.04.01.23.24.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 01 Apr 2016 23:24:30 -0700 (PDT) From: Janusz Dziedzic To: hostap@lists.infradead.org Subject: [PATCH 1/2] tests: ibss kill subprocess usage Date: Sat, 2 Apr 2016 08:24:21 +0200 Message-Id: <1459578262-6388-1-git-send-email-janusz.dziedzic@tieto.com> X-Mailer: git-send-email 1.9.1 X-DomainID: tieto.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160401_232458_222189_38A16C59 X-CRM114-Status: UNSURE ( 9.52 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2a00:1450:4010:c04:0:0:0:22a listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -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 -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 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: , Cc: j@w1.fi, Janusz Dziedzic MIME-Version: 1.0 Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org In case of remote hosts, we can't just use subprocesss() while we have to run command on remote host. Signed-off-by: Janusz Dziedzic --- tests/hwsim/test_ibss.py | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/tests/hwsim/test_ibss.py b/tests/hwsim/test_ibss.py index cc6bfc1..f5e060f 100644 --- a/tests/hwsim/test_ibss.py +++ b/tests/hwsim/test_ibss.py @@ -8,7 +8,6 @@ import logging logger = logging.getLogger() import time import re -import subprocess import hwsim_utils from utils import alloc_fail @@ -299,10 +298,8 @@ def test_ibss_open_fixed_bssid(dev): def test_ibss_open_retry(dev): """IBSS open (no security) with cfg80211 retry workaround""" - subprocess.check_call(['iw', 'dev', dev[0].ifname, 'set', 'type', 'adhoc']) - subprocess.check_call(['iw', 'dev', dev[0].ifname, 'ibss', 'join', - 'ibss-test', '2412', 'HT20', 'fixed-freq', - '02:22:33:44:55:66']) + dev[0].host.execute("iw dev " + dev[0].ifname + " set type adhoc") + dev[0].host.execute("iw dev " + dev[0].ifname + " ibss join ibss-test 2412 HT20 fixed-freq 02:22:33:44:55:66") ssid="ibss" try: dev[0].request("AP_SCAN 2") @@ -312,7 +309,7 @@ def test_ibss_open_retry(dev): dev[0].request("REASSOCIATE") bssid0 = wait_ibss_connection(dev[0]) - subprocess.check_call(['iw', 'dev', dev[0].ifname, 'ibss', 'leave']) + dev[0].host.execute("iw dev" + dev[0].ifname + " ibss leave") time.sleep(1) dev[0].request("DISCONNECT") finally: @@ -358,13 +355,14 @@ def test_ibss_5ghz(dev): try: _test_ibss_5ghz(dev) finally: - subprocess.call(['iw', 'reg', 'set', '00']) + dev[0].host.execute("iw reg set 00") + dev[1].host.execute("iw reg set 00") dev[0].flush_scan_cache() dev[1].flush_scan_cache() def _test_ibss_5ghz(dev): - subprocess.call(['iw', 'reg', 'set', 'US']) for i in range(2): + dev[i].host.execute("iw reg set US") for j in range(5): ev = dev[i].wait_event(["CTRL-EVENT-REGDOM-CHANGE"], timeout=5) if ev is None: @@ -395,15 +393,16 @@ def test_ibss_vht_80p80(dev): try: _test_ibss_vht_80p80(dev) finally: - subprocess.call(['iw', 'reg', 'set', '00']) + dev[0].host.execute("iw reg set 00") + dev[1].host.execute("iw reg set 00") dev[0].flush_scan_cache() dev[1].flush_scan_cache() def _test_ibss_vht_80p80(dev): - subprocess.call(['iw', 'reg', 'set', 'US']) for i in range(2): + dev[i].host.execute("iw reg set US") for j in range(5): - ev = dev[i].wait_event(["CTRL-EVENT-REGDOM-CHANGE"], timeout=5) + ev = dev[i].wait_event(["CTRL-EVENT-REGDOM-CHANGE"], timeout=10) if ev is None: raise Exception("No regdom change event") if "alpha2=US" in ev: