From patchwork Wed Mar 30 08:55:58 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: 603266 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 3qZhNP0pK1z9s6r for ; Wed, 30 Mar 2016 19:57:09 +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=UYI1EImt; 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 1alBvw-0006za-QZ; Wed, 30 Mar 2016 08:57:00 +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 1alBvk-0006KJ-WE for hostap@lists.infradead.org; Wed, 30 Mar 2016 08:56:54 +0000 Received: by mail-lf0-x232.google.com with SMTP id e133so30815652lfe.3 for ; Wed, 30 Mar 2016 01:56:26 -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=XlgrbLt2/YOXMh5qnARuWGWaBTKmE65dFSU7Pquz0HQ=; b=UYI1EImtoUOtvkEdqLgf/mkbdUjRoPa5Dvz/Yr7ijs4nDe6y+gJ2UdRL1mlZYhdaN4 yajOPNhikG6fSOryZgj7YaAZI8HY1xlQ4dKLm6p1Jpry8PSinSqv1zclb473p43MXjeb /XtmjraChSgIaDdZJduZVXNbuYmtgtFJtUUlU= 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=XlgrbLt2/YOXMh5qnARuWGWaBTKmE65dFSU7Pquz0HQ=; b=lUvqjlu2PP3U649kb32vcz31cP0vCm0ViTjIeEFoz45zdCiOKABdziWDxzLo1U8z8W lS+Sh9cAtK0/W/nZ89PFtIadJNcLjmY0O6mDroggHKFYfzDlrxY+SisuGhq+DfRFDRAM eJGdpSf0+u1iIoGGBCSiKvxZV1b6sWFtHZZRJPCdYKoOqMqRAtfiJccYoOAxcGuhNRN4 g51ONfqN8HCDp+rcRnmeZsIG9bZ4WkepHsNgoju/4BeSJgAh1Rf2ekwzex7EW2TXv4io n6qSiM8JKPU6r9rDEFLR/aVdbkiQZbe6tErlcpJPDBamx66ra+ZBK6HXIvdv4atS5aN3 HFIg== X-Gm-Message-State: AD7BkJJhA2nEgdAlmbkhXZdMr8r3wbxorHM1BMfqaPRU7+QljCGrElcw5j5yQ68v6V0LnbDWQbF42GS+dND71G2TT+znIltOSh8SgmR14UDXpBIM5TUD3M5mO1tNPN6MuVgdSiY0zTTQl8A5g+LE0gIF+DYfo7pLZbye+tMbEBg31paWqx7CasWUr2R4DYYgr6Sw X-Received: by 10.25.162.144 with SMTP id l138mr3400605lfe.32.1459328184896; Wed, 30 Mar 2016 01:56:24 -0700 (PDT) Received: from dell6430.wifi.local ([91.198.246.8]) by smtp.gmail.com with ESMTPSA id t2sm422839lbr.45.2016.03.30.01.56.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 30 Mar 2016 01:56:24 -0700 (PDT) From: Janusz Dziedzic To: hostap@lists.infradead.org Subject: [PATCH 3/6] tests: pass apdev to add_iface() Date: Wed, 30 Mar 2016 10:55:58 +0200 Message-Id: <1459328161-4298-4-git-send-email-janusz.dziedzic@tieto.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1459328161-4298-1-git-send-email-janusz.dziedzic@tieto.com> References: <1459328161-4298-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-20160330_015649_368352_13E25DFE X-CRM114-Status: UNSURE ( 9.18 ) 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: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 to add_iface() function. Before we pass only ifname. So, now we can handle also remote hosts, while we can get apdev['hostname']. Signed-off-by: Janusz Dziedzic --- tests/hwsim/hostapd.py | 12 ++++++++++-- tests/hwsim/test_ap_acs.py | 2 +- tests/hwsim/test_ap_dynamic.py | 4 ++-- tests/hwsim/test_ap_vlan.py | 2 +- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/tests/hwsim/hostapd.py b/tests/hwsim/hostapd.py index 5ee22bb..a4af629 100644 --- a/tests/hwsim/hostapd.py +++ b/tests/hwsim/hostapd.py @@ -400,8 +400,16 @@ def add_bss(phy, apdev, confname, ignore_error=False): 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 = 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 dac2d20..742abfc 100644 --- a/tests/hwsim/test_ap_dynamic.py +++ b/tests/hwsim/test_ap_dynamic.py @@ -188,7 +188,7 @@ def test_ap_multi_bss_config(dev, apdev): apdev2['ifname'] = apdev[0]['ifname'] + '-2' apdev3['ifname'] = apdev[0]['ifname'] + '-3' logger.info("Set up three BSSes with one configuration file") - hostapd.add_iface(apdev1['ifname'], 'multi-bss.conf') + hostapd.add_iface(apdev1, 'multi-bss.conf') hapd = hostapd.Hostapd(apdev1['ifname']) hapd.enable() multi_check(dev, [ True, True, True ]) @@ -199,7 +199,7 @@ def test_ap_multi_bss_config(dev, apdev): hostapd.remove_bss(apdev1) multi_check(dev, [ False, False, False ]) - hostapd.add_iface(apdev1['ifname'], 'multi-bss.conf') + hostapd.add_iface(apdev1, 'multi-bss.conf') hapd = hostapd.Hostapd(apdev1['ifname']) hapd.enable() hostapd.remove_bss(apdev1) 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()