From patchwork Sat Sep 26 11:26:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janusz Dziedzic X-Patchwork-Id: 1371746 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=j1RUxyDl; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=bJsqkcJQ; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Bz63Z0kfjz9sSf for ; Sat, 26 Sep 2020 21:28:25 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Owner; bh=JY9aTpWqV7c2H61suAWf+bQHUUTtdBeVdKqJJ4BJ/Jk=; b=j1RUxyDlxVGQlp2WOk5MSAgfY1 f9BJgpekwgQ5fy33JBoWCSqje45wLH4IeaqO9pgK4hDyzydokXQeiX8ubkS2e5eX0MGZpLkVZ6UQw nSnqahXC+j59VsDZbcoWLPmh0dP3Yj8og9NTrAHlIO1Tt4Hx7+YJgSwA6zDrr/CgVcXUo1cSbM2kI 8cCrkWbbDn3ZQkPfZI4UQVQwfl6rxQZ1R1BFwthVZnl+o1y0U/BKYTkzhSbPGuTQYaXR6RcgCP1Jo 8hJEdiTs3IKOL2paRt9fh8XdHyIsdwz6Nwuj5T/kGWyZsF4Z9M32j+4l6qCTgA68aG0yVDx5LiRfB bwqwbbAg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kM8MW-0002oe-Fm; Sat, 26 Sep 2020 11:27:32 +0000 Received: from mail-lj1-x22a.google.com ([2a00:1450:4864:20::22a]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kM8MU-0002nY-P0 for hostap@lists.infradead.org; Sat, 26 Sep 2020 11:27:31 +0000 Received: by mail-lj1-x22a.google.com with SMTP id k25so4535718ljg.9 for ; Sat, 26 Sep 2020 04:27:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=AMjXYGutrrTc+xuz1D/rFivz3fwM3SYqM1/xUC1m0I0=; b=bJsqkcJQz2EnPMpmvGndPQ/M3cRjpOPllDBpcAc5bawQ+GNHZWgN6q6n24yh98SCmL rJOptIT40fiK/k0GzqLCfTlEmo9R4QtkGLDezeiibmTQ30l2BmzMWww7MLWuMSBMoolb FWZ43PcZS0Kvgt16uQ6BfnLRK01FQ4y/a3DkrND8A0dhhQmeQB+tNDqsM0/VhgQ0SpFL D8W2sJZhi2zwXH8fM1KuszJQgdBvzlW+6nFzHr94TNEtYLONtJh6zBFPfSj0iNM5auZq e++pRm/Ty2gwRogPJKr5GIn6tVuZz4K37sOihUP1cdU4PuF3bkZ0JQfpuLbRRV6XoHE7 wlbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=AMjXYGutrrTc+xuz1D/rFivz3fwM3SYqM1/xUC1m0I0=; b=aT49Z/Fih9e+OsvAhZsgabfbGiE8mWnHg3a/EquEfKplk0Plr+eIMnGdl5fwuitgkl xD7NQoiPgmf7qNeCMP5yfBMgzoDUPc7d+WvwwuIoe1Rhyfe5ylVt1m/s5N5Bh7A/sZqR giI6dw7dtTTQuIxOnYN4p6V5d/CAfiu3zAVUhkJo3EjeGQRn/p2K8wO4iE8AzH5HDeK/ 07GNXaDfXT/d2w+OxlD5Ih53kr5HzDT+8PKU0PRIwqesta+ygMUz49iZbfbnWHs1S/nX HG7MPGqohTYQrHKTk6UYfUnvTMXW/1S8X5eIUv2KrrwjFvf2DpikC6ICeYoJEKvrOIw/ tUwQ== X-Gm-Message-State: AOAM530CJKEM5tNK6A2WyFcPdR6UAYdTTw/a9Y4o/KsK9t1hmdWGb6iv vhknfhgF4OYBeDTe5LpfEye5gXoysuE= X-Google-Smtp-Source: ABdhPJxgDRIOt899cYWmVxZkCE1L8WZ1L42Xixb40KTKzUweSM2qP4MhyY1y+1qeB+otYvRuyo6p6A== X-Received: by 2002:a2e:3318:: with SMTP id d24mr2868708ljc.465.1601119646781; Sat, 26 Sep 2020 04:27:26 -0700 (PDT) Received: from localhost.localdomain ([62.141.212.102]) by smtp.gmail.com with ESMTPSA id n9sm1478110lfd.215.2020.09.26.04.27.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 26 Sep 2020 04:27:26 -0700 (PDT) From: Janusz Dziedzic To: hostap@lists.infradead.org Subject: [PATCH 1/9] tests: remote: sort tests correctly Date: Sat, 26 Sep 2020 13:26:52 +0200 Message-Id: <20200926112700.6055-1-janusz.dziedzic@gmail.com> X-Mailer: git-send-email 2.17.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200926_072730_862074_2836640E X-CRM114-Status: GOOD ( 12.18 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) 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:22a listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [janusz.dziedzic[at]gmail.com] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -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 X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.29 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 Problem apear after introduce python3. Signed-off-by: Janusz Dziedzic --- tests/remote/run-tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/remote/run-tests.py b/tests/remote/run-tests.py index 95c8ab65d..e26e3483a 100755 --- a/tests/remote/run-tests.py +++ b/tests/remote/run-tests.py @@ -231,7 +231,7 @@ def main(): # sort the list test_names.sort() - tests.sort() + tests.sort(key=lambda t: t.__name__) # print help if requested_tests[0] == "help" and len(requested_hwsim_tests) == 0: From patchwork Sat Sep 26 11:26:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janusz Dziedzic X-Patchwork-Id: 1371749 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=stF4kuOr; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=rz9r6i73; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Bz63Y4DXVz9sSJ for ; Sat, 26 Sep 2020 21:28:22 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:References:In-Reply-To:Message-Id:Date:Subject:To: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=vKlRHz6G1j5UpdRN4mepLHnO8wgN5iwfBUG3fotdjSE=; b=stF4kuOr1GAHZJY15WsfEV+gO4 6hZfsWJTSkJqf6/RKIv/WyxxGkrMTBQm7vtYJoWMOfbLy5h413Vzg8182bgjLSK24VoBq+Whb9pji hDwhInQwT2oCYW4+Y6IyMmT1shC7lOnoHznpKEVGoGeuX4j7cI8g0uaDevrHAO8e5rO35VYzJ2Z5/ fmo+/qtQrDziVz49uwfpsi4TRX61gQmLKno38n7Z2CaTsiJstXQUdNYwuPHv177CXZ82nATB/Lcas IHNr6vYIr6h/xJJpmY9h/ZKNITOd/JUNbWmLttDGry+DvWHpEU/soLHNVdgADB8GcqUzzVAUYpSJw tWtaCX1g==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kM8Mb-0002qL-77; Sat, 26 Sep 2020 11:27:37 +0000 Received: from mail-lf1-x12c.google.com ([2a00:1450:4864:20::12c]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kM8MV-0002nZ-7Q for hostap@lists.infradead.org; Sat, 26 Sep 2020 11:27:32 +0000 Received: by mail-lf1-x12c.google.com with SMTP id y17so5675097lfa.8 for ; Sat, 26 Sep 2020 04:27:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Rbgl8vCCJgDAdebTMZwoMf2b+B5l8+OdDNF5zLt218o=; b=rz9r6i73j5PtFjLpVC5EVo5dfOU7um8Tg3ysmOtRx8JEBH4QWo/hEScvUPFSeyxWxh eeWVjxq3yHRzflIMWOG/3Th5fVUs7LEliXgPW1OuOwzscOyPR+PBU2s5SCcYpQ/qIcX/ fhvuLSvEL5gCEUnwauRBcUa5GWy+1Zo93MCxBjvpFDgk+bAjpaBkMj6VAxMY0L3fp1R/ sIGDLcwLvf8e5m8Jib2NMPsI+3ChZwkOtYahy3g7n49ncZe887C3WuAMRqLlDQ7Qy6oI fjQcsK+3+ht8EXtIo4Fe9axaNeygo4E4xfUpfeZ1p7Id80gpAsXyCUTo6OVZN6m+pd9D rWQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Rbgl8vCCJgDAdebTMZwoMf2b+B5l8+OdDNF5zLt218o=; b=t5KjkFtgnDlXgEDBZY47JnAxzAXAAW2tN/7mr5ZEsmFxHQFTzBXpSriY3fI9pt4WAZ vHZ85BJHJHQJfWlA8usFeiCGc9Z4QKUkB1gVmxR3mL0E6uf5fOmVeGOFVPuFUFfgaX02 LzIFxrRISLl/W5OXuHme8tceM08sbJHTC2jGIRkOSzxWUXJd+6+UCBG9sdl7DRkWAaHR B3XZhEXaqsUyC/nPdFPLCmyBFM4liP4iPAQ74HryMYngrLbkyHiZZ28aD5lCb+huT+AB InP6RfiQCnK3FAk3hAiNzYQ94dp+BeKY3Gxvoyszy0Ny0d92xuJJ/fQOGVHALIQrW7kr f/3g== X-Gm-Message-State: AOAM532HUr5B1jUeKE+uio3PiuvuDg+xXXhKlzr3gTNBS6MWUlG5ziXD EEsJwDgAvRqpe0DU/K2zL1WJQ2BtDvI= X-Google-Smtp-Source: ABdhPJwWOH2a6+eiLtotsOm8XptrfVPG8B2Ay8nI8nlxNBDPR45iBbiPp4i6oEqcHLWQnM88PhXV3A== X-Received: by 2002:a19:520b:: with SMTP id m11mr936790lfb.502.1601119647940; Sat, 26 Sep 2020 04:27:27 -0700 (PDT) Received: from localhost.localdomain ([62.141.212.102]) by smtp.gmail.com with ESMTPSA id n9sm1478110lfd.215.2020.09.26.04.27.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 26 Sep 2020 04:27:27 -0700 (PDT) From: Janusz Dziedzic To: hostap@lists.infradead.org Subject: [PATCH 2/9] tests: remote host stderr workaround Date: Sat, 26 Sep 2020 13:26:53 +0200 Message-Id: <20200926112700.6055-2-janusz.dziedzic@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200926112700.6055-1-janusz.dziedzic@gmail.com> References: <20200926112700.6055-1-janusz.dziedzic@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200926_072731_296508_857B5A62 X-CRM114-Status: GOOD ( 12.64 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) 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:12c listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [janusz.dziedzic[at]gmail.com] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -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 X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.29 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 we are using ssh MUX (which speed up a lot test execution) with remotehost we could hit cases when ssh will hang up. This depends on different ssh versions and remotehost implementation. stderr as a tmpfile fix this problem. Signed-off-by: Janusz Dziedzic --- tests/hwsim/remotehost.py | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/tests/hwsim/remotehost.py b/tests/hwsim/remotehost.py index 8e121538a..b87b58936 100644 --- a/tests/hwsim/remotehost.py +++ b/tests/hwsim/remotehost.py @@ -7,6 +7,7 @@ import logging import subprocess import threading +import tempfile logger = logging.getLogger() @@ -17,12 +18,15 @@ def remote_compatible(func): def execute_thread(command, reply): cmd = ' '.join(command) logger.debug("thread run: " + cmd) + err = tempfile.TemporaryFile() try: status = 0 - buf = subprocess.check_output(command, stderr=subprocess.STDOUT).decode() + buf = subprocess.check_output(command, stderr=err).decode() except subprocess.CalledProcessError as e: status = e.returncode - buf = e.output + err.seek(0) + buf = err.read() + err.close() logger.debug("thread cmd: " + cmd) logger.debug("thread exit status: " + str(status)) @@ -46,12 +50,15 @@ class Host(): def local_execute(self, command): logger.debug("execute: " + str(command)) + err = tempfile.TemporaryFile() try: status = 0 - buf = subprocess.check_output(command, stderr=subprocess.STDOUT) + buf = subprocess.check_output(command, stderr=err) except subprocess.CalledProcessError as e: status = e.returncode - buf = e.output + err.seek(0) + buf = err.read() + err.close() logger.debug("status: " + str(status)) logger.debug("buf: " + str(buf)) @@ -64,12 +71,15 @@ class Host(): cmd = ["ssh", self.user + "@" + self.host, ' '.join(command)] _cmd = self.name + " execute: " + ' '.join(cmd) logger.debug(_cmd) + err = tempfile.TemporaryFile() try: status = 0 - buf = subprocess.check_output(cmd, stderr=subprocess.STDOUT) + buf = subprocess.check_output(cmd, stderr=err) except subprocess.CalledProcessError as e: status = e.returncode - buf = e.output + err.seek(0) + buf = err.read() + err.close() logger.debug(self.name + " status: " + str(status)) logger.debug(self.name + " buf: " + str(buf)) From patchwork Sat Sep 26 11:26:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janusz Dziedzic X-Patchwork-Id: 1371753 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=iiQgb32L; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=qarJpO35; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Bz63f3q5yz9sR4 for ; Sat, 26 Sep 2020 21:28:30 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:References:In-Reply-To:Message-Id:Date:Subject:To: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=QiyDVyds8FT10Ezv9y+wy16AjkadieO7qfius19IbHs=; b=iiQgb32L9BgfUuHtDjHo8YE9We +WiAWqbJvr5e8O3tjQTxWE0Do3O6BT5hB4RNrQWTu0TTk2bFLrLOVRy6gZ8wbgxHZqd4gmheqO+q3 uJFKiIFj13Se9cW+cH1K8zwqI4EMRLlo4p3F0b2Lce4xMTIr2ilGq1nGiiN0u1NbJzhDpdoi3IiTL yXuEvG9RxQSL6+U4iP+prwLVHvRGZv1fKFvTvXYY3E9OniNXjMpO5EsXKXRutm67sWs4KMEJCOXBy dlJNLg2arr20ahR7PIf260vHNnlwtveUO9RVCzk6I5EQG268s6JnPjHm2PzQRfgGm0MsyBNTn8O6r G7yytl+A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kM8MZ-0002pe-Vj; Sat, 26 Sep 2020 11:27:36 +0000 Received: from mail-lj1-x22a.google.com ([2a00:1450:4864:20::22a]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kM8MU-0002na-P2 for hostap@lists.infradead.org; Sat, 26 Sep 2020 11:27:31 +0000 Received: by mail-lj1-x22a.google.com with SMTP id c2so4516282ljj.12 for ; Sat, 26 Sep 2020 04:27:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=F2iF1GK79ZwQH+j8GDOq9JIUF4jw1q2qizwndvThBug=; b=qarJpO35m5C3IBvtZlq7a+h3QlRc9mf8AwMvdyQnftFsCILT3M/V09Z34UtJi3Qdts VVb3b/7ovJ7gTRJV93CUre02hU1ytfJGAC0/LyDbIG9SZYRAFE5cDSjOCof/SMiT76Vx iY+Ey2wWylYB4ih8SD6ji43JqBntAXw0FYgbKx3c87McGW/8dfQNEYl6E0oFWI7WtJMo M0GBxiLrUCg3Y+2b2DZJYeDgUiAEXGwXRlp/HTRggc5E8RP15W27QjVMykQmh3LcUvaX wYquhCLp8j2MF9jHv8PjZfUn1Rxs//B5D1d99/K933TOdYvN+WKt7ibY3XOqaYEQ+BZj M5Pg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=F2iF1GK79ZwQH+j8GDOq9JIUF4jw1q2qizwndvThBug=; b=YWEYt0mRzdnW7Fc8pTXQMR0P5d5+mY/HKywkZyKzqn9OU2b+HMgAkjthXURfExTr9s v/K4hXRsT3ASxok22kJyVcHVBnEhaTd1ltsO/FW2W+wKlU4bZeaRWEc2PYOt3dCeN8qr 6Gh1+8slnJAgSjECt8rrhyya417NnImaxmw5kp7MTP4NSF+2kmmLBdZ7Oh4DDRGU9S8Z hg0X8Fkg9otIM2EYqtnz7VBhgG2vREGLHGpUKshGnZL6sIx/cEUf5G+A3G4xLNzvODk7 p2WkdIoDaRpBXYiZ3w1EXLz2J4i0oj6zWn3o90iMyXdvYu6gNIYHWM7hp2rL6uZMP4WT NfRg== X-Gm-Message-State: AOAM531J2R4TIzbxK9smoQmq1dkJ3rG/eSYHJ6o6ugBWr5s3M7DmrOSg DLiS8sC1IbN8qlBVYuLHz7G+U5kITQY= X-Google-Smtp-Source: ABdhPJwoP1vk9qIfdTfnAeCnF4ls+bOc7aIstj2SRvPm3Sie/Z6xmYwnK24WuqgZuW08NmTGkT1jPw== X-Received: by 2002:a2e:9ad3:: with SMTP id p19mr2449137ljj.374.1601119649203; Sat, 26 Sep 2020 04:27:29 -0700 (PDT) Received: from localhost.localdomain ([62.141.212.102]) by smtp.gmail.com with ESMTPSA id n9sm1478110lfd.215.2020.09.26.04.27.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 26 Sep 2020 04:27:28 -0700 (PDT) From: Janusz Dziedzic To: hostap@lists.infradead.org Subject: [PATCH 3/9] tests: remotehost add execute_stop() Date: Sat, 26 Sep 2020 13:26:54 +0200 Message-Id: <20200926112700.6055-3-janusz.dziedzic@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200926112700.6055-1-janusz.dziedzic@gmail.com> References: <20200926112700.6055-1-janusz.dziedzic@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200926_072730_862556_4B4BB866 X-CRM114-Status: GOOD ( 12.70 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) 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:22a listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [janusz.dziedzic[at]gmail.com] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -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 X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.29 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 Before we have to kill application we start in the thread - in most cases using killall and sometimes kill other applicantions eg. tcpdump, iper, iperf3, tshark With this patch we are able to stop/kill single application/thread instead, base on pid file. Signed-off-by: Janusz Dziedzic --- tests/hwsim/remotehost.py | 58 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 54 insertions(+), 4 deletions(-) diff --git a/tests/hwsim/remotehost.py b/tests/hwsim/remotehost.py index b87b58936..a1ef1f34b 100644 --- a/tests/hwsim/remotehost.py +++ b/tests/hwsim/remotehost.py @@ -8,6 +8,7 @@ import logging import subprocess import threading import tempfile +import os logger = logging.getLogger() @@ -34,6 +35,17 @@ def execute_thread(command, reply): reply.append(status) reply.append(buf) +def gen_reaper_file(conf): + fd, filename = tempfile.mkstemp(dir='/tmp', prefix=conf + '-') + f = os.fdopen(fd, 'w') + + f.write("#!/bin/sh\n") + f.write("name=\"$(basename $0)\"\n") + f.write("echo $$ > /tmp/$name.pid\n") + f.write("exec \"$@\"\n"); + + return filename; + class Host(): def __init__(self, host=None, ifname=None, port=None, name="", user="root"): self.host = host @@ -86,17 +98,55 @@ class Host(): return status, buf.decode() # async execute - def execute_run(self, command, res): + def execute_run(self, command, res, use_reaper=True): + if use_reaper: + filename = gen_reaper_file("reaper") + self.send_file(filename, filename) + self.execute(["chmod", "755", filename]) + _command = [filename] + command + else: + filename = "" + _command = command + if self.host is None: - cmd = command + cmd = _command else: - cmd = ["ssh", self.user + "@" + self.host, ' '.join(command)] + cmd = ["ssh", self.user + "@" + self.host, ' '.join(_command)] _cmd = self.name + " execute_run: " + ' '.join(cmd) logger.debug(_cmd) - t = threading.Thread(target=execute_thread, args=(cmd, res)) + t = threading.Thread(target=execute_thread, name=filename, args=(cmd, res)) t.start() return t + def execute_stop(self, t): + if t.name.find("reaper") == -1: + raise Exception("use_reaper required") + + pid_file = t.name + ".pid" + + if t.isAlive(): + cmd = ["kill `cat " + pid_file + "`"] + self.execute(cmd) + + # try again + self.wait_execute_complete(t, 5) + if t.isAlive(): + cmd = ["kill `cat " + pid_file + "`"] + self.execute(cmd) + + # try with -9 + self.wait_execute_complete(t, 5) + if t.isAlive(): + cmd = ["kill -9 `cat " + pid_file + "`"] + self.execute(cmd) + + self.wait_execute_complete(t, 5) + if t.isAlive(): + raise Exception("thread still alive") + + self.execute(["rm", pid_file]) + self.execute(["rm", t.name]) + def wait_execute_complete(self, t, wait=None): if wait == None: wait_str = "infinite" From patchwork Sat Sep 26 11:26:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janusz Dziedzic X-Patchwork-Id: 1371748 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=Ol9EVTiT; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=GGbzBM5B; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Bz63Z0vvLz9sSn for ; Sat, 26 Sep 2020 21:28:25 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:References:In-Reply-To:Message-Id:Date:Subject:To: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=SB2ZqriSaMgqQDFjrVtc/BRTBhYk7mm+f5C0VK0cDvw=; b=Ol9EVTiTcAncvEuo0wdJJjOelD ospwNvuyvnO59tUeu47HqbvZJuKOSoaMo+KXoIqgkJ08fwUrj6aNSfDvTxbr01hTuk3wWW8BKS5Ga n8xwgspkOv5pALy33SrBlyn5GwJIXjQw+jcqyBkq4zTd4CdJe6TwHZe62WpmFM0IRxWFBTVv1WmDl z0xzIVAShZErtkV2jTBCL8R21nkwC1iTK+VdM+U+sLiQe4eCTpZtAU1vPTpCHTz+TIZA3Q0YYz1XL TUoOhV3fCY2M3XJNowPu3H7az1YPtATx641LtjL2aI/Aa6b2qGZQGYO4PJ22tnNJ8EatXorBfP74p yaUHUejA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kM8Mc-0002qs-Er; Sat, 26 Sep 2020 11:27:38 +0000 Received: from mail-lj1-x22d.google.com ([2a00:1450:4864:20::22d]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kM8MW-0002o1-1U for hostap@lists.infradead.org; Sat, 26 Sep 2020 11:27:32 +0000 Received: by mail-lj1-x22d.google.com with SMTP id u4so4525497ljd.10 for ; Sat, 26 Sep 2020 04:27:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=n+PxdnYXqbuCw26pz4sWs+Fw7+D4Iwg2lQA1zbg4vPk=; b=GGbzBM5BKcbtsg/jmt5EKycX7g5WhQVFT6sYBb477QNLE22txTIsbCdBVSFhKzjQnA jroGsV7n9U1zaGzcZ5kwpCZK/axzP32hoMfp27gDWpCCY8nG2HMJNbBXFGGZzIkykH4s 4DJTQKOhpEcWWaJV6lneCzsbfAWtd5CFWAv20XWXj0qkvzS59QazDazeLGBglTPGz0M6 MF3GbZd7fqAdq9pziIXRBIAMZ3C/yQJdAnNzVteH3btaRsaEiwjTFA93Y8qW4T+vwhxX AG8FnSIRMz80bIrHU6G2vh6gRXW6bGqLFAzlAOY4u1V1AaxtfMQM604S/rnq3RZxHVIx G9/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=n+PxdnYXqbuCw26pz4sWs+Fw7+D4Iwg2lQA1zbg4vPk=; b=BV4bt0uLf4b3vP2B2jxw7KIxQvq7JlNxLxXhkrDyUjIoXACoHI6uXQWVA8fhyhjK2H Utd9FC7WUNUPZnURaBaoPp3AGPFRg5AtPerG3PSweeYIBQCtakUIXGScC8+HSO+DGLNB e1DGna01JJQEmnVtgtYw52RCiGtC/T1DmzNFcNcsNTWldr3LNOiU7HLjtCTmGXjsNB3S jg3e7ObHQAPdrD1dDHqft0vjWIUuCXVmZw1z/CP1YMsVa9EMSnYJoQU2/GnmnF/sR8Lw +x4XWN+sr1Uda5J4ANq9OYNzTbTDeezE5R4O0li7Q5cQJ7INQ6MZbUkvSdeho8dc7LTm GbYA== X-Gm-Message-State: AOAM531Z3QNtrQXqyYJU4xpSQ1AlAMw5aHpGJoCJ5ZQFsTGu9JadGPo+ NplMXUk34YUU6Ia4Y1V3TjiFetaAyAw= X-Google-Smtp-Source: ABdhPJyxy2e6DJ4FcZvfPiWeT5ryyRDSdox7D5MTO+ZDAwpkyOGFdtZC5sjA/enYmlwUsQqNIIYrgw== X-Received: by 2002:a2e:2e09:: with SMTP id u9mr2393544lju.23.1601119650325; Sat, 26 Sep 2020 04:27:30 -0700 (PDT) Received: from localhost.localdomain ([62.141.212.102]) by smtp.gmail.com with ESMTPSA id n9sm1478110lfd.215.2020.09.26.04.27.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 26 Sep 2020 04:27:29 -0700 (PDT) From: Janusz Dziedzic To: hostap@lists.infradead.org Subject: [PATCH 4/9] tests: remote: monitor use execute_stop() Date: Sat, 26 Sep 2020 13:26:55 +0200 Message-Id: <20200926112700.6055-4-janusz.dziedzic@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200926112700.6055-1-janusz.dziedzic@gmail.com> References: <20200926112700.6055-1-janusz.dziedzic@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200926_072732_115841_7082DEAC X-CRM114-Status: GOOD ( 11.39 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) 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:22d listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [janusz.dziedzic[at]gmail.com] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -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 X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.29 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 Stop single thread instead of kill all monitor apps. Signed-off-by: Janusz Dziedzic --- tests/remote/monitor.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tests/remote/monitor.py b/tests/remote/monitor.py index 47b5e3bbd..96dbc6564 100644 --- a/tests/remote/monitor.py +++ b/tests/remote/monitor.py @@ -107,10 +107,7 @@ def stop(host): if host.thread is None: return - host.execute(["killall", "-s", "INT", "tshark"]) - host.wait_execute_complete(host.thread, 5) - if host.thread.isAlive(): - raise Exception("tshark still alive") + host.execute_stop(host.thread) host.thread = None # Add monitor to existing interface From patchwork Sat Sep 26 11:26:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janusz Dziedzic X-Patchwork-Id: 1371745 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=uhbiR5x5; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=MjD2Zrzx; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Bz63Y0jzBz9sR4 for ; Sat, 26 Sep 2020 21:28:22 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:References:In-Reply-To:Message-Id:Date:Subject:To: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=PS17m9mnoASUTt1zE4ITc9KFomHpgz3ZMi+egG4uWJ0=; b=uhbiR5x5iPinVEs7gP6GG7RkQh KOp7Ga8GuixISRF+ejN2U2n1ChwLQm+qHQ+S5/SRDnV1DWV29s7MfI4K/3bkMeNeyMshigENNLvUu PtP+n9Sn7nGmwGhnbxw1prbAA4LDnSeppNfYSvWU44b7u3x29HFolcd4scHBj5ULB84ws+0spGWFq fRJlbBFesMeFL5Gfy0rPUXm+Ue6xnCvMEtLwnnVmMtHpKVwopsTO6RFDtHjpT1gqPkePKxpYU8Kdm 4HF0J7W4LizZAuFGN5/d4ct0TMXHTLwY9hPqNgATr8lf7kCFMZj/7lHB3qRJIIbWIM/IQlsWQ42OW vH9J/y4A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kM8Md-0002rG-Nb; Sat, 26 Sep 2020 11:27:39 +0000 Received: from mail-lj1-x244.google.com ([2a00:1450:4864:20::244]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kM8MX-0002of-FE for hostap@lists.infradead.org; Sat, 26 Sep 2020 11:27:34 +0000 Received: by mail-lj1-x244.google.com with SMTP id s205so4540958lja.7 for ; Sat, 26 Sep 2020 04:27:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=AUOxCcj9ltBqgIAWg3d9xqJYQG+FqiILqs0NCS8e/TI=; b=MjD2ZrzxZCewfm/vjgHlVC/XzPcHDcG+O0KhWjFE7YzQcW2o9sJB8SITKc5Jpopmch uiYI420rbRkgcfUgDW8BT0F9Gq74ZJAcnLluzwpJ4eQhHbOfNEwnFGiIKFxmwKZ+4S4C 35EnVwF+lEvr8sZmVG9Gue9juhThOSJ1CBeuuoVTRYTg03XOzyJoNokourjLMcZuIvQw RGM8neI9PB6JR4LMnLYcNn/QNwqYXwUzZm8V6+ozbjkcCs54CYivCMoP4M+gwUsYzh+9 Ed9MannGoonEXFqA5BCKOcz8ceX/mnkbL8JFDfpC7GR1dWD7o7OrRxBZMyMaEINsWQhq CuWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=AUOxCcj9ltBqgIAWg3d9xqJYQG+FqiILqs0NCS8e/TI=; b=nRu/1IFk8iETNY60rfbX51bKVfXEivpJyMILlxJD952lfHQkoBJWYdo+LetBdPXLC5 abd1AlhKlaVWb99OmS+SB9ZJaszzvTm2b8d7lftQd0bb4yKi5ErhNyPyJNyGHURUcLdu du3wURuk3nawXVbvFZLkkXJpISsmVgtPBVfPiFssbPGJDEzNWUngLY3a6K4baFrb1REN IeSmHpnr+3vlqiQw2NxRmSvaq9PkChUzoGg1u+eWYK8twn+QCJ7X9ZGhdy2PqSGAjUeY EX2pF6pGxdIHEB3q3xPs09FHWvUsxfhhcsm2hfKS9X1iHI56jZXkORc9h7bjq7YyOXTK /uTQ== X-Gm-Message-State: AOAM530XQSSi3jXiAXpHGvk+8NsKgZlrhP+Wlq31I81gXzQ/wNcYVLiY 9wJTkWYuvZqYwaasB+0+5/2iZRV13AI= X-Google-Smtp-Source: ABdhPJwDvSJY18bIhqlb3RRAhuMvU1HzRKhkKoBNdfn6qmVt83vpuMtck+0cVNUC65GgKFN/cknPUg== X-Received: by 2002:a2e:1444:: with SMTP id 4mr2393292lju.218.1601119651680; Sat, 26 Sep 2020 04:27:31 -0700 (PDT) Received: from localhost.localdomain ([62.141.212.102]) by smtp.gmail.com with ESMTPSA id n9sm1478110lfd.215.2020.09.26.04.27.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 26 Sep 2020 04:27:31 -0700 (PDT) From: Janusz Dziedzic To: hostap@lists.infradead.org Subject: [PATCH 5/9] tests: remote: stop supp/hostapd using pidfile Date: Sat, 26 Sep 2020 13:26:56 +0200 Message-Id: <20200926112700.6055-5-janusz.dziedzic@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200926112700.6055-1-janusz.dziedzic@gmail.com> References: <20200926112700.6055-1-janusz.dziedzic@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200926_072733_523795_8294B742 X-CRM114-Status: GOOD ( 11.19 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) 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:244 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [janusz.dziedzic[at]gmail.com] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -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 X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.29 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 Instead of killall, use pidfile. Signed-off-by: Janusz Dziedzic --- tests/remote/rutils.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/remote/rutils.py b/tests/remote/rutils.py index 0acef42d1..e80901b50 100644 --- a/tests/remote/rutils.py +++ b/tests/remote/rutils.py @@ -117,7 +117,8 @@ def run_hostapd(host, setup_params): if log_file: host.add_log(log_file) - status, buf = host.execute([setup_params['hostapd'], "-B", "-ddt", "-g", "udp:" + host.port, log]) + pidfile = setup_params['log_dir'] + "hostapd_" + host.ifname + "_" + setup_params['tc_name'] + ".pid" + status, buf = host.execute([setup_params['hostapd'], "-B", "-ddt", "-g", "udp:" + host.port, "-P", pidfile, log]) if status != 0: raise Exception("Could not run hostapd: " + buf) @@ -134,15 +135,18 @@ def run_wpasupplicant(host, setup_params): if log_file: host.add_log(log_file) - status, buf = host.execute([setup_params['wpa_supplicant'], "-B", "-ddt", "-g", "udp:" + host.port, log]) + pidfile = setup_params['log_dir'] + "wpa_supplicant_" + host.ifname + "_" + setup_params['tc_name'] + ".pid" + status, buf = host.execute([setup_params['wpa_supplicant'], "-B", "-ddt", "-g", "udp:" + host.port, "-P", pidfile, log]) if status != 0: raise Exception("Could not run wpa_supplicant: " + buf) def kill_wpasupplicant(host, setup_params): - host.execute(['killall', setup_params['wpa_supplicant']]) + pidfile = setup_params['log_dir'] + "wpa_supplicant_" + host.ifname + "_" + setup_params['tc_name'] + ".pid" + host.execute(["kill `cat " + pidfile + "`"]) def kill_hostapd(host, setup_params): - host.execute(['killall', setup_params['hostapd']]) + pidfile = setup_params['log_dir'] + "hostapd_" + host.ifname + "_" + setup_params['tc_name'] + ".pid" + host.execute(["kill `cat " + pidfile + "`"]) def get_ap_params(channel="1", bw="HT20", country="US", security="open", ht_capab=None, vht_capab=None): ssid = "test_" + channel + "_" + security + "_" + bw From patchwork Sat Sep 26 11:26:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janusz Dziedzic X-Patchwork-Id: 1371751 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=rCD3iUtw; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=MTVwDLvh; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Bz63b1VDMz9sR4 for ; Sat, 26 Sep 2020 21:28:22 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:References:In-Reply-To:Message-Id:Date:Subject:To: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Zb8gG7c68r20y68hygAqdJXXwpPmV7CV7zvRQyMLY3E=; b=rCD3iUtwUDrKIprvd88qDukVIb N2sAfuuafdIL6diXpBx0YgOCp4Q/0oKrBg+/WLRNx2UARhIMEzhbMwfLtq2HyXutjAFwO7XvMXTl3 HrboWygf2ouh6rktGrx7+vv9VrQKgtiCUwM2gOIh183jv+/0GuyrLof+cyRiaWKvK17u3CHUxjsdY EtW0Be/qu5oNUgpx0qVJd7pVA+OaFjObu6WoUcqqTa1HCVYLIKGs7x0IfQBIcT6isXs6CvKmDFe47 R8a1EFs3a93UONwjK3axTUeJu0iBsRsiCd6x+sX6btYvbMmNBfZ4aU7vU8ETE8NW0me0L2JOfNU5n BxT7yX2Q==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kM8Mf-0002rU-0V; Sat, 26 Sep 2020 11:27:41 +0000 Received: from mail-lf1-x142.google.com ([2a00:1450:4864:20::142]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kM8MY-0002p4-GV for hostap@lists.infradead.org; Sat, 26 Sep 2020 11:27:35 +0000 Received: by mail-lf1-x142.google.com with SMTP id z19so5712082lfr.4 for ; Sat, 26 Sep 2020 04:27:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=xI+cPLmOt3GfU0MJ5fY62ckiA6F9AnAGJ9rAPzfS5Jc=; b=MTVwDLvh5IqtAhz2/p2eG4dkKgdHcnUhzcUa9mLDZEX9jLeWOVcoor0OdilcM1ujsr Nk0TU70Fd+o3X7wYJQVha8W22A7t4E2C4Yt6EDQWepYOeyVMr0+MZPvHv3ndV0b0XlHN n9gt/4gAdkgok4/tAHapIAx5Q/08uGGymnMNk9UjXIOS+XAx7gT9327jHhCNjOtCuvjP b6igjqE3HtG5LG95hljm/x7pCCzq3M+eNPlgWXE65j95az9/jpNNZXTqOMf5fIZITpsR RV1LEOlETk9VSJi/8lrUWxPAzH3NLoHvAlJLkdzFCtr7wywQwMtC/4j805Va4irg37zu 8qEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=xI+cPLmOt3GfU0MJ5fY62ckiA6F9AnAGJ9rAPzfS5Jc=; b=ugtzlB0bD0zcpt4dFPNy2eB8V6BJJk/lVJbCzt+RjI7pcYB87ukARKXn3ThteiS7xG t0g5RQ1w5xlyiHPuH5BwgEm205zR2EFw4/Ve52oxhLx4cFCYphaz3Glf44lnQJef3Jzv TKuY0LC7zXyoZoiAxZYTXj+2bl5EWt4aQxAGS/LPW9xd0CEY6vUvkrMMSBvfvpuGaJ1r CfssfbgXI1h9OCjlIJEEzzTpjKgI+z3kzIr7hhdCsQL1cokVRm0I1WvLdQSnuvWnYNhL 4vlswtaYBGPM/OPgJPE6kP4yRX+Z7XO4ASPhZ/ceVFIO0llHJGz1OrraCafKQLnEudAm jNQQ== X-Gm-Message-State: AOAM533xrE5drokCVb6u13PmYaJZo5U/RRnkFE4CDEdXTunAqJ6d4R7d 0xHQAeoLQ3DmZ7aWIo4fcjZLLwopIiU= X-Google-Smtp-Source: ABdhPJybVLRNFI9HSOs7vuyyJs/JjsQncjukHjCeRqlu7v/jqMJcEi4iVK+XdDvVofE3Llp3eyUxMA== X-Received: by 2002:a19:7e0d:: with SMTP id z13mr970821lfc.455.1601119652812; Sat, 26 Sep 2020 04:27:32 -0700 (PDT) Received: from localhost.localdomain ([62.141.212.102]) by smtp.gmail.com with ESMTPSA id n9sm1478110lfd.215.2020.09.26.04.27.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 26 Sep 2020 04:27:32 -0700 (PDT) From: Janusz Dziedzic To: hostap@lists.infradead.org Subject: [PATCH 6/9] tests: remote: monitor unblock rfkill Date: Sat, 26 Sep 2020 13:26:57 +0200 Message-Id: <20200926112700.6055-6-janusz.dziedzic@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200926112700.6055-1-janusz.dziedzic@gmail.com> References: <20200926112700.6055-1-janusz.dziedzic@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200926_072734_582361_64E3A97A X-CRM114-Status: GOOD ( 11.62 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) 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:142 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [janusz.dziedzic[at]gmail.com] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -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 X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.29 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 Unblock wifi rfkill before setup/run monitor Signed-off-by: Janusz Dziedzic --- tests/remote/monitor.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/remote/monitor.py b/tests/remote/monitor.py index 96dbc6564..a97eaf928 100644 --- a/tests/remote/monitor.py +++ b/tests/remote/monitor.py @@ -63,6 +63,7 @@ def setup(host, monitor_params): logger.debug(traceback.format_exc()) break host.execute(["ifconfig", iface, " down"]) + host.execute(["rfkill", "unblock", "wifi"]) host.execute(["iw", iface, "set type monitor"]) host.execute(["ifconfig", iface, "up"]) status, buf = host.execute(["iw", iface, "set", "freq", param['freq'], From patchwork Sat Sep 26 11:26:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janusz Dziedzic X-Patchwork-Id: 1371752 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=vydkVygR; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=JFe3K560; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Bz63b1Xghz9sTN for ; Sat, 26 Sep 2020 21:28:26 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:References:In-Reply-To:Message-Id:Date:Subject:To: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=a7v8IC1m/nG5X6Ub6yVHCpyz7/RMGt8HVv7osRStfUg=; b=vydkVygREt8go2kGGjVuSg09WP zxJ33M2W8k+DdA2oDQZL/nci1EE9wY5GCH9k+3zEXvnCz1cbnzjx4btcEs7CY5zBLh9pSvCGhqhJl kqlE2GGCA5P8W2oBaUMZxtIWtFrRFyUEm6WHPD9L3Kp+tvYnaSUCbUbArzQhWfhKnlouTivXE51j6 oZ60cVMD8UZKIABTj3MmTws1LLOPuC+EIIIAKDY1oAzlgeaq/OF6k/vrlaU2HleZHFwijfLDCXK1i XDwv7Qr/GmTcbW/xieIVDI8WHdsgNHBJ4ULejUG366XpS2PVQziMUu3u6w2FP8iIFfzVsQlcCnzUW I6MLGSqw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kM8Mg-0002rr-BZ; Sat, 26 Sep 2020 11:27:42 +0000 Received: from mail-lj1-x241.google.com ([2a00:1450:4864:20::241]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kM8MZ-0002pW-LX for hostap@lists.infradead.org; Sat, 26 Sep 2020 11:27:36 +0000 Received: by mail-lj1-x241.google.com with SMTP id a22so4519027ljp.13 for ; Sat, 26 Sep 2020 04:27:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=7L+TjdpRJDlpie+kR4zddk0imIH9VddIwvKagxcfTrs=; b=JFe3K56044s/ZXEf1yitKnwpkny4G4rgekNiWCC7h1c5RL/wrZcrqPoeMK2xeOklML wUail+SHA4kYfGB8JjCgEQcR0vMc7OHMC+iWGAw2/Ii4yipvTXVMPMhF4gjmpp2e4rFT VXtrd1C6n6k049unhFk5V3ox7Vn6JY4uGahEvOmbp/7F/uvwjBOHljCMqCv36V8UHpLJ AgaUfxx8HBUNL3wkXg1085TmqBuLzXWco/3n+0wFFoz+J8sx/uCn9J2FY0gOmqycJ5JW KDDhHJtoVJtcFj46NoQ52E+kxpC2O7xy4hTAnS3Y02j+z9Y7EKDiDHR+b/R8tomISDOs 7Yhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=7L+TjdpRJDlpie+kR4zddk0imIH9VddIwvKagxcfTrs=; b=Ph0bHrdsmUxR7ItyOlIlM6zCRkXpgunYpG9yYLPMLUqt8S5L4hnp82GK/8gaErNc4b CGLsUOd44ClS9CR1ABiYsGJmYTr94jWXcvS+RfkaLPq3nLkImMgwyCd/yJ/NUqKl+xol OwN4yj6gC2rl0ahUDbnNKtwW/sB6iqRv42nGtYoptXUI5XZ/qeRT1bQ0wMEPlrr1/ArO 9dz2npPvp52RH2EC3sWxgVMLDmB+cLOT/8VzhcGg9b1emLH9VfrPpWscUBQ+NOR1GK69 MNPLr3LC0zloJDVQGETr+TgU0bkb2qp5bVqH/RI/fz/GPKfKzF+uQoBHJwz8tPofBayU JQ+A== X-Gm-Message-State: AOAM531ibrgrV4NL+WKdK4sWeXb9yOqwg3OxFjiYrrVy6c3aoyiwxHsJ 1i9K4LIzAwFgq9rJQY+8D4xtJNgfFNw= X-Google-Smtp-Source: ABdhPJxVbG7ZCGvQa57kEFzxs8yuxiaJazTF0xf1HLSJj3RxFciK11LXpSccb+A4zoultIFabQN8jw== X-Received: by 2002:a2e:9755:: with SMTP id f21mr2861865ljj.50.1601119653970; Sat, 26 Sep 2020 04:27:33 -0700 (PDT) Received: from localhost.localdomain ([62.141.212.102]) by smtp.gmail.com with ESMTPSA id n9sm1478110lfd.215.2020.09.26.04.27.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 26 Sep 2020 04:27:33 -0700 (PDT) From: Janusz Dziedzic To: hostap@lists.infradead.org Subject: [PATCH 7/9] tests: remote: allow to pass params with devname Date: Sat, 26 Sep 2020 13:26:58 +0200 Message-Id: <20200926112700.6055-7-janusz.dziedzic@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200926112700.6055-1-janusz.dziedzic@gmail.com> References: <20200926112700.6055-1-janusz.dziedzic@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200926_072735_758258_598677E5 X-CRM114-Status: GOOD ( 11.41 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) 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:241 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [janusz.dziedzic[at]gmail.com] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -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 X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.29 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 Allow to pass params together with device name eg. -m mon1:1,20,1,0 Signed-off-by: Janusz Dziedzic --- tests/remote/config.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/remote/config.py b/tests/remote/config.py index 5a6b728ac..1ac362ead 100644 --- a/tests/remote/config.py +++ b/tests/remote/config.py @@ -69,6 +69,8 @@ def get_devices(filename="cfg.py"): def get_device(devices, name=None, flags=None, lock=False): if name is None and flags is None: raise Exception("Failed to get device") + word = name.split(":") + name = word[0] for device in devices: if device['name'] == name: return device From patchwork Sat Sep 26 11:26:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janusz Dziedzic X-Patchwork-Id: 1371750 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=AzAJgH+o; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=G9V6kGvr; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Bz63Z2V3Kz9sTM for ; Sat, 26 Sep 2020 21:28:26 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:References:In-Reply-To:Message-Id:Date:Subject:To: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Jd+mGDwWkOEhXH+j/aCgkf8tSalCLyeNoxZlRpxzuaw=; b=AzAJgH+oWau+g7ve5JBFX56/oe WoW/kHMWhDzc7P0/PK+WE5P/sUxqdiQAj0Bj9lQwNhGJDkmPTct2j8vu7UFaSlbbBshRhsuJfAfjf DUBAojC/WFPdlUXPonbrhpW2t24v9169+Id+v1twB4opM0bFCZoWEYILkr0gC4qdtOtpa20IyK9lw EQBoC2w396wln8CMAnfR+1ACnD3dUKs7LbHEgSfSheFZuZ0ePTlXwIDmft/OLwc+AraGIfTCHXI0U 3+1QzEWHNQ83o21026VIgv/8Sfl5e9QBSzeCL+d7dA9020jxayF8Jn4hsyG7XNH0gtsBLZ285024t 3FAlpymg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kM8Mh-0002s8-Dd; Sat, 26 Sep 2020 11:27:43 +0000 Received: from mail-lf1-x12c.google.com ([2a00:1450:4864:20::12c]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kM8Ma-0002ps-F9 for hostap@lists.infradead.org; Sat, 26 Sep 2020 11:27:37 +0000 Received: by mail-lf1-x12c.google.com with SMTP id d15so5677044lfq.11 for ; Sat, 26 Sep 2020 04:27:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=EoLrq6m4gkU+GOiAxTfYOV6OLpM+3yXgm4RUmuBYwfc=; b=G9V6kGvr5iYisebC/OYGN1vNNT95VHm7E3IqBPEAK5E9Pi5U0AMmjIb0vo5bERmFiC 0Tmm6zDy28dxjztm+GQjFnAT4uVPa4j73KLbNJ7N3K29Zc8PB6e3pu0osL3truGXU8y5 wR8fng+jZ/012IlJLuSVinfDptuW9hNkolRqOd22enUFRlPqajHikVxk3xQC6my3705G RK3cCPQGVHZ2B/YuYmFk9qQzaz5v9vavNM9g6204XKDHjjRVTDooCFsl9Eb4BzywTsrN DH7IgIQR1MtEjhzFRLeOgGfVg2AqNqLFZc5Xjt9pZYu/et0jFwRC7v2AnfM/L3B3kJ7e vWEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=EoLrq6m4gkU+GOiAxTfYOV6OLpM+3yXgm4RUmuBYwfc=; b=jESETUMnfRDYvuBTKLGqzDrZCnggwESRH9Uv+31J1enk/9sNmWJ+m49yR0ErZlZw7z YNcnqNU0G4TtONr+VzLosQzsobGmcWSc/1CQ8bYbFncv0ppJEnFpyDIQIcXhnsJ5dNI6 XvMzbT01sh9IbStMFegWIe/jSpGLAt9Ikneb2SXpSIgZ29vGCS0N5LYuxGRFoq6lqjku sj+8gH0bSX7iYjGJaREZFW1C116LhPcZCXR9nOJKcf0L2A8nPm96YTYmjoKVsMLdEUEa VhtPrPGK4XTAtqFpUOcRsTXJKkNzuJY3cZKn7KEqTHT2m+ICXg3wxNEdrqAa5NRQ0tDy tOIQ== X-Gm-Message-State: AOAM5327dM0UEtp8U/mA42+2/DGne2+WG1qlMWUakxSMN4xnmBFyoU0l r/QcJ7N1DE9LXva9IdNy1HZuv4wCN5A= X-Google-Smtp-Source: ABdhPJwnWlZ7PbelbRHeY9hQ9QrG4Wy7HyuBfdPmuk4U5gHOGUP+wvq1efiaTtV+qID9OI3zAM87Rw== X-Received: by 2002:a19:6758:: with SMTP id e24mr1139605lfj.255.1601119655077; Sat, 26 Sep 2020 04:27:35 -0700 (PDT) Received: from localhost.localdomain ([62.141.212.102]) by smtp.gmail.com with ESMTPSA id n9sm1478110lfd.215.2020.09.26.04.27.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 26 Sep 2020 04:27:34 -0700 (PDT) From: Janusz Dziedzic To: hostap@lists.infradead.org Subject: [PATCH 8/9] tests: remote: monitor allow to pass params Date: Sat, 26 Sep 2020 13:26:59 +0200 Message-Id: <20200926112700.6055-8-janusz.dziedzic@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200926112700.6055-1-janusz.dziedzic@gmail.com> References: <20200926112700.6055-1-janusz.dziedzic@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200926_072736_561454_56C8A1D8 X-CRM114-Status: GOOD ( 13.77 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) 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:12c listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [janusz.dziedzic[at]gmail.com] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -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 X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.29 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 This is mainly for standalone monitor in case we know and would like to setup specyfic monitor configuration. -m monitor:,, , :... eg: -m monitor:1,40,3,0 -m e4300:1,40,3,0:11,40,9,0 This also support monitor with multiple interfaces (one pcap). Signed-off-by: Janusz Dziedzic --- tests/hwsim/remotehost.py | 1 + tests/remote/monitor.py | 18 ++++++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/tests/hwsim/remotehost.py b/tests/hwsim/remotehost.py index a1ef1f34b..dec1ad5a8 100644 --- a/tests/hwsim/remotehost.py +++ b/tests/hwsim/remotehost.py @@ -57,6 +57,7 @@ class Host(): self.ifname = ifname self.port = port self.dev = None + self.monitor_params = [] if self.name == "" and host != None: self.name = host diff --git a/tests/remote/monitor.py b/tests/remote/monitor.py index a97eaf928..937b10005 100644 --- a/tests/remote/monitor.py +++ b/tests/remote/monitor.py @@ -26,7 +26,8 @@ def create(devices, setup_params, refs, duts, monitors): mons.append(monitor) for mon in mons: - dev = config.get_device(devices, mon) + word = mon.split(":") + dev = config.get_device(devices, word[0]) if dev is None: continue @@ -35,6 +36,15 @@ def create(devices, setup_params, refs, duts, monitors): port=dev['port'], name=dev['name']) + for iface_param in word[1:]: + params = iface_param.split(",") + if len(params) > 3: + monitor_param = { "freq" : rutils.c2f(params[0]), + "bw" : params[1], + "center_freq1" : rutils.c2f(params[2]), + "center_freq2" : rutils.c2f(params[3]) } + host.monitor_params.append(monitor_param) + try: host.execute(["iw", "reg", "set", setup_params['country']]) rutils.setup_hw_host(host, setup_params, True) @@ -49,11 +59,15 @@ def destroy(devices, hosts): stop(host) for monitor in host.monitors: host.execute(["ifconfig", monitor, "down"]) + host.monitor_params = [] -def setup(host, monitor_params): +def setup(host, monitor_params = None): if host is None: return + if monitor_params == None: + monitor_params = host.monitor_params + ifaces = re.split('; | |, ', host.ifname) count = 0 for param in monitor_params: From patchwork Sat Sep 26 11:27:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janusz Dziedzic X-Patchwork-Id: 1371747 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=3FiMewRB; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=KcKvskCf; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Bz63Y303bz9sSG for ; Sat, 26 Sep 2020 21:28:25 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:References:In-Reply-To:Message-Id:Date:Subject:To: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=xxc1vsaopI/d57JQGND0KsMnWbPUi58Mcu970Cbkl2k=; b=3FiMewRBJMtvsyLV2Q+HmlMsNt EWg2zhGEpP0XpIrasBPPlI77+Z/LdaYvDiyKq7mgno4ZJkpVkKRC5OIJmx0yuMF4MILKYXpsZCwEu +mUQzYDCNeGJr74SsILLZXwa9BWduM2/kWsLx0ZurKyZl8A/Vs8lAPmNPffFpnkZWLsq7KZiBfdTr YBXjBtnbxyA031DzcnsWj9qCi6xwrUB8c0mxZBi+5Q+/s0wNcNQnD9qb14C43KuA7Kr1fCj94W+eh oaMTDrkeSPZiWGzwjUM8SbvK2lcn3uCEjby80foQlVbtr0Y5bGPHOrxyC1H8udH78er3JuGN3T0yd A73Q5o4A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kM8Mi-0002sN-DE; Sat, 26 Sep 2020 11:27:44 +0000 Received: from mail-lj1-x242.google.com ([2a00:1450:4864:20::242]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kM8Mc-0002qJ-06 for hostap@lists.infradead.org; Sat, 26 Sep 2020 11:27:38 +0000 Received: by mail-lj1-x242.google.com with SMTP id k25so4582786ljk.0 for ; Sat, 26 Sep 2020 04:27:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=o0lVar17u1Dr3TfYTZ+GryZE6cNUPVWA78uzr3uDQw8=; b=KcKvskCfkmsM/nIOkGvARefgDDaKXmLkYPvuLHRe0fkomBw7kwkYB24qAA0ly0rSen Ow5ztYVF3Jyh9eBq/oRTIMwsbOy2n8Sv6PySYRebZf9ZgaVdxT8n8WLZT15BC3IHAWJY bSjfi/w0yvPwOxCsU7o2H94PzRNHuqJOwmG0bobtH0rghpRKv79WmhdZ0uLx+rq8OCAK cZ9MOqEhkDoiY7tQ/5pkBrtY1NrwhpWTH+5B7v+o3hd6Gaqrp5+LVdJXuI5KXLdHPTsg eniquHiBXSQB2iEs9EJVnK2kwy5R73m0k3rkXGak642pqv/CN30bP2P/WCh4hHPMubMS kc+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=o0lVar17u1Dr3TfYTZ+GryZE6cNUPVWA78uzr3uDQw8=; b=UtCedbfMurfvnjYpHfOO/TPSclNifygb/udGEYKdYGuNHOfu8d+nFTp5OAJqLu2pKY VxrapuMG73BXiJpo71i58Tgvd4TNLFbZpzYNhcWWh9prGO3telwPk4MSXfu3ZcHURLh0 hWYFy5VVy3vNHIIshN5Jn51MX7iRd1V/UETJriAl95aVmgjsn1b/NV4IYtqh4qj3rF7k A1IqGtoxVga8eA6ghSYbtoV4wjCLkSQ/pm9PQQ51YNHtyhKJJcuceFuBioPpY+yBfri9 nIhRYO4yiInENs87g40jfCSjribDnvQIDCZKgTgO5M0gzPmXsGKc+NUplzRTeDYbYSJ8 Ppdg== X-Gm-Message-State: AOAM531FkTJI6tLqefE2s3okk+C2OCCGqzUep2qa0Ws8qhDl4gmXxdKu uW8wj1NYg4lyzh3PfIcKIK3LWKIrr7k= X-Google-Smtp-Source: ABdhPJzqxiR0kU+chBDcPIvABzc9UvKuTVuqiKUC9iBUHZXz5U+oE0YGawy+ZCG5m9ZBV8S8RsHEEg== X-Received: by 2002:a2e:9212:: with SMTP id k18mr2844948ljg.241.1601119656277; Sat, 26 Sep 2020 04:27:36 -0700 (PDT) Received: from localhost.localdomain ([62.141.212.102]) by smtp.gmail.com with ESMTPSA id n9sm1478110lfd.215.2020.09.26.04.27.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 26 Sep 2020 04:27:35 -0700 (PDT) From: Janusz Dziedzic To: hostap@lists.infradead.org Subject: [PATCH 9/9] tests: remote: add run_monitor test case Date: Sat, 26 Sep 2020 13:27:00 +0200 Message-Id: <20200926112700.6055-9-janusz.dziedzic@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200926112700.6055-1-janusz.dziedzic@gmail.com> References: <20200926112700.6055-1-janusz.dziedzic@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200926_072738_092845_AD9FF373 X-CRM114-Status: GOOD ( 16.32 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) 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:242 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [janusz.dziedzic[at]gmail.com] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -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 X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.29 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 This is usefull to run monitor quickly: ./run-tests.py -t run_monitor -m mon:36,20,36,0:1,20,1,0 In such example we will get one PCAP for 36/20 and 1/20. After execution, PCAP file is in log directory, eg: ./logs/2019_11_11_13_36_24/run_monitor_mon_wlp3s0_wlp5s0.pcap Signed-off-by: Janusz Dziedzic --- tests/remote/test_monitor.py | 52 ++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 tests/remote/test_monitor.py diff --git a/tests/remote/test_monitor.py b/tests/remote/test_monitor.py new file mode 100644 index 000000000..55187fb7d --- /dev/null +++ b/tests/remote/test_monitor.py @@ -0,0 +1,52 @@ +# Monitor support +# +# This software may be distributed under the terms of the BSD license. +# See README for more details. + +import remotehost +import config +import rutils +import monitor +import time +import os + +import logging +logger = logging.getLogger() + +def run_monitor(devices, setup_params, refs, duts, monitors, seconds = None): + try: + air_monitor = [] + output = "\n\tPCAP files:\n" + # setup log dir + local_log_dir = setup_params['local_log_dir'] + + # add/run monitors if requested + air_monitors = monitor.create(devices, setup_params, refs, duts, + monitors) + for air_monitor in air_monitors: + monitor.setup(air_monitor) + monitor.run(air_monitor, setup_params) + logger.warning(air_monitor.name + " - monitor started ...") + + if seconds != None: + time.sleep(int(seconds)) + else: + input("\tPress Enter to end ailogs capturing...") + + # destroy monitor / get pcap + monitor.destroy(devices, air_monitors) + for air_monitor in air_monitors: + for log in air_monitor.logs: + head, tail = os.path.split(log) + output = output + "\t" + local_log_dir + "/" + tail + "\n" + air_monitor.get_logs(local_log_dir) + return output + except: + for air_monitor in air_monitors: + monitor.destroy(devices, air_monitors) + air_monitor.get_logs(local_log_dir) + raise + +def test_run_monitor(devices, setup_params, refs, duts, monitors): + """TC run standalone monitor""" + return run_monitor(devices, setup_params, refs, duts, monitors)