From patchwork Sun May 29 12:03:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Afek X-Patchwork-Id: 627495 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2001:1868:205::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 3rHdhk0t2cz9t49 for ; Sun, 29 May 2016 22:04:22 +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=wG80rODH; 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 1b6zRz-0000Bn-O2; Sun, 29 May 2016 12:04:11 +0000 Received: from mail-pa0-x244.google.com ([2607:f8b0:400e:c03::244]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1b6zRx-0000AO-7x for hostap@lists.infradead.org; Sun, 29 May 2016 12:04:10 +0000 Received: by mail-pa0-x244.google.com with SMTP id fg1so18321891pad.3 for ; Sun, 29 May 2016 05:03:47 -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=bf4aX9TGId2SpdUcVFXLy1YDTBRH/cb/D4oWQmWbVYw=; b=wG80rODH2rVu36UsHLwDrQQ/RJ+zxt6LjNV6GKKsDDVZpG85PFZ946XqPWWpzVHsB0 Uu5JPF+6KIGQu5MEwbuT5bASzUMfcnBS8i1vvh0e/Uos63S0K0YGfHpUEUMcUeFDVh5U 4hIGCokisWAs3Rl5P0r5OX8PTUxGPs6pyAFGYiBI7XTBuDmBPq9QdiE9+ZD2DOjLHJPx cre/czUY3xz+9AAhbYrfG+WZvXRbZYX8Pf50WjNu8BL9ddAlO5wxIBZd5XF9mCh7XZSI 8WzdRO6JBAcjatF/0aa0hp/lA1Ds+YkvZepD+x3/wfkaygNXZSL0J2YiVcLW6vsHLTyk hRlQ== 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=bf4aX9TGId2SpdUcVFXLy1YDTBRH/cb/D4oWQmWbVYw=; b=ZlL8hu+xNPPOfrqiGB443bSOjtkbfw1JXkv0/1JbDwI2Aa2VI9bNmv9MrLbI5wVHaD GdBX1Mdj3BT5laW6enn28gIkkjGpfUe5AEV3fuHfRkppi639+9Alr1t6L2iXBs3XR5rx YE7LrVOOejnuJuoDJkwShIhSzvjBrTDVC3dTP3pkbIlk2G5al9lF42XY/rNADPNYdoSY flq5ULYG9nXKoTbD74dkXg7FnV08YH+TaWpVltxGllrudzH6PmFmJr3Uf265NcTzrjyU 800xAzaBp+qTcIk19TDDmfCIrdkWtbQcOhogxW0XQColUI+sm8cx+mI/DyEm9+6vDOwg i9ZQ== X-Gm-Message-State: ALyK8tLv6LxlaPus9N/EPC5n0WYjuSWvK0ELX9XITIBg+KnddPx4Emhdj64o8k9AvjwV/A== X-Received: by 10.66.242.3 with SMTP id wm3mr37551017pac.81.1464523427100; Sun, 29 May 2016 05:03:47 -0700 (PDT) Received: from localhost.localdomain ([192.55.54.43]) by smtp.gmail.com with ESMTPSA id 141sm25778591pfx.68.2016.05.29.05.03.45 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 29 May 2016 05:03:46 -0700 (PDT) From: Jonathan Afek To: hostap@lists.infradead.org Subject: [PATCH v2 1/9] tests: Support P2P group interfaces in hwsim remote tests Date: Sun, 29 May 2016 15:03:40 +0300 Message-Id: <1464523420-25109-1-git-send-email-jonathan@wizery.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1463663210-15610-1-git-send-email-jonathan@wizery.com> References: <1463663210-15610-1-git-send-email-jonathan@wizery.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160529_050409_331018_9AAF9E1C X-CRM114-Status: GOOD ( 11.18 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.6 points) 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:244 listed in] [list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid 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 Start using the wpa_supplicant remote udp interface for the control and monitor sockets for P2P group interfaces so that p2p tests would work on real hardware. Also have the group requests and events show in the test log with the hostname and the interface name of the group interface. Signed-off-by: Jonathan Afek --- tests/hwsim/wpasupplicant.py | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/tests/hwsim/wpasupplicant.py b/tests/hwsim/wpasupplicant.py index 77c84f8..9ec820e 100644 --- a/tests/hwsim/wpasupplicant.py +++ b/tests/hwsim/wpasupplicant.py @@ -23,6 +23,7 @@ class WpaSupplicant: self.group_ifname = None self.gctrl_mon = None self.host = remotehost.Host(hostname, ifname) + self._group_dbg = None if ifname: self.set_ifname(ifname, hostname, port) res = self.get_driver_status() @@ -156,10 +157,26 @@ class WpaSupplicant: logger.debug(self.global_dbg + ifname + ": CTRL(global): " + cmd) return self.global_ctrl.request(cmd) + @property + def group_dbg(self): + if self._group_dbg is not None: + return self._group_dbg + if self.group_ifname is None: + raise Exception("can't have group_dbg without group_ifname") + if self.hostname is None: + self._group_dbg = self.group_ifname + else: + self._group_dbg = self.hostname + "/" + self.group_ifname + return self._group_dbg + def group_request(self, cmd): if self.group_ifname and self.group_ifname != self.ifname: - logger.debug(self.group_ifname + ": CTRL: " + cmd) - gctrl = wpaspy.Ctrl(os.path.join(wpas_ctrl, self.group_ifname)) + if self.hostname is None: + gctrl = wpaspy.Ctrl(os.path.join(wpas_ctrl, self.group_ifname)) + else: + port = self.get_ctrl_iface_port(self.group_ifname) + gctrl = wpaspy.Ctrl(self.hostname, port) + logger.debug(self.group_dbg + ": CTRL(group): " + cmd) return gctrl.request(cmd) return self.request(cmd) @@ -574,7 +591,11 @@ class WpaSupplicant: res['ifname'] = s[2] self.group_ifname = s[2] try: - self.gctrl_mon = wpaspy.Ctrl(os.path.join(wpas_ctrl, self.group_ifname)) + if self.hostname is None: + self.gctrl_mon = wpaspy.Ctrl(os.path.join(wpas_ctrl, self.group_ifname)) + else: + port = self.get_ctrl_iface_port(self.group_ifname) + self.gctrl_mon = wpaspy.Ctrl(self.hostname, port) self.gctrl_mon.attach() except: logger.debug("Could not open monitor socket for group interface") @@ -755,7 +776,7 @@ class WpaSupplicant: while True: while self.gctrl_mon.pending(): ev = self.gctrl_mon.recv() - logger.debug(self.group_ifname + ": " + ev) + logger.debug(self.group_dbg + "(group): " + ev) for event in events: if event in ev: return ev