From patchwork Sat Mar 9 19:42:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janusz Dziedzic X-Patchwork-Id: 1910130 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=Lm6tgolO; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=APx6RjHw; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TsYPD0bTrz23qr for ; Sun, 10 Mar 2024 06:43:26 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=NBoigVwaYVl9+PI86x2ymJoZgCrzTGSDnzezqsnevhA=; b=Lm6tgolO4s2zO1 8f1+nbm5Ico+e1ZKo3tR7bJZeA7UIA3INhXmWVLDDrraAG/zNobtgrTbDxIAupqvo70ruAoi7g0ln OXx6yXXrLPU3r9MOWRAxHebzv7R7X6kgNOhsjITVcCx8I68gqInZzwrR+BEE9XfmVcSzZ4hlMY3g2 REmtjKJiVhesBUpO+XpYVjG7R3gFb7xrx3dOH2HYZlIbiS9+kmMlAhmIqK2CzhrIjVwX6fp+zbl5+ a0+8mn9HrfPSifUNYwb2r4hb651hI82oGlS0JcgyejXAA53L8tyoLFIBEkMfamfTEjqEY7LDu5aRt 4g7nxNDJ8EYRms1CiFMQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rj2ay-0000000E6uL-0Nvf; Sat, 09 Mar 2024 19:43:00 +0000 Received: from mail-ed1-x531.google.com ([2a00:1450:4864:20::531]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rj2an-0000000E6qH-3gje for hostap@lists.infradead.org; Sat, 09 Mar 2024 19:42:52 +0000 Received: by mail-ed1-x531.google.com with SMTP id 4fb4d7f45d1cf-56838e00367so1133871a12.0 for ; Sat, 09 Mar 2024 11:42:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710013366; x=1710618166; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=B77Rjz/SCRHx9orcp94Ox2FRCKtQczQmbqLSe0S7QB4=; b=APx6RjHw2uCHu6nM5wVpz9JHBXAviX47pY658foX8cDtt1z9nlUDj8IfKHrmuZZPI5 hYtFq00ZFNWxbqfd+xaFr1JXMUmqbnV5Et0mxoJli90a2Jal3QDHCruES/qiTQXdp/EI ehKdZbMLBKH5ibyLyaHh0bJFsIBdqD2m+vJPVvu8V/pb+qFKQd8pZDrc4o4VQSynpNBb wG5Et3FhcgyuEePwuHlNAfTVmOwUxEMPNlVCSC6QoJTUn9rVoY3rI3q++TYauoSNPl9t MBzo5YSlszBWgaV5U1kTir5uIBaY+rDOXRVUDVwQWWIgdBrLUakhHjjkLc04RF4mEh6E niSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710013366; x=1710618166; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=B77Rjz/SCRHx9orcp94Ox2FRCKtQczQmbqLSe0S7QB4=; b=KSsY/UiWWev+kcYysEMx4Myj0zik4KBd0hune9Apm8HRPO93P4JI5zUUSE8Vaa7jRh iYcf0opo2nStiQcpz7m+gxKPq+bVhoeLYs/7a40FAj+4EEHao16NThHzZCdwwrvxF2qr MqvJdw+CiX7Mq8zdzTJVuwKNGPpG47oqx3t9D4RUwOw73qTRpnbAOXos1PZFajPB1CZV 4WRMlmLEAu6kniqv5nOGO2WyPcC0h80GRv04abITXVL678kgAUygklxygjVErPmeHXzW MTVPCIsiTNrsrIgIPIqfDvY1lfz6xR436BrIz7IBGPtbN1VcLrzIe0LeNWpS91o0vGxb WPQg== X-Gm-Message-State: AOJu0YybnzW4lJnpZgus06KBeNkaHullVtrDw49COEjOpYNdtdRnC/y2 1OUmT/zMCdZz4yI+CkjMpqIZVBVXu5D9ShldWVtFPBej/5ycqETrCnYJmcao X-Google-Smtp-Source: AGHT+IEh1QqGnr/KbhivyPHozUdciwG97go1calax7WXFFquq6B/BctsiSd9YViHjVt0IYY0xmcsNA== X-Received: by 2002:a50:9e85:0:b0:566:9fef:1ee9 with SMTP id a5-20020a509e85000000b005669fef1ee9mr1856423edf.22.1710013365748; Sat, 09 Mar 2024 11:42:45 -0800 (PST) Received: from e850.lan ([62.141.192.106]) by smtp.gmail.com with ESMTPSA id y2-20020aa7c242000000b0056740ba5eb0sm1206107edo.37.2024.03.09.11.42.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Mar 2024 11:42:45 -0800 (PST) From: Janusz Dziedzic To: hostap@lists.infradead.org Cc: j@w1.fi, Janusz Dziedzic Subject: [PATCH 3/7] tests: wpasupplicant: allow to use remote wpa_cli Date: Sat, 9 Mar 2024 20:42:24 +0100 Message-Id: <20240309194228.4186699-3-janusz.dziedzic@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240309194228.4186699-1-janusz.dziedzic@gmail.com> References: <20240309194228.4186699-1-janusz.dziedzic@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240309_114250_083907_FBD8398A X-CRM114-Status: GOOD ( 10.66 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Signed-off-by: Janusz Dziedzic --- tests/hwsim/wpasupplicant.py | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/tests/hwsim/wpasupplicant.py b/tests/hwsim/wpasupplicant.py index 8912310b9..15dce0ac9 100644 --- a/tests/hwsim/wpasupplicant.py +++ b/tests/hwsim/wpasupplicant.py @@ -19,7 +19,7 @@ wpas_ [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:531 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [janusz.dziedzic(at)gmail.com] -0.0 T_SCC_BODY_TEXT_LINE No description available. X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Signed-off-by: Janusz Dziedzic --- tests/hwsim/wpasupplicant.py | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/tests/hwsim/wpasupplicant.py b/tests/hwsim/wpasupplicant.py index 8912310b9..15dce0ac9 100644 --- a/tests/hwsim/wpasupplicant.py +++ b/tests/hwsim/wpasupplicant.py @@ -19,7 +19,7 @@ wpas_ctrl = '/var/run/wpa_supplicant' class WpaSupplicant: def __init__(self, ifname=None, global_iface=None, hostname=None, - port=9877, global_port=9878, monitor=True): + port=9877, global_port=9878, monitor=True, remote_cli=False): self.monitor = monitor self.hostname = hostname self.group_ifname = None @@ -31,6 +31,7 @@ class WpaSupplicant: self.ifname = None self.host = remotehost.Host(hostname, ifname) self._group_dbg = None + self.remote_cli = remote_cli if ifname: self.set_ifname(ifname, hostname, port) res = self.get_driver_status() @@ -42,10 +43,16 @@ class WpaSupplicant: self.global_iface = global_iface if global_iface: if hostname != None: - self.global_ctrl = wpaspy.Ctrl(hostname, global_port) - if self.monitor: - self.global_mon = wpaspy.Ctrl(hostname, global_port) - self.global_dbg = hostname + "/" + str(global_port) + "/" + if remote_cli: + self.global_ctrl = wpaspy.Ctrl(global_iface, global_port, hostname=hostname) + if self.monitor: + self.global_mon = wpaspy.Ctrl(global_iface, global_port, hostname=hostname) + self.global_dbg = hostname + "/global" + else: + self.global_ctrl = wpaspy.Ctrl(hostname, global_port) + if self.monitor: + self.global_mon = wpaspy.Ctrl(hostname, global_port) + self.global_dbg = hostname + "/" + str(global_port) + "/" else: self.global_ctrl = wpaspy.Ctrl(global_iface) if self.monitor: @@ -164,9 +171,14 @@ class WpaSupplicant: self.remove_ifname() self.ifname = ifname if hostname != None: - self.ctrl = wpaspy.Ctrl(hostname, port) - if self.monitor: - self.mon = wpaspy.Ctrl(hostname, port) + if self.remote_cli: + self.ctrl = wpaspy.Ctrl(wpas_ctrl, port, hostname=hostname, ifname=ifname) + if self.monitor: + self.mon = wpaspy.Ctrl(wpas_ctrl, port, hostname=hostname, ifname=ifname) + else: + self.ctrl = wpaspy.Ctrl(hostname, port) + if self.monitor: + self.mon = wpaspy.Ctrl(hostname, port) self.host = remotehost.Host(hostname, ifname) self.dbg = hostname + "/" + ifname else: @@ -185,6 +197,8 @@ class WpaSupplicant: def get_ctrl_iface_port(self, ifname): if self.hostname is None: return None + if self.remote_cli: + return None res = self.global_request("INTERFACES ctrl") lines = res.splitlines()