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: