From patchwork Thu Apr 7 05:38:01 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: 607242 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 3qgWcK5Jcyz9t4T for ; Thu, 7 Apr 2016 15:39:13 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=tieto.com header.i=@tieto.com header.b=Shm5zBv+; 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 1ao2eq-000562-2I; Thu, 07 Apr 2016 05:39:08 +0000 Received: from mail-lf0-x232.google.com ([2a00:1450:4010:c07::232]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ao2ef-0004wi-Lx for hostap@lists.infradead.org; Thu, 07 Apr 2016 05:39:02 +0000 Received: by mail-lf0-x232.google.com with SMTP id j11so48841801lfb.1 for ; Wed, 06 Apr 2016 22:38:34 -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:in-reply-to:references; bh=EXmGCvC/EutheCdu3pkr7KoKeKZtKiUqbyBaZby7NIo=; b=Shm5zBv+WQj1EaLaLQONTeRJW5gkwofNSo+Es/x5EmMY4O9gpos+RSusgGk6IYLvK8 0WTuQTMOyojO/JEj8ileCi7zHNNZ7krAIEPpyApQP6YqMMi6edQJZSCYBOUjiyNEsuj1 O1x1nHoxJ+iodmwr1SpDRUr01qsVG9QSW4Ego= 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:in-reply-to :references; bh=EXmGCvC/EutheCdu3pkr7KoKeKZtKiUqbyBaZby7NIo=; b=DSKY3ymtJXAzEUHIRS3iDvPc8jpyczHq7S6GxmmKP4fP21mr3YnQS4TV1FavP8r+z3 fEy65sHoSW0aqgyancEKbpiDtaRfNEfKSPRsst1opT1btF3wqyz239i+5+NEzhFynMbt oHcpi4FgBpDt1/UnQ4JDnI7l1kcqBs5nfWiGT+AwxNKO5SnWQmmQxJOOs8/iAUL1a3c7 yM4wJn8LRM2mH+FQ6WmB0XrvV6/3UGxB6wKfEBWT33/V31wc0+1/iuV7RNzyweQM1ls8 99hv7yVJWpUYgdNGxjnhHIuYwJdpByL1pnejbUS4+G1hXLl5/0EoVq/JcDsa6Zs4qoDX 7cJw== X-Gm-Message-State: AD7BkJJgWfbypRL8S78g1llMWdVweOp8CBtaCDEpkx7jeD6DLc3EVqvcsJk3SnDyGz4+1bH7tZSAXTe9skNPpAAFKSMVATA/sp/tlSwaJwI5CfvP/Q2MUnp174vQ6Gyiq4sev/6MQEs5rHN1kR/IDhoyROVu6/8fw95F6WAf2q0REGyjUgznOhZWPGfRfjIXud0V X-Received: by 10.25.143.203 with SMTP id r194mr535139lfd.154.1460007513104; Wed, 06 Apr 2016 22:38:33 -0700 (PDT) Received: from localhost.localdomain ([213.192.73.50]) by smtp.gmail.com with ESMTPSA id f134sm938018lff.34.2016.04.06.22.38.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 06 Apr 2016 22:38:32 -0700 (PDT) From: Janusz Dziedzic To: hostap@lists.infradead.org Subject: [PATCH v2 03/17] tests: pass apdev to hostapd.add_iface() Date: Thu, 7 Apr 2016 07:38:01 +0200 Message-Id: <1460007495-17921-3-git-send-email-janusz.dziedzic@tieto.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1460007495-17921-1-git-send-email-janusz.dziedzic@tieto.com> References: <1460007495-17921-1-git-send-email-janusz.dziedzic@tieto.com> X-DomainID: tieto.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160406_223858_039720_92E5570E X-CRM114-Status: GOOD ( 10.18 ) 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:c07:0:0:0:232 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 Pass apdev param to hostapd.add_iface() Signed-off-by: Janusz Dziedzic --- tests/hwsim/hostapd.py | 13 +++++++++++-- tests/hwsim/test_ap_acs.py | 2 +- tests/hwsim/test_ap_dynamic.py | 4 ++-- tests/hwsim/test_ap_vlan.py | 2 +- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/tests/hwsim/hostapd.py b/tests/hwsim/hostapd.py index 931c666..868f664 100644 --- a/tests/hwsim/hostapd.py +++ b/tests/hwsim/hostapd.py @@ -399,8 +399,17 @@ def add_bss(phy, ifname, confname, ignore_error=False, hostname=None, if not hapd.ping(): raise Exception("Could not ping hostapd") -def add_iface(ifname, confname, hostname=None, port=8878): - logger.info("Starting interface " + ifname) +def add_iface(apdev, confname, ifname=None): + if ifname == None: + ifname = apdev['ifname'] + try: + hostname = apdev['hostname'] + port = apdev['port'] + logger.info("Starting interface " + hostname + "/" + port + " " + ifname) + except: + logger.info("Starting interface " + ifname) + hostname = None + port = 8878 hapd_global = HostapdGlobal(hostname=hostname, port=port) hapd_global.add_iface(ifname, confname) port = hapd_global.get_ctrl_iface_port(ifname) diff --git a/tests/hwsim/test_ap_acs.py b/tests/hwsim/test_ap_acs.py index 71feb76..8f1f492 100644 --- a/tests/hwsim/test_ap_acs.py +++ b/tests/hwsim/test_ap_acs.py @@ -95,7 +95,7 @@ def test_ap_multi_bss_acs(dev, apdev): force_prev_ap_on_24g(apdev[0]) # start the actual test - hostapd.add_iface(ifname, 'multi-bss-acs.conf') + hostapd.add_iface(apdev[0], 'multi-bss-acs.conf') hapd = hostapd.Hostapd(ifname) hapd.enable() wait_acs(hapd) diff --git a/tests/hwsim/test_ap_dynamic.py b/tests/hwsim/test_ap_dynamic.py index 0ba0bae..a859651 100644 --- a/tests/hwsim/test_ap_dynamic.py +++ b/tests/hwsim/test_ap_dynamic.py @@ -182,7 +182,7 @@ def test_ap_multi_bss_config(dev, apdev): ifname2 = apdev[0]['ifname'] + '-2' ifname3 = apdev[0]['ifname'] + '-3' logger.info("Set up three BSSes with one configuration file") - hostapd.add_iface(ifname1, 'multi-bss.conf') + hostapd.add_iface(apdev[0], 'multi-bss.conf', ifname1) hapd = hostapd.Hostapd(ifname1) hapd.enable() multi_check(dev, [ True, True, True ]) @@ -193,7 +193,7 @@ def test_ap_multi_bss_config(dev, apdev): hostapd.remove_bss(apdev[0], ifname1) multi_check(dev, [ False, False, False ]) - hostapd.add_iface(ifname1, 'multi-bss.conf') + hostapd.add_iface(apdev[0], 'multi-bss.conf', ifname1) hapd = hostapd.Hostapd(ifname1) hapd.enable() hostapd.remove_bss(apdev[0], ifname1) diff --git a/tests/hwsim/test_ap_vlan.py b/tests/hwsim/test_ap_vlan.py index 030f3cb..79c4166 100644 --- a/tests/hwsim/test_ap_vlan.py +++ b/tests/hwsim/test_ap_vlan.py @@ -330,7 +330,7 @@ def ap_vlan_iface_cleanup_multibss(dev, apdev, cfgfile): ifname = apdev[0]['ifname'] # start the actual test - hostapd.add_iface(ifname, cfgfile) + hostapd.add_iface(apdev[0], cfgfile) hapd = hostapd.Hostapd(ifname) hapd1 = hostapd.Hostapd("wlan3-2", 1) hapd1.enable()