From patchwork Sun Jan 12 22:02:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janusz Dziedzic X-Patchwork-Id: 1221873 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=2607:7c80:54:e::133; helo=bombadil.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; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20170209 header.b=eXB1+ben; 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=tKr6OHGQ; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (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 47wrLk5VZXz9s4Y for ; Mon, 13 Jan 2020 09:02:50 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.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=drYFx/gx1AYLlNV0WTjAoDrnvswn3cmERkBKFcaXOwE=; b=eXB 1+benwjXcFPajuzcfisIwStApJ3lp2f3o2aY3The2o+Eu8fAS6A9tMFbIasjogLeibfg1Zw86tkxB x2/qujFJRsMSHKqc8A3L9prsB0LKbv9028qMYdbKLaBzdTElZwQ/aZKggH+n9N8FBSKDDXc+RR+/0 eZCuWLk1WjaJZeYFGglNwHg6Yfm2PKdoh1JGE9FkbdBUQ311NqXOypQEKiFtcdPL4Kqb8QY38WR5v YxOjWTlIn5ZppHW3rrEO0Q93M8gSHb4Jtvuu43gZiYCE0PIMp3XPMShg1JWuhHvPN7J9tkVuCgyIc bRNR+Ob7Yzs7uZk8X34U2hxRNS0Rm+Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iqlJh-00027y-QU; Sun, 12 Jan 2020 22:02:41 +0000 Received: from mail-lj1-x233.google.com ([2a00:1450:4864:20::233]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iqlJd-00026I-IR for hostap@lists.infradead.org; Sun, 12 Jan 2020 22:02:38 +0000 Received: by mail-lj1-x233.google.com with SMTP id y4so7872251ljj.9 for ; Sun, 12 Jan 2020 14:02:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=PBBJgJMDHf1hOe7YXdR967WyKMt5OqnWKGKQRjgQLsg=; b=tKr6OHGQwcj5u784S7qLCHaJJRmM7H8/pgqIp0kd4Pewjrxe4Hhft01D8cd5b+vude 1x8m7oTxaaVqywTy3IzCZ6NrqeIcyCsiW6iCnNYdIILmBfzbevlgw3H2+pzJiidntZqH 8hjAYe2Si/7isoe3rTbjt7qll0yTy/q/YAB1nZRerO49/F86cUjxo7Cs2xZTpT/QVUee 7vj2g6zoEchcr/mDYM0w7Rd/xOsJHoz2ycoeR5elJeaR607sBWONCTzwlGVrEXRybUZu dwUSYBXBykyCaY3ZXCBHYysRMsjKmDCxhLdqWjvw8P9WK6RhR25ak1+NWLa+Bo909Weg P9Yg== 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=PBBJgJMDHf1hOe7YXdR967WyKMt5OqnWKGKQRjgQLsg=; b=It5iiRmhDeIHR5FXKURQ6hthYF8w7v+wqnwpOkh8ROIKkYsJi/FEiFOL8vga7RqEMe 0f2IcfsBA1d9pC48fxR7BG05w0AboksZ3mvn81DlQ535pbnDymK7LTOFmoZZWYeAD1U3 eBllTbHTYbkIByvPyL0ZNRowOAHJ1tPaKatFNHxjcsDYmD6v+mrplFfWRI739E2rSZgX Y5HVP1OC8BXfJLGeZIZf3rjPzRGfLPZNZZaQgTUy+t3eUUjrA0ODeopaX/8gWHcSNWz+ f0TyFiuFDY/BETiEHN3oJ4QwkoixO4prh69tiNdIQX6Ks+UxJULEjZptneVUaDVCi8ie CxPQ== X-Gm-Message-State: APjAAAWArR4NBc76MarOZ4BaQM88pihXCFSenM/IZ4KnfXmuJa54QzMn VTDrU+n770tsmQAuUwfx6y8zt3d/ X-Google-Smtp-Source: APXvYqz8AdKLHykP5TgXZ0PIzA8J+QHGKDyW0PIHfoZU+YEG5U2o36IRtVnlq2kETyw/Pb+hpNqRrQ== X-Received: by 2002:a2e:880a:: with SMTP id x10mr8773911ljh.211.1578866554653; Sun, 12 Jan 2020 14:02:34 -0800 (PST) Received: from e4300.lan ([62.141.210.6]) by smtp.gmail.com with ESMTPSA id u18sm4831325lje.69.2020.01.12.14.02.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Jan 2020 14:02:34 -0800 (PST) From: Janusz Dziedzic To: hostap@lists.infradead.org Subject: [PATCH 01/12] tests: remote: switch to python3 Date: Sun, 12 Jan 2020 23:02:15 +0100 Message-Id: <20200112220226.5056-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-20200112_140237_638184_AF901A02 X-CRM114-Status: UNSURE ( 9.35 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.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:233 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_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.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 Switch to 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 550071253..b93ea9b18 100755 --- a/tests/remote/run-tests.py +++ b/tests/remote/run-tests.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python3 # # Remote test case executor # Copyright (c) 2016, Tieto Corporation From patchwork Sun Jan 12 22:02:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janusz Dziedzic X-Patchwork-Id: 1221874 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=2607:7c80:54:e::133; helo=bombadil.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; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20170209 header.b=CmCTzp5c; 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=Pg4ENz/R; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (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 47wrLq0tHNz9s4Y for ; Mon, 13 Jan 2020 09:02:58 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.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=A9e/pXZxsPbLLu4CXq37PDjBbpNJdjfEK9OhLXvGNRw=; b=CmCTzp5c3BjwgwjE6OoskxUHLC GAjq93zUIlu5agIBCxWj+LsYqpGRbGTnGlpUP10fLNoWJj1UweZfRJLXjg3bcfinohIAuoxww1XId bScv7QQC417qkKLrK+MznIyXCOxg6WLPsU5dIRqXoFlyTidwWJC2WdDrz757iackrw5w+ekCwXc5Y CwnmyfbZnBUwR0SakoJ/8X09UidtS1gHo3KxutLx+NSsEr/vXMcRsV+E88ksb+hTzQM9q87qc38Me Qh4ifW7TgEdh+duZQCLduk3bhcNreXVVpLgD7jPAqoqrNHNdGesKF6YQcxTYOmgaB1m84J5uYVxcc cCJHvR8g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iqlJq-0002GZ-Bd; Sun, 12 Jan 2020 22:02:50 +0000 Received: from mail-lf1-x133.google.com ([2a00:1450:4864:20::133]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iqlJd-00026O-JU for hostap@lists.infradead.org; Sun, 12 Jan 2020 22:02:38 +0000 Received: by mail-lf1-x133.google.com with SMTP id y1so5408157lfb.6 for ; Sun, 12 Jan 2020 14:02:37 -0800 (PST) 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=FEPN393AAn4HZRBJ0lYPtgG8CvWULrFPteFyWcrkcuI=; b=Pg4ENz/RS0nxEDZ3OomhHxFufUWD/TMuxoB5bXsN1BoXJP66SE+3D0R/3u/ubcFCOe ek7nWGGaEoazvMheg1vqgcouPTVVkGkIoA6maefET8I3OCikgg1HoI33+UfQ55ZadwXE 20SQ6HYgpCxl772VPRozSnuuLHgV40sLMdgA+hjZVS95av731zB6IF7+efml6vOe/ySj kGGw49vw9CIsNpX5+juXcJXW7qjD4qX0Lbmicj3jsG/LeI5nRX9yplrXriy7ylaIt5Xq UZ7HJ+vIT0LeZGJ8uDw+Pn+lIRYt4DP4C22eEWLjAv9b4s/qP1gLWWI30NHIB9K9amVY /hcg== 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=FEPN393AAn4HZRBJ0lYPtgG8CvWULrFPteFyWcrkcuI=; b=ZWYbfs5WPnF+jaurMfMPpRC+UedRh5SvPTDGCNDytt8qimNbRKLE9fDdOxdbVeOqHC +dl/9/E+Ampr6qUdp1jWM8zoN+WgKURCJ4YzBxk5E5JLUxyFz9ba8tv/pcHvIw9KaNDG iFOHPWGDpRjHcik0WbFdOm0ZftzuQZc3ZFMV3GQQOcziQ4H43sYYhbC6yXZIvNCB4WYA kThe9KdO/pBqb4JH7uH2G7yAt8q+xtRbxoodvfqKdHuzQlaN2ZLH5k3a38DrEahATa/1 K+SAvaZoOwdo8vfdW02RxJuitf/bZ9U/Ami4gDHt0Wkz4VlX5dIGacO/TlbNb7TiKaAb OlJA== X-Gm-Message-State: APjAAAUSu3nmYUjNS4Jdgm0R559XI1wjFyeZIdN/MgTeqNWcnelL9kX3 ArsfJEMGi0jXtvOn+qf2CWXtNwb2 X-Google-Smtp-Source: APXvYqxbrVL3Gxkvdr/d25yMy4ug8t3FCPND4vSy61PSaumULxpt575epQu/HuSjMZhg71EpP3XS9Q== X-Received: by 2002:a19:e011:: with SMTP id x17mr7663659lfg.59.1578866555705; Sun, 12 Jan 2020 14:02:35 -0800 (PST) Received: from e4300.lan ([62.141.210.6]) by smtp.gmail.com with ESMTPSA id u18sm4831325lje.69.2020.01.12.14.02.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Jan 2020 14:02:35 -0800 (PST) From: Janusz Dziedzic To: hostap@lists.infradead.org Subject: [PATCH 02/12] tests: remote: kill correct hostapd/supplicant Date: Sun, 12 Jan 2020 23:02:16 +0100 Message-Id: <20200112220226.5056-2-janusz.dziedzic@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200112220226.5056-1-janusz.dziedzic@gmail.com> References: <20200112220226.5056-1-janusz.dziedzic@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200112_140237_638547_0524A34E X-CRM114-Status: GOOD ( 10.05 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.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:133 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_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.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 Kill hostapd and wpa_supplicant base on config params. Before we could kill wrong processes. Signed-off-by: Janusz Dziedzic --- tests/remote/config.py | 4 ++-- tests/remote/hwsim_wrapper.py | 8 ++++---- tests/remote/rutils.py | 6 ++++++ 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/tests/remote/config.py b/tests/remote/config.py index 55c601316..5a6b728ac 100644 --- a/tests/remote/config.py +++ b/tests/remote/config.py @@ -17,8 +17,8 @@ logger = logging.getLogger() # definitions in the format as below. In other case HWSIM cfg will be used. # setup_params = {"setup_hw" : "./tests/setup_hw.sh", - "hostapd" : "./tests/hostapd", - "wpa_supplicant" : "./tests/wpa_supplicant", + "hostapd" : "./tests/hostapd-rt", + "wpa_supplicant" : "./tests/wpa_supplicant-rt", "iperf" : "iperf", "wlantest" : "./tests/wlantest", "wlantest_cli" : "./tests/wlantest_cli", diff --git a/tests/remote/hwsim_wrapper.py b/tests/remote/hwsim_wrapper.py index c1bbb27d7..36df8d7a8 100644 --- a/tests/remote/hwsim_wrapper.py +++ b/tests/remote/hwsim_wrapper.py @@ -88,10 +88,10 @@ def run_hwsim_test(devices, setup_params, refs, duts, monitors, hwsim_test): monitor.remove(dut_host) for ref_host in ref_hosts: - ref_host.execute(["killall", "wpa_supplicant"]) + rutils.kill_wpasupplicant(ref_host, setup_params) ref_host.get_logs(local_log_dir) for dut_host in dut_hosts: - dut_host.execute(["killall", "hostapd"]) + rutils.kill_hostapd(dut_host, setup_params) dut_host.get_logs(local_log_dir) if mon is not None: wlantest.Wlantest.reset_remote_wlantest() @@ -113,10 +113,10 @@ def run_hwsim_test(devices, setup_params, refs, duts, monitors, hwsim_test): monitor.remove(dut_host) for ref_host in ref_hosts: - ref_host.execute(["killall", "wpa_supplicant"]) + rutils.kill_wpasupplicant(ref_host, setup_params) ref_host.get_logs(local_log_dir) for dut_host in dut_hosts: - dut_host.execute(["killall", "hostapd"]) + rutils.kill_hostapd(dut_host, setup_params) dut_host.get_logs(local_log_dir) if mon is not None: wlantest.Wlantest.reset_remote_wlantest() diff --git a/tests/remote/rutils.py b/tests/remote/rutils.py index 70255b999..5e8a86021 100644 --- a/tests/remote/rutils.py +++ b/tests/remote/rutils.py @@ -138,6 +138,12 @@ def run_wpasupplicant(host, setup_params): if status != 0: raise Exception("Could not run wpa_supplicant: " + buf) +def kill_wpasupplicant(host, setup_params): + host.execute(['killall', setup_params['wpa_supplicant']]) + +def kill_hostapd(host, setup_params): + host.execute(['killall', setup_params['hostapd']]) + 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 Sun Jan 12 22:02:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janusz Dziedzic X-Patchwork-Id: 1221875 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=2607:7c80:54:e::133; helo=bombadil.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; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20170209 header.b=m4Ev7fTi; 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=K6vi4w1U; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (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 47wrLv3mXLz9s4Y for ; Mon, 13 Jan 2020 09:03:03 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.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=kZvf/H+94246tz9EX3/KzOFrA/cH7aiFpC4mte8NGLA=; b=m4Ev7fTixAH/UWyQ8UYSdViFCW 0y/Rg306256ksybT5LyIOJAJsOFzuZfICozbyWHmt3mZlvkFXxdLmXUddRVGZpDW8NKFTYaTmpByo yy/IGXnRgJoWtDMMAWLKHrLRtWt4MX0Od8FHTGhU7QcYxHc9W+dMx4vGbA74cYZCTU6wO0Y+cTGCK od7c0YZJhqdu/vHph4GvgW8Axo6T55vdNatRZgNftIvYe7B7hACXZ8GjeVg1bHiBu23dFofT5SLXB x+gVH3kcLvCF37Y8Iqyjrozx/ujFBEsOisMUyvEM45j+RZ+prAc5U/U54eCf3+mk2K2BBP+3eItsX qvvb7Rrw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iqlJz-0002Qt-Fi; Sun, 12 Jan 2020 22:02:59 +0000 Received: from mail-lf1-x131.google.com ([2a00:1450:4864:20::131]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iqlJe-00026V-JF for hostap@lists.infradead.org; Sun, 12 Jan 2020 22:02:40 +0000 Received: by mail-lf1-x131.google.com with SMTP id n25so5432194lfl.0 for ; Sun, 12 Jan 2020 14:02:38 -0800 (PST) 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=Pbg3DR/4aUvTnsj1rRFbl/qMkBtvq2p2LaX8ky0ehVc=; b=K6vi4w1UXvItfHwoHlfhX5vF/pHAf482pPUl1svItoCpPe0jnSW+MLHNyAD+6htel5 MqUNC/gCp8buB3UWP8Ib+t92wG9Mdt8t2H9sOq4D2vybhuSDQsY2c0M4POV/rINFt8ju 43vGJl+iq48fmPjFiibxCbDxZJU8lrBzbGmm01wXIK/1cxa9QzjmA3Ao+PvWmDl3/9ll cEGQnhD44mgCAv8rPppqFfgYYZMxbuOSUFjoYoo6wKFL6dUmMBrqcv7juTtQsvtm21ze bE39DXm2NFGTh4VBPUiH8uhZM7fjbm4PjpEbEtrYeniA04/zNAbv7ral0jhRZRftAl/I UtUw== 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=Pbg3DR/4aUvTnsj1rRFbl/qMkBtvq2p2LaX8ky0ehVc=; b=LLgaMDqbprYsXXMdgEYTlx4ouL0lPuohHseizFp6QSY6JtS6SXfjd8+996md60WQB4 4BTSOEZKeLbGPkGHeQzJZAL/bKIf2Wlr68DR04mcAiIgywykV9WqeTyHJj/SbKOruXZ1 GRLp71zDjYuiuWcTVW2gKv8/YsY5OYFHybrKWl3m7pMyW2valoec3qal6bNSeX748AFH r2S6Dyg1qLedEzV/idljejJS7AX/XYinNTyFWsFb96qzOp/HGt42ICeqmf+pg59bKdT1 jO6Qu+hmFJLNDs4WWdgV3+5ttBgyYc5x5DNGPmoU2Ld0/ek3PYRPNdzbnQzYJCiUkq3e 1LYA== X-Gm-Message-State: APjAAAVwMNgw3iGO2LKgj7kKE3pGmMIGeZSiSi4X6fBnjfkPaWjFM7nO c/Hgfjv2vLfrXj1SE1EAntlL/cWR X-Google-Smtp-Source: APXvYqy4s0tsESfUoaLQd8YN5uXwAmLEl/xBiLfbNatNKXcFIlYPo+NaThw4vRQJJpYyL5McoyLnBA== X-Received: by 2002:a19:903:: with SMTP id 3mr7801728lfj.110.1578866556679; Sun, 12 Jan 2020 14:02:36 -0800 (PST) Received: from e4300.lan ([62.141.210.6]) by smtp.gmail.com with ESMTPSA id u18sm4831325lje.69.2020.01.12.14.02.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Jan 2020 14:02:36 -0800 (PST) From: Janusz Dziedzic To: hostap@lists.infradead.org Subject: [PATCH 03/12] tests: remote: show dev/apdev for hwsim Date: Sun, 12 Jan 2020 23:02:17 +0100 Message-Id: <20200112220226.5056-3-janusz.dziedzic@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200112220226.5056-1-janusz.dziedzic@gmail.com> References: <20200112220226.5056-1-janusz.dziedzic@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200112_140238_629355_97D0D7E1 X-CRM114-Status: UNSURE ( 9.44 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.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:131 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_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.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 hwsim wrapper used in remote tests show also which device will be used as apdev - hostapd dev - wpa_supplicant Signed-off-by: Janusz Dziedzic --- tests/remote/run-tests.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/remote/run-tests.py b/tests/remote/run-tests.py index b93ea9b18..b68610816 100755 --- a/tests/remote/run-tests.py +++ b/tests/remote/run-tests.py @@ -278,9 +278,15 @@ def main(): # now run test cases for dut in duts: - logger.warning("DUT: " + str(dut)) + if len(requested_hwsim_tests) > 0: + logger.warning("DUT (apdev): " + str(dut)) + else: + logger.warning("DUT: " + str(dut)) for ref in refs: - logger.warning("REF: " + str(ref)) + if len(requested_hwsim_tests) > 0: + logger.warning("REF (dev): " + str(ref)) + else: + logger.warning("REF: " + str(ref)) for monitor in monitors: logger.warning("MON: " + str(monitor)) From patchwork Sun Jan 12 22:02:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janusz Dziedzic X-Patchwork-Id: 1221876 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=2607:7c80:54:e::133; helo=bombadil.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; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20170209 header.b=rTRanomg; 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=jBgsjMlX; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (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 47wrM8050Yz9sPW for ; Mon, 13 Jan 2020 09:03:16 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.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=puCcfVHZjQVgVmLBppcDZtfcdOCrlFuEHGENd3nHhQU=; b=rTRanomgChErS8LatratsirNfy hYD4EBRFfKwaF6EUz3s13Z4hbc1Gj6znCXzZpNWIX43bZ05udIkcZI/KQKSFpmQ3j2XPuRR0vDvr4 SWzbASGK9M00Kxv8BHzhP/IOBAiuys2O/MDMKKoFTl49oUh28gTBE46YvfG0yysWDnj9r0IY74mDS rY5PpTTXJSdEUOkMFJVdaNxrNOXTWFqrFU39VgsWGX8lt+dfGP0Hgvh1XWuJ6H4CbFKRPln6giypu y0GGxhNj/BzypNPD9QQRCm0H+AC3LrglknTx34W6JobPCVeEufW2cidM0mZCpmwggdNKbMa5pKQQo b+yjEbng==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iqlK8-0002c1-PX; Sun, 12 Jan 2020 22:03:08 +0000 Received: from mail-lf1-x12b.google.com ([2a00:1450:4864:20::12b]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iqlJf-00026y-Id for hostap@lists.infradead.org; Sun, 12 Jan 2020 22:02:40 +0000 Received: by mail-lf1-x12b.google.com with SMTP id y19so5403316lfl.9 for ; Sun, 12 Jan 2020 14:02:39 -0800 (PST) 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=/3EbpcyHlJ06fS7NQ8wWeJ84StSJuYP6CXQBHgqtHz4=; b=jBgsjMlX5yxbx/KU5YuZc1Gh2bZKmxSsmgJsVnjwhOsIZPAnd435UmMmlP232tu27+ o+7t5pjJUVx1+4J4sxp4ys1eZ8nwUFXZP2bvjPUE4G39E+833rAuxQSnJSMQFrG0itB9 rD6QlEjejGkycsgH1YgF9BACOSool27bmxXKuW2iRjQ+doS1lVmZislC/yLupxvthQr3 AL5NfevvNl5lqO/8mTCG83iTAM29SyNz1QOTrj4aApANNfNZrA2xYzfULmjcY5/HKNAc nvpYPkAn/STCvjWlsq6ysy5wMdVI8gBTa6xZoWxZbFhvxp5i9gKt18lD1kEAPSguM+lI PVEg== 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=/3EbpcyHlJ06fS7NQ8wWeJ84StSJuYP6CXQBHgqtHz4=; b=rF6uvkzUFYfnDU6Z/a1tvGHkU81qu9aXAKCOmV8k933jpaR/GWwi6z208F/A8cdWHQ aHJG+5qJCMR9tWdPBEnTfOKvkdNgb+ils1jX6YYN0rcXl9MRhCOHvlFRrSqbmuc/QgcV yvQfRSw8a2wuLokzRBP/UiV5kmOVQQPs9IrBh0Ad5FpVQSpIwmSu0KkFyU3l4MMpoQtt 9/FggZGbmE3dArBum87qjETxiwC9RCXNL56GbYM5daZ8OtwRDkVosCbtuxBpabrn1pZv mMNyB1y0enJOCSTk1AhrswYQnE2yemKrySPxXWSJvYQ4P04Xohme4aHKRo7HWDQC6G// K0yw== X-Gm-Message-State: APjAAAVduQos0itVt7HHEf9UBjctEhjcc2NoL0Sa9arz9u7S89WERBjI zwzfiazWuqybqbYksHwbGcuiA5ne X-Google-Smtp-Source: APXvYqztA2s4gZ9zba7QEOcAd6h5QI5fZDyQfKJrjllDwmSS7HbgjDknE0NIXHsci/xZaLhyGcyy8g== X-Received: by 2002:a19:f10e:: with SMTP id p14mr7803687lfh.3.1578866557633; Sun, 12 Jan 2020 14:02:37 -0800 (PST) Received: from e4300.lan ([62.141.210.6]) by smtp.gmail.com with ESMTPSA id u18sm4831325lje.69.2020.01.12.14.02.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Jan 2020 14:02:37 -0800 (PST) From: Janusz Dziedzic To: hostap@lists.infradead.org Subject: [PATCH 04/12] tests: remote: allow more hwsim tests Date: Sun, 12 Jan 2020 23:02:18 +0100 Message-Id: <20200112220226.5056-4-janusz.dziedzic@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200112220226.5056-1-janusz.dziedzic@gmail.com> References: <20200112220226.5056-1-janusz.dziedzic@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200112_140239_610554_DCF3AD81 X-CRM114-Status: GOOD ( 10.40 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.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:12b 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_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.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 tests cases that require more than two arguments. Before we block them. Signed-off-by: Janusz Dziedzic --- tests/remote/hwsim_wrapper.py | 6 ++++-- tests/remote/run-tests.py | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/remote/hwsim_wrapper.py b/tests/remote/hwsim_wrapper.py index 36df8d7a8..38f927f6e 100644 --- a/tests/remote/hwsim_wrapper.py +++ b/tests/remote/hwsim_wrapper.py @@ -67,13 +67,15 @@ def run_hwsim_test(devices, setup_params, refs, duts, monitors, hwsim_test): dut_host.dev['bssid'] = rutils.get_mac_addr(dut_host) apdev.append(dut_host.dev) - # run hwsim test/currently only 2 params tests if hwsim_test.__code__.co_argcount == 1: hwsim_test(dev) elif hwsim_test.__code__.co_argcount == 2: hwsim_test(dev, apdev) else: - raise Exception("more than 2 arguments required") + params = {} + params['long'] = 1 + params['logdir'] = local_log_dir + hwsim_test(dev, apdev, params) # hostapd/wpa_supplicant cleanup for wpas in dev: diff --git a/tests/remote/run-tests.py b/tests/remote/run-tests.py index b68610816..8c5d02b44 100755 --- a/tests/remote/run-tests.py +++ b/tests/remote/run-tests.py @@ -200,7 +200,7 @@ def main(): t = None for tt in hwsim_tests: name = tt.__name__.replace('test_', '', 1) - if name == test and tt.__code__.co_argcount <= 2: + if name == test: t = tt break if not t: From patchwork Sun Jan 12 22:02:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janusz Dziedzic X-Patchwork-Id: 1221877 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=2607:7c80:54:e::133; helo=bombadil.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; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20170209 header.b=RGjmYMfu; 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=lx0UlCsd; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (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 47wrMB6ZLlz9sPW for ; Mon, 13 Jan 2020 09:03:18 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.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=PZnwdHJvfV3LtWndsrnywWme3VwU4ebFFqqPNO+4C4Q=; b=RGjmYMfuPhUy8q9bGuIzGxvmAk Jg7dOMi3PzHKqCr5rqQgWza/OlKuYm28XgW44/odNSMLj9uH8Jbc9/JJsydSUyV0EHO7Nm/7GDy3i EyXu3Xn/Lt2dQHqBIAIpT6+Z94P1NNMNKyOpsafYBenRA4sQuiTxEPCt30IP+ema9eXM8rMCWCsLq 2kKr2iLG2hX4qSLvYVoe+QdNeA6RO3pHQVjdsHiXVADpOIK4bp/XJVYk0/+mQG8cAaG+Hhr02XLLg nwxdyz6M+GCDKlc23zQpSd4s0EE/L2u5ISnpQ5mIPWgkAlBS2gkCaTZKLIWroOd/5KV/tmfsdJNhn IPULcHpw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iqlKE-0002qU-D3; Sun, 12 Jan 2020 22:03:14 +0000 Received: from mail-lf1-x142.google.com ([2a00:1450:4864:20::142]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iqlJg-00027N-Dl for hostap@lists.infradead.org; Sun, 12 Jan 2020 22:02:41 +0000 Received: by mail-lf1-x142.google.com with SMTP id n12so5412095lfe.3 for ; Sun, 12 Jan 2020 14:02:40 -0800 (PST) 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=sZ19v3bfLMTzgcEUEGLrTqsCDSGN6iTVOjwEdqOAIR4=; b=lx0UlCsddYmt4ZehpRZlvDUAvqdAYIf91SlaqW6q456OH1CjMsV1jinTRj5zjx2KgQ utulAZibJGO1C+Z3FuJmcvQAl0AAqAJx1Qf4Ub5XiKvVZDzvNaGmD8E7klOIILn0riSJ bIPjTkypsP78gT4k4ZjRMIrmRXVAHDWJ5ok/xpdk2C8Qa7UHhQdKEctrrFSseDXWE1OW T4wXD/tDMNOhMTd9RhZdtda6TznIo0vHMSe+LzU1wasOzqsIQCbjV35D2N2WbOpcBL50 plxf5S5ZGNLOaiYfD4N0+bgX9AbaKAexAe+Oc0quTJnDrpZOBs8W3zWU82bIQIkMARL/ y5Cg== 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=sZ19v3bfLMTzgcEUEGLrTqsCDSGN6iTVOjwEdqOAIR4=; b=qgKHpLnK7bzyO5qL6/YILj2xR0JngVFUJFRopjR+vTMX/151CCDiZYXmQEl+JpIWN6 teChi92M8Xv2s4/1mbFwPJ7ZBm8C+NKJQk9cAV6kKQ/WWcQXX/EkvwnezLDaDreiGmDY kv9Y7G1poRrTE2ewznLobG/cj9IZpyBjgWb8XgN05z/gRaPrvRLvoMRPqSEElpAu5c4t fX1IipC/QZOR4MGyBOGZCXhyueIdD1kYeWmhw4d/tBGTx1wA/imhqEqa+EOElsb22uP0 jCzc3PbIW3b7ywl3B0oxi4A6Q0tdf+9yCg+0Bb8NQ/3j9F7FUGdcGpDJt8pK62xlKlLe 9now== X-Gm-Message-State: APjAAAXC3KxHjuJVqRtcrFhQyiL00GQ1XAEfa7bf3akVuWcllOrMiz/k cv9QQg2r1hiyVvWVjLpgLovFfZRi X-Google-Smtp-Source: APXvYqznyecY+ogfg9obIFV73dLUh40ARawXUfMSKovvwUv4U8/2q7cgT/+3l2LhAKFa9RQH0a81qQ== X-Received: by 2002:a19:4849:: with SMTP id v70mr7801410lfa.30.1578866558575; Sun, 12 Jan 2020 14:02:38 -0800 (PST) Received: from e4300.lan ([62.141.210.6]) by smtp.gmail.com with ESMTPSA id u18sm4831325lje.69.2020.01.12.14.02.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Jan 2020 14:02:38 -0800 (PST) From: Janusz Dziedzic To: hostap@lists.infradead.org Subject: [PATCH 05/12] tests: remote: handle different ifconfig output Date: Sun, 12 Jan 2020 23:02:19 +0100 Message-Id: <20200112220226.5056-5-janusz.dziedzic@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200112220226.5056-1-janusz.dziedzic@gmail.com> References: <20200112220226.5056-1-janusz.dziedzic@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200112_140240_461569_7BAE73C6 X-CRM114-Status: GOOD ( 10.15 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.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_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.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 We could have different ifconfig output here, so handle them also. Signed-off-by: Janusz Dziedzic --- tests/remote/rutils.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/remote/rutils.py b/tests/remote/rutils.py index 5e8a86021..2b093e7c4 100644 --- a/tests/remote/rutils.py +++ b/tests/remote/rutils.py @@ -239,8 +239,10 @@ def get_ipv6(client, ifname=None): for line in lines: res = line.find("Scope:Link") - if res != -1: - break + if res == -1: + res = line.find(""); + if res != -1: + break if res != -1: words = line.split() @@ -248,6 +250,8 @@ def get_ipv6(client, ifname=None): addr_mask = words[2] addr = addr_mask.split("/") return addr[0] + if words[0] == "inet6": + return words[1] return "unknown" @@ -281,7 +285,7 @@ def get_mac_addr(host, iface=None): for word in words: if found == 1: return word - if word == "HWaddr": + if word == "HWaddr" or word == "ether": found = 1 raise Exception("Could not find HWaddr") From patchwork Sun Jan 12 22:02:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janusz Dziedzic X-Patchwork-Id: 1221878 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=2607:7c80:54:e::133; helo=bombadil.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; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20170209 header.b=e004Pjo4; 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=DUsqtDAV; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (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 47wrMP5SPQz9sPW for ; Mon, 13 Jan 2020 09:03:29 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.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=+rMbbDyn05vhwMNyRWex1TkIqCDxBqUKscUAiA4nO6g=; b=e004Pjo4zYzrjL/JcqwdMSECI2 J+wEkzRm9L66sXKgVJHIqTbZoMSDp24iQvwDSllC1beolCypa08TsgFACl+ZTYaQXnMPM2Eujx4lj OElMSNFw469ct0OuHJlMmSdxl/mWfinVt6SaogfE2AVBr2VTcYAuy1SagPp5KuGmY3Yy1DGHmxhAW ruFBle9Aaqtdq7zOE/OYz/eefdZXSYvb8IQ9yI2bp5b+ijIpEEUcvLjE3+xsD6qB6DZFTtL7AsnP5 kb5lFbNqLS/tJ+A4/8hZ4u2HJNgZKEU0Z8SDEsasJfBVOJSczpPlAMgra7M3jjiq7tuTSGLZ+O2Fr vedxZINw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iqlKQ-00033O-3n; Sun, 12 Jan 2020 22:03:26 +0000 Received: from mail-lf1-x12e.google.com ([2a00:1450:4864:20::12e]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iqlJi-00027j-B6 for hostap@lists.infradead.org; Sun, 12 Jan 2020 22:02:43 +0000 Received: by mail-lf1-x12e.google.com with SMTP id b15so5423611lfc.4 for ; Sun, 12 Jan 2020 14:02:41 -0800 (PST) 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=L1Vx1pISyxMi37acX1X2FRU8U7EVutgjHBNWjwY9gjQ=; b=DUsqtDAVv5Xexff4wM3K3KIVNiuSV2SdErbeV9mqqr5rWOGY/0MEygvcYD5V4JO9Q9 H99GmtHRVKNkf6mabHas5148Pi4sLil/at12Hm4JjZJ7KajOYtynmxK69gpoMX22G8eE bMwDBA1BHCxYgrFyfTmjAiuethSRPJ+xM16pLgd7WtxBer7FhnjedWL2gA3XFgSs8GZ8 SABJ+ckQGFWKRIRRhT/QwBT7BA2FrCrMF/LlZNCKL9vnOFtCm88Jgi3v66JblCVw0Wh7 0FMLu8Zu9UTBk3g2/07Bnu9jhaFdM8JO1bhGGM0TqqYPR4jueUvJBEw/iYM2nmiNax4x hHdw== 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=L1Vx1pISyxMi37acX1X2FRU8U7EVutgjHBNWjwY9gjQ=; b=k/xAt093Ny/R3klGBCJxJEY/2aFwIBAieCgj1LB0yOkgU4x8MyAMfVbe5QLMYDV296 xlU/oMxTG/lECxkb091u0va05Z8pEvqNU6qlrHTd7GUwOAHcH8vUfRew0rb3p7wT96rm M5HeOHF5HbMZzsoYMsG+Amaq181L84pTm2snh9YuUyu/RPry5rvPMRQ33LUe/bC5ZS4z a1FF080GAEnjDxtghJry1DEHHszEmo1omrbP66h2r6rSMDDRLxRoPJB6bb9l7shYOVlk H4Fp2YOQjJbBFkpn/c3v62BMmEraefcV2nMKNMdevyPIMsd5MIZJWazIDUb/n0BmPQ5C mVCA== X-Gm-Message-State: APjAAAUh99whIByoRn6y3pJqlHghc9S8J89MJv6WRdwZpREhCZkPARsc huBrXnlpu1V7XwpaQyvLIKhrM2C2 X-Google-Smtp-Source: APXvYqx3Xia3hQe8z8e8MxWstNeQ0iTR1yuNPNfWCswJO/8E9grJtWWadxaUQCYJCZiGT3GQvuqU1Q== X-Received: by 2002:a19:ca0f:: with SMTP id a15mr6019610lfg.198.1578866559587; Sun, 12 Jan 2020 14:02:39 -0800 (PST) Received: from e4300.lan ([62.141.210.6]) by smtp.gmail.com with ESMTPSA id u18sm4831325lje.69.2020.01.12.14.02.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Jan 2020 14:02:39 -0800 (PST) From: Janusz Dziedzic To: hostap@lists.infradead.org Subject: [PATCH 06/12] ctrl: use IFNAME for global iface Date: Sun, 12 Jan 2020 23:02:20 +0100 Message-Id: <20200112220226.5056-6-janusz.dziedzic@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200112220226.5056-1-janusz.dziedzic@gmail.com> References: <20200112220226.5056-1-janusz.dziedzic@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200112_140242_387682_091BE9FF X-CRM114-Status: GOOD ( 10.98 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.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:12e 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_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.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 Seems for some reason for UDP case we send IFACE instead of IFNAME. This fix problem when at least one test case fail (hapd_ctrl_sta) when remote/udp used. This also fix test_connectivity. Signed-off-by: Janusz Dziedzic --- hostapd/ctrl_iface.c | 5 ----- wpa_supplicant/ctrl_iface_udp.c | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c index 9758881bb..0ef38e9f7 100644 --- a/hostapd/ctrl_iface.c +++ b/hostapd/ctrl_iface.c @@ -4616,13 +4616,8 @@ static void hostapd_ctrl_iface_send_internal(int sock, struct dl_list *ctrl_dst, return; idx = 0; if (ifname) { -#ifdef CONFIG_CTRL_IFACE_UDP - io[idx].iov_base = "IFACE="; - io[idx].iov_len = 6; -#else /* CONFIG_CTRL_IFACE_UDP */ io[idx].iov_base = "IFNAME="; io[idx].iov_len = 7; -#endif /* CONFIG_CTRL_IFACE_UDP */ idx++; io[idx].iov_base = (char *) ifname; io[idx].iov_len = os_strlen(ifname); diff --git a/wpa_supplicant/ctrl_iface_udp.c b/wpa_supplicant/ctrl_iface_udp.c index 8a6057a82..1e92b9752 100644 --- a/wpa_supplicant/ctrl_iface_udp.c +++ b/wpa_supplicant/ctrl_iface_udp.c @@ -516,7 +516,7 @@ static void wpa_supplicant_ctrl_iface_send(struct wpa_supplicant *wpa_s, return; if (ifname) - os_snprintf(levelstr, sizeof(levelstr), "IFACE=%s <%d>", + os_snprintf(levelstr, sizeof(levelstr), "IFNAME=%s <%d>", ifname, level); else os_snprintf(levelstr, sizeof(levelstr), "<%d>", level); From patchwork Sun Jan 12 22:02:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janusz Dziedzic X-Patchwork-Id: 1221879 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=2607:7c80:54:e::133; helo=bombadil.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; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20170209 header.b=SwJg00ub; 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=APxdOdQK; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (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 47wrMf31Wgz9s4Y for ; Mon, 13 Jan 2020 09:03:42 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.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=FkCdBicA9GH0qKJto36t2TH4WtTr06i6QdNv+u8BCdM=; b=SwJg00ubV6HxZczNWX9vJUIl1m mEvk20d499CEnG5PytiGmYRpBjwLf630rxZfOAGt1ee1IqKuBD5by65hVMnTcDGMMFgVegD3a/cxe pk3dwTeG+CcR2tcw158Z4x0Z2kyWKf2PTkop3MUPQ7hd/YjCkEP1uSG3GHVHZf0zyTOKWhswnjyN+ THTskjj1s5F1c/DVe+WqgbbmoaSqpEONwElkRVlG7AYCHi7PRKkliHn9i5Qk0QW6yr+pBGdH27x3L ZwlCVneUeTKfWQavj4zTDcXD/Yb09kAiwR7gA4KI4yEVM7sWb07sc6Ho2Ys+z1px5aj77jmPPV4/4 Sdgka21A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iqlKb-0003HR-MV; Sun, 12 Jan 2020 22:03:37 +0000 Received: from mail-lj1-x234.google.com ([2a00:1450:4864:20::234]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iqlJi-00028C-Pi for hostap@lists.infradead.org; Sun, 12 Jan 2020 22:02:44 +0000 Received: by mail-lj1-x234.google.com with SMTP id r19so7896685ljg.3 for ; Sun, 12 Jan 2020 14:02:42 -0800 (PST) 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=HoQaosuS57PUoVnCGVoVv5BcseslHmxWhXJyoBhavEQ=; b=APxdOdQKLZNAX4OeFK4wF064MyNeKGPrMLC7WbMPTHEW9qa6EAkC2i2jrCYIKOiDK5 +5jOxS6dfD77yP9TxPI+3f5W7hA7k8TN990ZXFoU639qguQqIspGLbppjwem0Q0BE8wr AUpL0tIMeHafgnGyPJCU6aUPe9MOsLgMv8oRORO/mAt7EGaA8vq3LTPeDTk3+gx7dXTv 3iMDyW9GQ8YZHKxKSUXA7k47GtM2GuUfAj1OnCXvwlheFrtFxLY6bO4hFOHPw7nHXvlW upDidlD/hasYorzDp80c+14zNjP3lUQaZUqApgctEbLFDQytkSZ+PbKslUy/Clni2jUg 0vpQ== 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=HoQaosuS57PUoVnCGVoVv5BcseslHmxWhXJyoBhavEQ=; b=QlYiIdGXUtUMWRWRhrTk35UsH2xvpENjnfWa3aGBPZ0MF2you47hmYXq+DPsklrcnA QW3sPQup6DjiSWdQaY80qRoTUmux8Vq8Q9hrz73ExoLidDxli0F9qtifvcgbYdb41YQ5 q6llDT8rEyk/I5UQ33NBIh3+mcLpdrHT3+q/7BVvjcV7NxrZDHmZLZJnefLy01nm2clL S/+IaXQd6NK1JTtM5EAC16vd/yjPNh8Rr6PCo/GXB/agLto1lBxQSxqqtD5qBUXQSvx6 nUR1NWSRxapdtjh2qdHhI+Tu8SGc4BziWbj62e8zItdLwmtkb5tdUGQRiUs+L44NVLw3 RgJg== X-Gm-Message-State: APjAAAV28vIFiJqRO7DCi7QWT8QmMzuIgAG5706gaMZlClrOageXsBkc JyS+3BA8MOqU8F4YtKNTBWIQuf43 X-Google-Smtp-Source: APXvYqxuZT9H4NPzSGNa2m86K8zaOs9dNWwXUanzWww+Ny8JVFFn6LFxn/UFpbeb55BrywtRJubH2w== X-Received: by 2002:a2e:8152:: with SMTP id t18mr8152080ljg.255.1578866560561; Sun, 12 Jan 2020 14:02:40 -0800 (PST) Received: from e4300.lan ([62.141.210.6]) by smtp.gmail.com with ESMTPSA id u18sm4831325lje.69.2020.01.12.14.02.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Jan 2020 14:02:40 -0800 (PST) From: Janusz Dziedzic To: hostap@lists.infradead.org Subject: [PATCH 07/12] tests: remotehost: add send_file Date: Sun, 12 Jan 2020 23:02:21 +0100 Message-Id: <20200112220226.5056-7-janusz.dziedzic@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200112220226.5056-1-janusz.dziedzic@gmail.com> References: <20200112220226.5056-1-janusz.dziedzic@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200112_140242_855211_74A0567D X-CRM114-Status: UNSURE ( 9.18 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.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:234 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_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.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 hostapd often using config files eg, ACLs BSS configs When execute remote tests (udp) first we have to send this config files to correct host. Signed-off-by: Janusz Dziedzic --- tests/hwsim/hostapd.py | 12 ++++++++++++ tests/hwsim/remotehost.py | 5 +++++ 2 files changed, 17 insertions(+) diff --git a/tests/hwsim/hostapd.py b/tests/hwsim/hostapd.py index e555f75ed..8f2ce02d4 100644 --- a/tests/hwsim/hostapd.py +++ b/tests/hwsim/hostapd.py @@ -135,6 +135,10 @@ class HostapdGlobal: self.ctrl.terminate() self.ctrl = None + def send_file(self, src, dst): + self.host.send_file(src, dst) + + class Hostapd: def __init__(self, ifname, bssidx=0, hostname=None, port=8877): self.hostname = hostname @@ -521,6 +525,10 @@ class Hostapd: def note(self, txt): self.request("NOTE " + txt) + def send_file(self, src, dst): + self.host.send_file(src, dst) + + def add_ap(apdev, params, wait_enabled=True, no_enable=False, timeout=30, global_ctrl_override=None, driver=False): if isinstance(apdev, dict): @@ -741,3 +749,7 @@ def ht40_minus_params(channel="1", ssid=None, country=None): def cmd_execute(apdev, cmd, shell=False): hapd_global = HostapdGlobal(apdev) return hapd_global.cmd_execute(cmd, shell=shell) + +def send_file(apdev, src, dst): + hapd_global = HostapdGlobal(apdev) + return hapd_global.send_file(src, dst) diff --git a/tests/hwsim/remotehost.py b/tests/hwsim/remotehost.py index 50f46c310..138419e47 100644 --- a/tests/hwsim/remotehost.py +++ b/tests/hwsim/remotehost.py @@ -106,3 +106,8 @@ class Host(): self.local_execute(["scp", self.user + "@[" + self.host + "]:" + log, local_log_dir]) self.execute(["rm", log]) del self.logs[:] + + def send_file(self, src, dst): + if self.host is None: + return + self.local_execute(["scp", src, self.user + "@[" + self.host + "]:" + dst]) From patchwork Sun Jan 12 22:02:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janusz Dziedzic X-Patchwork-Id: 1221881 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=2607:7c80:54:e::133; helo=bombadil.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; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20170209 header.b=tRUi2NIL; 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=lsBcghvN; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (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 47wrN22jwfz9s4Y for ; Mon, 13 Jan 2020 09:04:02 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.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=iO3pPrSW1Y56bWnWmyWmCVNNF6SpmM1ZiCrl2RGvcvs=; b=tRUi2NILjho3d6TyXf/USDti0y VBAu6YM7GRiq6FHN0DfA4moc/TdakT9tCs8K283T5jnn926Uhymqd9GrQXTACW4QSnzWfwDUl01lN R8dgSny3a6aT8GRemLQQmeyij/tivkL5BzvIzlbTehXvOR2Tmy4rrSksja7uSmFmdN84CmZA5Dl2j RFCvYeObTj0XWJmKuccb/hf9+HWoicpMqPIT9h/5nFiLQsVc2y8eLRnBrdTmTKNr36DfV9rCGhHF7 pOQLV9kU3xVBhV6V/RUhn4yL/QVy6yQeHg/xnoOzW4Fo9W7Jvgd9t/sob3DbhxtjFbVc2xXUUuuoE shZhXwcg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iqlKr-0003dM-NE; Sun, 12 Jan 2020 22:03:53 +0000 Received: from mail-lj1-x236.google.com ([2a00:1450:4864:20::236]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iqlJj-00028z-Pp for hostap@lists.infradead.org; Sun, 12 Jan 2020 22:02:46 +0000 Received: by mail-lj1-x236.google.com with SMTP id j1so7880516lja.2 for ; Sun, 12 Jan 2020 14:02:43 -0800 (PST) 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=mvegMdJEjkRcy1Z43zgsRODRBtrolW37ZP+gjRP79IU=; b=lsBcghvNYJ3B12YSHI8hFm4mTAH6ImEvD05CrPfyv8p3PGBA5FnI5Fk1Pyo+WW+3qg dVF7ltE0RpWj4GmeQBfjHo7mUL9DPObtb91GHTlqUywGZz5ahU1uFvJ26x/FFK58JWj/ K6uPWwxUn0j1+UYn+MGTQF0MQ0XSwovJaD6tzx1j7SCJSQYQKOQ6GDdmX84qGz8nQ5EX ONrEX5pgP2/4ns+RkVe8n6Brr0HTpFjO7LIW9bJtIsWFCL6y0gOneTwvi9lpuhiNZbv4 JJBQkPWOT71+xPcJB2yIy392m30MHtSqbhUE37OqD05sFHWJGyFfDe5587oiUjHFPMn7 mNFw== 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=mvegMdJEjkRcy1Z43zgsRODRBtrolW37ZP+gjRP79IU=; b=H3M0K/rGuJDgQJzQWP0AqE85JFNCAOqvQ8EjNI7P5F6HJI0UzJlhW+9oY3kOcK8LBf mEpXE3VmoKuXdM2LkQtw5YfQDfu0SdIEnsWYZ7Uuq5JJUp4OX5L86N7SO9JcCyiKKP7+ JBTNDWMm40btgMO8YteLxjeDeSRJiu+YQP/TuepJpGqB7my21V/7+A5s2+WXbkTEcNEb fMBChast5jobBrMn2j/eC1ei63O2pXPdInMsEJzKVBVcwoda0mZV5v2oP7AwC68+yG8g 5Z70ipwduc7mfN1ggB2uPn//vLC2mfgUBesdA2l6wPL2Nn2GR350OSF75NkOEfPIZotI hUOA== X-Gm-Message-State: APjAAAX3TBcjUaVGHK9eGE2+4fBKIBY6Ol0WsjdfEDal/JN4fJxnLKna DlvDN5DOPjtZ3Z30TmcVN1GOlNdy X-Google-Smtp-Source: APXvYqxoJaiQXSEY8jds16tr0UlhVioO3P7FDqDqSTjkdc9Gg6+gbTxx3htGgXfkHNKW86EmlBcsTA== X-Received: by 2002:a05:651c:118b:: with SMTP id w11mr8859558ljo.54.1578866561501; Sun, 12 Jan 2020 14:02:41 -0800 (PST) Received: from e4300.lan ([62.141.210.6]) by smtp.gmail.com with ESMTPSA id u18sm4831325lje.69.2020.01.12.14.02.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Jan 2020 14:02:40 -0800 (PST) From: Janusz Dziedzic To: hostap@lists.infradead.org Subject: [PATCH 08/12] tests: generate acl files Date: Sun, 12 Jan 2020 23:02:22 +0100 Message-Id: <20200112220226.5056-8-janusz.dziedzic@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200112220226.5056-1-janusz.dziedzic@gmail.com> References: <20200112220226.5056-1-janusz.dziedzic@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200112_140243_883812_A4420762 X-CRM114-Status: GOOD ( 13.45 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.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:236 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_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.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 Generate ACL files correctly instead of hardcoded values. Send them also to the remote client if required. Signed-off-by: Janusz Dziedzic --- tests/hwsim/hostapd.accept | 2 -- tests/hwsim/hostapd.accept2 | 3 --- tests/hwsim/hostapd.macaddr | 7 ------ tests/hwsim/hostapd_conf.py | 34 +++++++++++++++++++++++++ tests/hwsim/test_ap_ft.py | 47 +++++++++++++++++++++++++---------- tests/hwsim/test_ap_params.py | 13 +++++++--- tests/hwsim/test_ap_vlan.py | 33 ++++++++++++++++++------ tests/hwsim/test_hapd_ctrl.py | 13 +++++++--- 8 files changed, 113 insertions(+), 39 deletions(-) delete mode 100644 tests/hwsim/hostapd.accept delete mode 100644 tests/hwsim/hostapd.accept2 delete mode 100644 tests/hwsim/hostapd.macaddr create mode 100644 tests/hwsim/hostapd_conf.py diff --git a/tests/hwsim/hostapd.accept b/tests/hwsim/hostapd.accept deleted file mode 100644 index ce455b1a2..000000000 --- a/tests/hwsim/hostapd.accept +++ /dev/null @@ -1,2 +0,0 @@ -02:00:00:00:00:00 1 -02:00:00:00:01:00 2 diff --git a/tests/hwsim/hostapd.accept2 b/tests/hwsim/hostapd.accept2 deleted file mode 100644 index 3d41e348a..000000000 --- a/tests/hwsim/hostapd.accept2 +++ /dev/null @@ -1,3 +0,0 @@ -02:00:00:00:00:00 1 -02:00:00:00:01:00 2 -02:00:00:00:02:00 3 diff --git a/tests/hwsim/hostapd.macaddr b/tests/hwsim/hostapd.macaddr deleted file mode 100644 index a3b7878b5..000000000 --- a/tests/hwsim/hostapd.macaddr +++ /dev/null @@ -1,7 +0,0 @@ -02:00:00:00:00:00 -02:00:00:00:00:12 -02:00:00:00:00:34 --02:00:00:00:00:12 --02:00:00:00:00:34 -01:01:01:01:01:01 -03:01:01:01:01:03 diff --git a/tests/hwsim/hostapd_conf.py b/tests/hwsim/hostapd_conf.py new file mode 100644 index 000000000..2243d1f24 --- /dev/null +++ b/tests/hwsim/hostapd_conf.py @@ -0,0 +1,34 @@ +import hostapd +import os + +def acl_file(dev, apdev, conf): + filename = os.path.join("/tmp", conf) + + if conf == 'hostapd.macaddr': + with open(filename, 'w') as f: + mac0 = dev[0].get_status_field("address") + f.write(mac0 + '\n') + f.write("02:00:00:00:00:12\n") + f.write("02:00:00:00:00:34\n") + f.write("-02:00:00:00:00:12\n") + f.write("-02:00:00:00:00:34\n") + f.write("01:01:01:01:01:01\n") + f.write("03:01:01:01:01:03\n") + elif conf == 'hostapd.accept': + with open(filename, 'w') as f: + mac0 = dev[0].get_status_field("address") + mac1 = dev[1].get_status_field("address") + f.write(mac0 + " 1\n") + f.write(mac1 + " 2\n") + elif conf == 'hostapd.accept2': + with open(filename, 'w') as f: + mac0 = dev[0].get_status_field("address") + mac1 = dev[1].get_status_field("address") + mac2 = dev[2].get_status_field("address") + f.write(mac0 + " 1\n") + f.write(mac1 + " 2\n") + f.write(mac2 + " 3\n") + else: + return conf + + return filename diff --git a/tests/hwsim/test_ap_ft.py b/tests/hwsim/test_ap_ft.py index 51a070e8e..035be6c79 100644 --- a/tests/hwsim/test_ap_ft.py +++ b/tests/hwsim/test_ap_ft.py @@ -23,6 +23,7 @@ from wlantest import Wlantest from test_ap_psk import check_mib, find_wpas_process, read_process_memory, verify_not_present, get_key_locations from test_rrm import check_beacon_req from test_suite_b import check_suite_b_192_capa +import hostapd_conf def ft_base_rsn(): params = {"wpa": "2", @@ -336,15 +337,18 @@ def test_ap_ft_vlan(dev, apdev): """WPA2-PSK-FT AP with VLAN""" ssid = "test-ft" passphrase = "12345678" + filename = hostapd_conf.acl_file(dev, apdev, 'hostapd.accept') + hostapd.send_file(apdev[0], filename, filename) + hostapd.send_file(apdev[1], filename, filename) params = ft_params1(ssid=ssid, passphrase=passphrase) params['dynamic_vlan'] = "1" - params['accept_mac_file'] = "hostapd.accept" + params['accept_mac_file'] = filename hapd0 = hostapd.add_ap(apdev[0]['ifname'], params) params = ft_params2(ssid=ssid, passphrase=passphrase) params['dynamic_vlan'] = "1" - params['accept_mac_file'] = "hostapd.accept" + params['accept_mac_file'] = filename hapd1 = hostapd.add_ap(apdev[1]['ifname'], params) run_roams(dev[0], apdev, hapd0, hapd1, ssid, passphrase, conndev="brvlan1") @@ -355,16 +359,19 @@ def test_ap_ft_vlan_disconnected(dev, apdev): """WPA2-PSK-FT AP with VLAN and local key generation""" ssid = "test-ft" passphrase = "12345678" + filename = hostapd_conf.acl_file(dev, apdev, 'hostapd.accept') + hostapd.send_file(apdev[0], filename, filename) + hostapd.send_file(apdev[1], filename, filename) params = ft_params1a(ssid=ssid, passphrase=passphrase) params['dynamic_vlan'] = "1" - params['accept_mac_file'] = "hostapd.accept" + params['accept_mac_file'] = filename params['ft_psk_generate_local'] = "1" hapd0 = hostapd.add_ap(apdev[0]['ifname'], params) params = ft_params2a(ssid=ssid, passphrase=passphrase) params['dynamic_vlan'] = "1" - params['accept_mac_file'] = "hostapd.accept" + params['accept_mac_file'] = filename params['ft_psk_generate_local'] = "1" hapd1 = hostapd.add_ap(apdev[1]['ifname'], params) @@ -376,10 +383,12 @@ def test_ap_ft_vlan_2(dev, apdev): """WPA2-PSK-FT AP with VLAN and dest-AP does not have VLAN info locally""" ssid = "test-ft" passphrase = "12345678" + filename = hostapd_conf.acl_file(dev, apdev, 'hostapd.accept') + hostapd.send_file(apdev[0], filename, filename) params = ft_params1(ssid=ssid, passphrase=passphrase) params['dynamic_vlan'] = "1" - params['accept_mac_file'] = "hostapd.accept" + params['accept_mac_file'] = filename hapd0 = hostapd.add_ap(apdev[0]['ifname'], params) params = ft_params2(ssid=ssid, passphrase=passphrase) @@ -407,15 +416,18 @@ def test_ap_ft_many_vlan(dev, apdev): """WPA2-PSK-FT AP with VLAN multiple times""" ssid = "test-ft" passphrase = "12345678" + filename = hostapd_conf.acl_file(dev, apdev, 'hostapd.accept') + hostapd.send_file(apdev[0], filename, filename) + hostapd.send_file(apdev[1], filename, filename) params = ft_params1(ssid=ssid, passphrase=passphrase) params['dynamic_vlan'] = "1" - params['accept_mac_file'] = "hostapd.accept" + params['accept_mac_file'] = filename hapd0 = hostapd.add_ap(apdev[0]['ifname'], params) params = ft_params2(ssid=ssid, passphrase=passphrase) params['dynamic_vlan'] = "1" - params['accept_mac_file'] = "hostapd.accept" + params['accept_mac_file'] = filename hapd1 = hostapd.add_ap(apdev[1]['ifname'], params) run_roams(dev[0], apdev, hapd0, hapd1, ssid, passphrase, roams=50, @@ -707,14 +719,17 @@ def test_ap_ft_vlan_over_ds(dev, apdev): """WPA2-PSK-FT AP over DS with VLAN""" ssid = "test-ft" passphrase = "12345678" + filename = hostapd_conf.acl_file(dev, apdev, 'hostapd.accept') + hostapd.send_file(apdev[0], filename, filename) + hostapd.send_file(apdev[1], filename, filename) params = ft_params1(ssid=ssid, passphrase=passphrase) params['dynamic_vlan'] = "1" - params['accept_mac_file'] = "hostapd.accept" + params['accept_mac_file'] = filename hapd0 = hostapd.add_ap(apdev[0]['ifname'], params) params = ft_params2(ssid=ssid, passphrase=passphrase) params['dynamic_vlan'] = "1" - params['accept_mac_file'] = "hostapd.accept" + params['accept_mac_file'] = filename hapd1 = hostapd.add_ap(apdev[1]['ifname'], params) run_roams(dev[0], apdev, hapd0, hapd1, ssid, passphrase, over_ds=True, @@ -739,14 +754,17 @@ def test_ap_ft_vlan_over_ds_many(dev, apdev): """WPA2-PSK-FT AP over DS with VLAN multiple times""" ssid = "test-ft" passphrase = "12345678" + filename = hostapd_conf.acl_file(dev, apdev, 'hostapd.accept') + hostapd.send_file(apdev[0], filename, filename) + hostapd.send_file(apdev[1], filename, filename) params = ft_params1(ssid=ssid, passphrase=passphrase) params['dynamic_vlan'] = "1" - params['accept_mac_file'] = "hostapd.accept" + params['accept_mac_file'] = filename hapd0 = hostapd.add_ap(apdev[0]['ifname'], params) params = ft_params2(ssid=ssid, passphrase=passphrase) params['dynamic_vlan'] = "1" - params['accept_mac_file'] = "hostapd.accept" + params['accept_mac_file'] = filename hapd1 = hostapd.add_ap(apdev[1]['ifname'], params) run_roams(dev[0], apdev, hapd0, hapd1, ssid, passphrase, over_ds=True, @@ -944,16 +962,19 @@ def test_ap_ft_over_ds_pull_vlan(dev, apdev): """WPA2-PSK-FT AP over DS (pull PMK) with VLAN""" ssid = "test-ft" passphrase = "12345678" + filename = hostapd_conf.acl_file(dev, apdev, 'hostapd.accept') + hostapd.send_file(apdev[0], filename, filename) + hostapd.send_file(apdev[1], filename, filename) params = ft_params1(ssid=ssid, passphrase=passphrase) params["pmk_r1_push"] = "0" params['dynamic_vlan'] = "1" - params['accept_mac_file'] = "hostapd.accept" + params['accept_mac_file'] = filename hapd0 = hostapd.add_ap(apdev[0]['ifname'], params) params = ft_params2(ssid=ssid, passphrase=passphrase) params["pmk_r1_push"] = "0" params['dynamic_vlan'] = "1" - params['accept_mac_file'] = "hostapd.accept" + params['accept_mac_file'] = filename hapd1 = hostapd.add_ap(apdev[1]['ifname'], params) run_roams(dev[0], apdev, hapd0, hapd1, ssid, passphrase, over_ds=True, diff --git a/tests/hwsim/test_ap_params.py b/tests/hwsim/test_ap_params.py index 8e4ab8e3b..303c14464 100644 --- a/tests/hwsim/test_ap_params.py +++ b/tests/hwsim/test_ap_params.py @@ -16,6 +16,7 @@ import hwsim_utils import hostapd from tshark import run_tshark from utils import alloc_fail, HwsimSkip, parse_ie +import hostapd_conf @remote_compatible def test_ap_fragmentation_rts_set_high(dev, apdev): @@ -140,8 +141,10 @@ def test_ap_acl_accept(dev, apdev): """MAC ACL accept list""" ssid = "acl" params = {} + filename = hostapd_conf.acl_file(dev, apdev, 'hostapd.macaddr') + hostapd.send_file(apdev[0], filename, filename) params['ssid'] = ssid - params['accept_mac_file'] = "hostapd.macaddr" + params['accept_mac_file'] = filename hapd = hostapd.add_ap(apdev[0], params) dev[0].scan_for_bss(apdev[0]['bssid'], freq="2412") dev[0].connect(ssid, key_mgmt="NONE", scan_freq="2412") @@ -161,8 +164,10 @@ def test_ap_acl_deny(dev, apdev): """MAC ACL deny list""" ssid = "acl" params = {} + filename = hostapd_conf.acl_file(dev, apdev, 'hostapd.macaddr') + hostapd.send_file(apdev[0], filename, filename) params['ssid'] = ssid - params['deny_mac_file'] = "hostapd.macaddr" + params['deny_mac_file'] = filename hapd = hostapd.add_ap(apdev[0], params) dev[0].scan_for_bss(apdev[0]['bssid'], freq="2412", passive=True) dev[0].connect(ssid, key_mgmt="NONE", scan_freq="2412", wait_connect=False) @@ -176,8 +181,10 @@ def test_ap_acl_mgmt(dev, apdev): """MAC ACL accept/deny management""" ssid = "acl" params = {} + filename = hostapd_conf.acl_file(dev, apdev, 'hostapd.macaddr') + hostapd.send_file(apdev[0], filename, filename) params['ssid'] = ssid - params['deny_mac_file'] = "hostapd.macaddr" + params['deny_mac_file'] = filename hapd = hostapd.add_ap(apdev[0], params) accept = hapd.request("ACCEPT_ACL SHOW").splitlines() diff --git a/tests/hwsim/test_ap_vlan.py b/tests/hwsim/test_ap_vlan.py index 305889aa1..510ce7dcd 100644 --- a/tests/hwsim/test_ap_vlan.py +++ b/tests/hwsim/test_ap_vlan.py @@ -23,12 +23,15 @@ import hostapd from utils import iface_is_in_bridge, HwsimSkip, alloc_fail import os from tshark import run_tshark +import hostapd_conf def test_ap_vlan_open(dev, apdev): """AP VLAN with open network""" + filename = hostapd_conf.acl_file(dev, apdev, 'hostapd.accept') + hostapd.send_file(apdev[0], filename, filename) params = {"ssid": "test-vlan-open", "dynamic_vlan": "1", - "accept_mac_file": "hostapd.accept"} + "accept_mac_file": filename} hapd = hostapd.add_ap(apdev[0], params) dev[0].connect("test-vlan-open", key_mgmt="NONE", scan_freq="2412") @@ -40,10 +43,12 @@ def test_ap_vlan_open(dev, apdev): def test_ap_vlan_file_open(dev, apdev): """AP VLAN with open network and vlan_file mapping""" + filename = hostapd_conf.acl_file(dev, apdev, 'hostapd.accept') + hostapd.send_file(apdev[0], filename, filename) params = {"ssid": "test-vlan-open", "dynamic_vlan": "1", "vlan_file": "hostapd.vlan", - "accept_mac_file": "hostapd.accept"} + "accept_mac_file": filename} hapd = hostapd.add_ap(apdev[0], params) dev[0].connect("test-vlan-open", key_mgmt="NONE", scan_freq="2412") @@ -55,10 +60,12 @@ def test_ap_vlan_file_open(dev, apdev): def test_ap_vlan_file_open2(dev, apdev): """AP VLAN with open network and vlan_file mapping (2)""" + filename = hostapd_conf.acl_file(dev, apdev, 'hostapd.accept2') + hostapd.send_file(apdev[0], filename, filename) params = {"ssid": "test-vlan-open", "dynamic_vlan": "1", "vlan_file": "hostapd.vlan2", - "accept_mac_file": "hostapd.accept2"} + "accept_mac_file": filename} hapd = hostapd.add_ap(apdev[0], params) dev[0].connect("test-vlan-open", key_mgmt="NONE", scan_freq="2412") @@ -109,10 +116,12 @@ def test_ap_vlan_file_parsing(dev, apdev, params): def test_ap_vlan_wpa2(dev, apdev): """AP VLAN with WPA2-PSK""" + filename = hostapd_conf.acl_file(dev, apdev, 'hostapd.accept') + hostapd.send_file(apdev[0], filename, filename) params = hostapd.wpa2_params(ssid="test-vlan", passphrase="12345678") params['dynamic_vlan'] = "1" - params['accept_mac_file'] = "hostapd.accept" + params['accept_mac_file'] = filename hapd = hostapd.add_ap(apdev[0], params) dev[0].connect("test-vlan", psk="12345678", scan_freq="2412") @@ -166,11 +175,13 @@ def test_ap_vlan_wpa2_radius_2(dev, apdev): def test_ap_vlan_wpa2_radius_local(dev, apdev): """AP VLAN with WPA2-Enterprise and local file setting VLAN IDs""" + filename = hostapd_conf.acl_file(dev, apdev, 'hostapd.accept') + hostapd.send_file(apdev[0], filename, filename) params = hostapd.wpa2_eap_params(ssid="test-vlan") params['dynamic_vlan'] = "0" params['vlan_file'] = "hostapd.vlan" params['vlan_bridge'] = "test_br_vlan" - params['accept_mac_file'] = "hostapd.accept" + params['accept_mac_file'] = filename hapd = hostapd.add_ap(apdev[0], params) dev[0].connect("test-vlan", key_mgmt="WPA-EAP", eap="PAX", @@ -340,10 +351,12 @@ def test_ap_vlan_wpa2_radius_required(dev, apdev): def test_ap_vlan_tagged(dev, apdev): """AP VLAN with tagged interface""" + filename = hostapd_conf.acl_file(dev, apdev, 'hostapd.accept') + hostapd.send_file(apdev[0], filename, filename) params = {"ssid": "test-vlan-open", "dynamic_vlan": "1", "vlan_tagged_interface": "lo", - "accept_mac_file": "hostapd.accept"} + "accept_mac_file": filename} hapd = hostapd.add_ap(apdev[0], params) dev[0].connect("test-vlan-open", key_mgmt="NONE", scan_freq="2412") @@ -546,6 +559,8 @@ def test_ap_vlan_iface_cleanup_multibss_per_sta_vif(dev, apdev): def test_ap_vlan_without_station(dev, apdev, p): """AP VLAN with WPA2-PSK and no station""" try: + filename = hostapd_conf.acl_file(dev, apdev, 'hostapd.accept') + hostapd.send_file(apdev[0], filename, filename) subprocess.call(['brctl', 'addbr', 'brvlan1']) subprocess.call(['brctl', 'setfd', 'brvlan1', '0']) subprocess.call(['ifconfig', 'brvlan1', 'up']) @@ -555,7 +570,7 @@ def test_ap_vlan_without_station(dev, apdev, p): passphrase="12345678x") params['dynamic_vlan'] = "1" params['vlan_file'] = 'hostapd.wlan3.vlan' - params['accept_mac_file'] = "hostapd.accept" + params['accept_mac_file'] = filename hapd = hostapd.add_ap(apdev[0], params) # inject some traffic @@ -707,10 +722,12 @@ def test_ap_vlan_wpa2_radius_mixed(dev, apdev): def test_ap_vlan_reconnect(dev, apdev): """AP VLAN with WPA2-PSK connect, disconnect, connect""" + filename = hostapd_conf.acl_file(dev, apdev, 'hostapd.accept') + hostapd.send_file(apdev[0], filename, filename) params = hostapd.wpa2_params(ssid="test-vlan", passphrase="12345678") params['dynamic_vlan'] = "1" - params['accept_mac_file'] = "hostapd.accept" + params['accept_mac_file'] = filename hapd = hostapd.add_ap(apdev[0], params) logger.info("connect sta") diff --git a/tests/hwsim/test_hapd_ctrl.py b/tests/hwsim/test_hapd_ctrl.py index 5b802e478..f7ac231dc 100644 --- a/tests/hwsim/test_hapd_ctrl.py +++ b/tests/hwsim/test_hapd_ctrl.py @@ -10,6 +10,7 @@ from remotehost import remote_compatible import hostapd import hwsim_utils from utils import skip_with_fips, alloc_fail, fail_test, HwsimSkip +import hostapd_conf @remote_compatible def test_hapd_ctrl_status(dev, apdev): @@ -283,11 +284,13 @@ def test_hapd_ctrl_ess_disassoc(dev, apdev): def test_hapd_ctrl_set_deny_mac_file(dev, apdev): """hostapd and SET deny_mac_file ctrl_iface command""" ssid = "hapd-ctrl" + filename = hostapd_conf.acl_file(dev, apdev, 'hostapd.macaddr') params = {"ssid": ssid} hapd = hostapd.add_ap(apdev[0], params) dev[0].connect(ssid, key_mgmt="NONE", scan_freq="2412") dev[1].connect(ssid, key_mgmt="NONE", scan_freq="2412") - if "OK" not in hapd.request("SET deny_mac_file hostapd.macaddr"): + hapd.send_file(filename, filename) + if "OK" not in hapd.request("SET deny_mac_file " + filename): raise Exception("Unexpected SET failure") dev[0].wait_disconnected(timeout=15) ev = dev[1].wait_event(["CTRL-EVENT-DISCONNECTED"], 1) @@ -297,12 +300,14 @@ def test_hapd_ctrl_set_deny_mac_file(dev, apdev): def test_hapd_ctrl_set_accept_mac_file(dev, apdev): """hostapd and SET accept_mac_file ctrl_iface command""" ssid = "hapd-ctrl" + filename = hostapd_conf.acl_file(dev, apdev, 'hostapd.macaddr') params = {"ssid": ssid} hapd = hostapd.add_ap(apdev[0], params) dev[0].connect(ssid, key_mgmt="NONE", scan_freq="2412") dev[1].connect(ssid, key_mgmt="NONE", scan_freq="2412") + hapd.send_file(filename, filename) hapd.request("SET macaddr_acl 1") - if "OK" not in hapd.request("SET accept_mac_file hostapd.macaddr"): + if "OK" not in hapd.request("SET accept_mac_file " + filename): raise Exception("Unexpected SET failure") dev[1].wait_disconnected(timeout=15) ev = dev[0].wait_event(["CTRL-EVENT-DISCONNECTED"], 1) @@ -312,12 +317,14 @@ def test_hapd_ctrl_set_accept_mac_file(dev, apdev): def test_hapd_ctrl_set_accept_mac_file_vlan(dev, apdev): """hostapd and SET accept_mac_file ctrl_iface command (VLAN ID)""" ssid = "hapd-ctrl" + filename = hostapd_conf.acl_file(dev, apdev, 'hostapd.accept') params = {"ssid": ssid} hapd = hostapd.add_ap(apdev[0], params) dev[0].connect(ssid, key_mgmt="NONE", scan_freq="2412") dev[1].connect(ssid, key_mgmt="NONE", scan_freq="2412") + hapd.send_file(filename, filename) hapd.request("SET macaddr_acl 1") - if "OK" not in hapd.request("SET accept_mac_file hostapd.accept"): + if "OK" not in hapd.request("SET accept_mac_file " + filename): raise Exception("Unexpected SET failure") dev[1].wait_disconnected(timeout=15) dev[0].wait_disconnected(timeout=15) From patchwork Sun Jan 12 22:02:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janusz Dziedzic X-Patchwork-Id: 1221880 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=2607:7c80:54:e::133; helo=bombadil.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; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20170209 header.b=RwZd9h/T; 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=BT9eVfnU; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (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 47wrMp2PW1z9s4Y for ; Mon, 13 Jan 2020 09:03:50 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.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=3BkSOBj39sX1GgEyqSd7ky19jr5HdhUlgACgjiWfDgQ=; b=RwZd9h/TDXiExU9dwv0/C8gxih r0YvelgAn7q4RxTFNnkZ9WX41fo4bApHj4qdmQP8WVRHWXCzvI3hPyorn2Cdz30C3HY81M4PnVys0 B2bpSmRE8HpgV/SCivTq6s0n8+pjBOhf6FMIdAgKCSKmbZALzgFQUOpEGpd0JC++ZOmQaoyUPuccl xtY9cAwtIV64eawHbuWap6Mj/0ecW1M5dF9ItOlP8R1jN+QEWWPiuE1Zw1qfulirXFnRb/C7llEu/ pXNFLOv69JTVfFbkf+xzMCirUal4jAFtl62skv0UUDWooK1s5FnhZkvQB7FWTw/Nj44E2+duLhdpA EP6qgJSA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iqlKk-0003SD-QJ; Sun, 12 Jan 2020 22:03:46 +0000 Received: from mail-lf1-x142.google.com ([2a00:1450:4864:20::142]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iqlJk-00029k-B0 for hostap@lists.infradead.org; Sun, 12 Jan 2020 22:02:46 +0000 Received: by mail-lf1-x142.google.com with SMTP id 203so5392584lfa.12 for ; Sun, 12 Jan 2020 14:02:44 -0800 (PST) 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=w3hz8JOmjeZYylK6lBoCIULZ/EbX/oFobGJJeGNuW3k=; b=BT9eVfnUwhH6Fi115lERcZXI2MS48T4oIISJ4HmXupuvS/gG/kRY1ltCXJP4wsWiyI IjYrrexb35BlHwHTEblMahMd9GXPBVSDjsrOVZRhMdK6jiRc2BJ0M8NKZrLuiOQD7kl2 taBlFfNE8jRcvKNnYbkos0vxLin3oRTZwlX8s04ba247HT6AyzTMFFPvXw00gpysjHJG DpPg41u3h55LynpIQzt19/a4Jv7cqa1ASD2dMw6V5gLIOTW6l/te4JR/g0k0IPkNmqYw 1ppykgB8zHiPIJYaikDXUFJxgS41si8/CaR41pJxHITqYHhV1oH2FngP9ASkl2Sn76eD i2iw== 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=w3hz8JOmjeZYylK6lBoCIULZ/EbX/oFobGJJeGNuW3k=; b=PmlIcUmFFvZEEIrNSFxsOVRlRUSwVNuUERuaJDY4c7fuxVSE1Nqce/foAzL3ow1dwv LfFpEc+ZbA8wX8lOMpx+1HBe3sAOAR/p8IJWucyDo6W0++obmL/71zPXHEA6SNALcR24 l0NXMRAQJa4yNxGXAqLBiCI3FKHwj4v8RKF23QbhNgy0CQeEwynDSB0MGduBMRljaTR7 xu5Ov0+yBfGFofvqGYV1omdjyYKUeNNNuNa+Y/ExpTDVT52lbWMYMBm2HwsXWSEqGw2e aHY+ZeecM/gvLU2AmjxLkQ2y13rXmqiiq0D2cAqYRWuEQScLreLNDpq/nqa2W0GPffO1 2UIg== X-Gm-Message-State: APjAAAWB+zSlvSIpnNTyvn3M08OH8p7logx8wLAqGSZnmAPanSBoRbjy wFNJ2pmfBLi4e3Ui7XvCz7Y21JJx X-Google-Smtp-Source: APXvYqyEqoYjQzafsIx+ttrODfDo3y2p9QqKkCVv0YQcyt9KTIwGIuwcdEFA/aSxRlRpW5s5njCIXg== X-Received: by 2002:ac2:5a43:: with SMTP id r3mr7880199lfn.150.1578866562484; Sun, 12 Jan 2020 14:02:42 -0800 (PST) Received: from e4300.lan ([62.141.210.6]) by smtp.gmail.com with ESMTPSA id u18sm4831325lje.69.2020.01.12.14.02.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Jan 2020 14:02:41 -0800 (PST) From: Janusz Dziedzic To: hostap@lists.infradead.org Subject: [PATCH 09/12] hostapd: ctrl_iface: udp remove global cookies Date: Sun, 12 Jan 2020 23:02:23 +0100 Message-Id: <20200112220226.5056-9-janusz.dziedzic@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200112220226.5056-1-janusz.dziedzic@gmail.com> References: <20200112220226.5056-1-janusz.dziedzic@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200112_140244_447501_BC490B0F X-CRM114-Status: GOOD ( 13.29 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.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_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.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 Seems for CONFIG_CTRL_IFACE=udp we used global defined cookies. This break all multi bss test cases when UDP interface was used. So, after: hapd1 = hostapd.add_bss(apdev[0], ifname1, 'bss-1.conf') hapd2 = hostapd.add_bss(apdev[0], ifname2, 'bss-2.conf') hapd1->ping() don't work. This patch fix it. Signed-off-by: Janusz Dziedzic --- hostapd/ctrl_iface.c | 37 +++++++++++++++++-------------------- src/ap/hostapd.h | 13 +++++++++++++ 2 files changed, 30 insertions(+), 20 deletions(-) diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c index 0ef38e9f7..15cc152df 100644 --- a/hostapd/ctrl_iface.c +++ b/hostapd/ctrl_iface.c @@ -65,9 +65,6 @@ #define HOSTAPD_CLI_DUP_VALUE_MAX_LEN 256 #ifdef CONFIG_CTRL_IFACE_UDP -#define COOKIE_LEN 8 -static unsigned char cookie[COOKIE_LEN]; -static unsigned char gcookie[COOKIE_LEN]; #define HOSTAPD_CTRL_IFACE_PORT 8877 #define HOSTAPD_CTRL_IFACE_PORT_LIMIT 50 #define HOSTAPD_GLOBAL_CTRL_IFACE_PORT 8878 @@ -3456,7 +3453,7 @@ static void hostapd_ctrl_iface_receive(int sock, void *eloop_ctx, int reply_len; int level = MSG_DEBUG; #ifdef CONFIG_CTRL_IFACE_UDP - unsigned char lcookie[COOKIE_LEN]; + unsigned char lcookie[CTRL_IFACE_COOKIE_LEN]; #endif /* CONFIG_CTRL_IFACE_UDP */ res = recvfrom(sock, buf, sizeof(buf) - 1, 0, @@ -3481,28 +3478,28 @@ static void hostapd_ctrl_iface_receive(int sock, void *eloop_ctx, #ifdef CONFIG_CTRL_IFACE_UDP if (os_strcmp(buf, "GET_COOKIE") == 0) { os_memcpy(reply, "COOKIE=", 7); - wpa_snprintf_hex(reply + 7, 2 * COOKIE_LEN + 1, - cookie, COOKIE_LEN); - reply_len = 7 + 2 * COOKIE_LEN; + wpa_snprintf_hex(reply + 7, 2 * CTRL_IFACE_COOKIE_LEN + 1, + hapd->ctrl_iface_cookie, CTRL_IFACE_COOKIE_LEN); + reply_len = 7 + 2 * CTRL_IFACE_COOKIE_LEN; goto done; } if (os_strncmp(buf, "COOKIE=", 7) != 0 || - hexstr2bin(buf + 7, lcookie, COOKIE_LEN) < 0) { + hexstr2bin(buf + 7, lcookie, CTRL_IFACE_COOKIE_LEN) < 0) { wpa_printf(MSG_DEBUG, "CTRL: No cookie in the request - drop request"); os_free(reply); return; } - if (os_memcmp(cookie, lcookie, COOKIE_LEN) != 0) { + if (os_memcmp(hapd->ctrl_iface_cookie, lcookie, CTRL_IFACE_COOKIE_LEN) != 0) { wpa_printf(MSG_DEBUG, "CTRL: Invalid cookie in the request - drop request"); os_free(reply); return; } - pos = buf + 7 + 2 * COOKIE_LEN; + pos = buf + 7 + 2 * CTRL_IFACE_COOKIE_LEN; while (*pos == ' ') pos++; #endif /* CONFIG_CTRL_IFACE_UDP */ @@ -3591,7 +3588,7 @@ int hostapd_ctrl_iface_init(struct hostapd_data *hapd) dl_list_init(&hapd->ctrl_dst); hapd->ctrl_sock = -1; - os_get_random(cookie, COOKIE_LEN); + os_get_random(hapd->ctrl_iface_cookie, CTRL_IFACE_COOKIE_LEN); #ifdef CONFIG_CTRL_IFACE_UDP_REMOTE hints.ai_flags = AI_PASSIVE; @@ -4170,7 +4167,7 @@ static int hostapd_global_ctrl_iface_ifname(struct hapd_interfaces *interfaces, static void hostapd_global_ctrl_iface_receive(int sock, void *eloop_ctx, void *sock_ctx) { - void *interfaces = eloop_ctx; + struct hapd_interfaces *interfaces = eloop_ctx; char buffer[256], *buf = buffer; int res; struct sockaddr_storage from; @@ -4179,7 +4176,7 @@ static void hostapd_global_ctrl_iface_receive(int sock, void *eloop_ctx, int reply_len; const int reply_size = 4096; #ifdef CONFIG_CTRL_IFACE_UDP - unsigned char lcookie[COOKIE_LEN]; + unsigned char lcookie[CTRL_IFACE_COOKIE_LEN]; #endif /* CONFIG_CTRL_IFACE_UDP */ res = recvfrom(sock, buffer, sizeof(buffer) - 1, 0, @@ -4208,28 +4205,28 @@ static void hostapd_global_ctrl_iface_receive(int sock, void *eloop_ctx, #ifdef CONFIG_CTRL_IFACE_UDP if (os_strcmp(buf, "GET_COOKIE") == 0) { os_memcpy(reply, "COOKIE=", 7); - wpa_snprintf_hex(reply + 7, 2 * COOKIE_LEN + 1, - gcookie, COOKIE_LEN); - reply_len = 7 + 2 * COOKIE_LEN; + wpa_snprintf_hex(reply + 7, 2 * CTRL_IFACE_COOKIE_LEN + 1, + interfaces->ctrl_iface_cookie, CTRL_IFACE_COOKIE_LEN); + reply_len = 7 + 2 * CTRL_IFACE_COOKIE_LEN; goto send_reply; } if (os_strncmp(buf, "COOKIE=", 7) != 0 || - hexstr2bin(buf + 7, lcookie, COOKIE_LEN) < 0) { + hexstr2bin(buf + 7, lcookie, CTRL_IFACE_COOKIE_LEN) < 0) { wpa_printf(MSG_DEBUG, "CTRL: No cookie in the request - drop request"); os_free(reply); return; } - if (os_memcmp(gcookie, lcookie, COOKIE_LEN) != 0) { + if (os_memcmp(interfaces->ctrl_iface_cookie, lcookie, CTRL_IFACE_COOKIE_LEN) != 0) { wpa_printf(MSG_DEBUG, "CTRL: Invalid cookie in the request - drop request"); os_free(reply); return; } - buf += 7 + 2 * COOKIE_LEN; + buf += 7 + 2 * CTRL_IFACE_COOKIE_LEN; while (*buf == ' ') buf++; #endif /* CONFIG_CTRL_IFACE_UDP */ @@ -4373,7 +4370,7 @@ int hostapd_global_ctrl_iface_init(struct hapd_interfaces *interface) } } - os_get_random(gcookie, COOKIE_LEN); + os_get_random(interface->ctrl_iface_cookie, CTRL_IFACE_COOKIE_LEN); #ifdef CONFIG_CTRL_IFACE_UDP_REMOTE hints.ai_flags = AI_PASSIVE; diff --git a/src/ap/hostapd.h b/src/ap/hostapd.h index 2358d1664..91dc4c1af 100644 --- a/src/ap/hostapd.h +++ b/src/ap/hostapd.h @@ -38,6 +38,10 @@ union wps_event_data; struct mesh_conf; #endif /* CONFIG_MESH */ +#ifdef CONFIG_CTRL_IFACE_UDP +#define CTRL_IFACE_COOKIE_LEN 8 +#endif + struct hostapd_iface; struct hapd_interfaces { @@ -72,6 +76,11 @@ struct hapd_interfaces { #ifdef CONFIG_DPP struct dpp_global *dpp; #endif /* CONFIG_DPP */ + +#ifdef CONFIG_CTRL_IFACE_UDP + unsigned char ctrl_iface_cookie[CTRL_IFACE_COOKIE_LEN]; +#endif + }; enum hostapd_chan_status { @@ -395,6 +404,10 @@ struct hostapd_data { #ifdef CONFIG_SQLITE sqlite3 *rad_attr_db; #endif /* CONFIG_SQLITE */ + +#ifdef CONFIG_CTRL_IFACE_UDP + unsigned char ctrl_iface_cookie[CTRL_IFACE_COOKIE_LEN]; +#endif }; From patchwork Sun Jan 12 22:02:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janusz Dziedzic X-Patchwork-Id: 1221884 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=2607:7c80:54:e::133; helo=bombadil.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; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20170209 header.b=U0d0xwR/; 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=j4g/TMTi; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (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 47wrNS0KhGz9s4Y for ; Mon, 13 Jan 2020 09:04:24 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.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=lhyy5igLjuQT8wmkK71M39yoYSD1+Q8VirFAEqg2KDE=; b=U0d0xwR/JMRtGjX+vKKc0NZ6gf X8T44974HG6KxAlKzly6V0PB8lKxXFzk+YoNuX9/l+pEjNxdc+N2Epi1rUUcxiUxGta2XSny+bgVg Fc2jH1qyQvZR4GSi0LUrEd5Hgul+4fGee6DGgQ6EsLRYuMiPERHpR1F3bDEdQeL2/aGUeBTuu01ia kfhJ4cFRl9Hc1IN9tE/9sy4zDj3+8edrJH/BJw9xGaNC81YNv3cmVnk5UF9AHpQZcZqqyB/+5Lvbw TKEsbD9aGUNGzgaR4nseE9O2Ef2pa2VaX1XtO6vgkkq1M0W+g/+VReX8/Qjzc3S5jrmGJ1HOjhiwc XBFbUcSA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iqlLI-00049m-30; Sun, 12 Jan 2020 22:04:20 +0000 Received: from mail-lj1-x241.google.com ([2a00:1450:4864:20::241]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iqlJl-0002Ai-Ak for hostap@lists.infradead.org; Sun, 12 Jan 2020 22:02:48 +0000 Received: by mail-lj1-x241.google.com with SMTP id u1so7876312ljk.7 for ; Sun, 12 Jan 2020 14:02:44 -0800 (PST) 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=Epe+6CsW++kz+5e17z7XtapxDuRngPq4yJEEQoO0IyA=; b=j4g/TMTi94xrKykzlWVqcjKwq957OTqH/mvQptB/GdaklVOlxIIAWbRDrpTh+TAKdV ro8CvPbYC0ASYLJDYE+thoDg9z47+gMgShj2x+/Hs1NlIMhcfSjQZvLw7fyN3qBMtwbI RqgCHmbClITrZVVZlJEFz5bFYhBKZ2Np3UbLslurv9w24ZzCRnlPUtuRKsPseOG8YjFR DlXMoBoJ18qUdqWHQNIIf3saOtHm+3SWFX+yxcTuHZrbOEVU4onMs/kiahmymR27NvGE uzR057kjz8SLxH288I33F5nfuPDMACAy/2ocBqOtU5bSsPla4n9IAuIvmWdI/9nCW5Rs f4ug== 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=Epe+6CsW++kz+5e17z7XtapxDuRngPq4yJEEQoO0IyA=; b=CD0BIrHRnPmG3dlpkKjOEitayuwT/SAAOr7IpmpwZ5dmUUyIrFfN5KDr/ro7L2tH8e pD4sL7pXMmBdtYm8mDNHHlWXv2WTM5X3qH5H0ChIerwPHwwY2HrIJnBHJf7fYPPHOgzy QBtQG9BacA9YQ4JBcLaRRLe/822++OnZoOHgsrujxTsg8Kwktduw16od0KB5AOeM7cI5 l7ZY22gjn2FskxwQcwKZmclpsxu8yR1jg5ORtmq/Im2yhtsr2DStuR4OQQv8bmRDfTHi cG2HFn8mvttnkJMRVNIkZ0zraUTWMEO7hdiROdK7Q6kJvSktmNJy2P5fXnvmoa2NayqS u7Mg== X-Gm-Message-State: APjAAAWx0TxcMnz0dFfkmx12eyiC8QS7Md9bOL0WhqZXKsNdtDSwLnT4 RKNYmuaq7sQbAsMw0r68cszjm7Sm X-Google-Smtp-Source: APXvYqwKHCgZulyLnsFJFzY4cHj/p1Be1jU8nNvhXZX7WZBZKKcbHiv+9uEenTlrCAKz5xUYIkgQ6g== X-Received: by 2002:a2e:86c4:: with SMTP id n4mr8752517ljj.97.1578866563375; Sun, 12 Jan 2020 14:02:43 -0800 (PST) Received: from e4300.lan ([62.141.210.6]) by smtp.gmail.com with ESMTPSA id u18sm4831325lje.69.2020.01.12.14.02.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Jan 2020 14:02:42 -0800 (PST) From: Janusz Dziedzic To: hostap@lists.infradead.org Subject: [PATCH 10/12] tests: remote: gen/send cfg files Date: Sun, 12 Jan 2020 23:02:24 +0100 Message-Id: <20200112220226.5056-10-janusz.dziedzic@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200112220226.5056-1-janusz.dziedzic@gmail.com> References: <20200112220226.5056-1-janusz.dziedzic@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200112_140245_392454_7380FE8C X-CRM114-Status: UNSURE ( 9.98 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.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_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.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 hardcoded bss-*.cfg files generate them correctly, using correct bssid. Next send/install them on remote client. Signed-off-by: Janusz Dziedzic --- tests/hwsim/hostapd.py | 5 +++++ tests/hwsim/hostapd_conf.py | 38 +++++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/tests/hwsim/hostapd.py b/tests/hwsim/hostapd.py index 8f2ce02d4..f8db64326 100644 --- a/tests/hwsim/hostapd.py +++ b/tests/hwsim/hostapd.py @@ -13,6 +13,7 @@ import wpaspy import remotehost import utils import subprocess +import hostapd_conf logger = logging.getLogger() hapd_ctrl = '/var/run/hostapd' @@ -592,6 +593,8 @@ def add_bss(apdev, ifname, confname, ignore_error=False): hostname = None port = 8878 hapd_global = HostapdGlobal(apdev) + confname = hostapd_conf.cfg_file(apdev, confname, ifname) + hapd_global.send_file(confname, confname) hapd_global.add_bss(phy, confname, ignore_error) port = hapd_global.get_ctrl_iface_port(ifname) hapd = Hostapd(ifname, hostname=hostname, port=port) @@ -610,6 +613,8 @@ def add_iface(apdev, confname): hostname = None port = 8878 hapd_global = HostapdGlobal(apdev) + confname = hostapd_conf.cfg_file(apdev, confname, ifname) + hapd_global.send_file(confname, confname) hapd_global.add_iface(ifname, confname) port = hapd_global.get_ctrl_iface_port(ifname) hapd = Hostapd(ifname, hostname=hostname, port=port) diff --git a/tests/hwsim/hostapd_conf.py b/tests/hwsim/hostapd_conf.py index 2243d1f24..a6bffb1d3 100644 --- a/tests/hwsim/hostapd_conf.py +++ b/tests/hwsim/hostapd_conf.py @@ -1,5 +1,6 @@ import hostapd import os +import re def acl_file(dev, apdev, conf): filename = os.path.join("/tmp", conf) @@ -32,3 +33,40 @@ def acl_file(dev, apdev, conf): return conf return filename + +def bssid_inc(apdev, inc=1): + parts = apdev['bssid'].split(':') + parts[5] = '%02x' % (int(parts[5], 16) + int(inc)) + bssid = '%s:%s:%s:%s:%s:%s' % (parts[0], parts[1], parts[2], parts[3], parts[4], parts[5]) + return bssid + +def cfg_file(apdev, conf, ifname=None): + # put cfg file in /tmp directory + fname = os.path.join("/tmp", conf) + + match = re.search(r'bss-\d+', conf) + if match: + with open(fname, 'w') as f: + idx = ''.join(filter(str.isdigit, conf)) + if ifname is None: + ifname = apdev['ifname'] + if idx != '1': + ifname = ifname + '-' + idx + + f.write("driver=nl80211\n") + f.write("ctrl_interface=/var/run/hostapd\n") + f.write("hw_mode=g\n") + f.write("channel=1\n") + f.write("ieee80211n=1\n") + f.write("interface=%s\n" % ifname) + + f.write("ssid=bss-%s\n" % idx) + if conf == 'bss-2-dup.conf': + bssid = apdev['bssid'] + else: + bssid = bssid_inc(apdev, int(idx) - 1) + f.write("bssid=%s\n" % bssid) + else: + return conf + + return fname From patchwork Sun Jan 12 22:02:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janusz Dziedzic X-Patchwork-Id: 1221882 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=2607:7c80:54:e::133; helo=bombadil.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; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20170209 header.b=Vw7Lj6ir; 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=HjD2Zyvk; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (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 47wrN30Rltz9sPW for ; Mon, 13 Jan 2020 09:04:03 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.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=hoSIgin/87apfUqqzkQnKGtkBtjgEIiRiDI613yXjXQ=; b=Vw7Lj6irzDNe55EHEwfBx+z3BB BWWqFfVHP2ngnlAjJWTMsqKhdV4FdTRs4XNc89oQqpghqLAbSBYASdeje36pFKUQdFYnIeoQoGmZR Gi5C4kMaqMgcohko/yyPlAfPfwg7o0yVI8NhlKGj8nTYbQ0QbKhZWAH9vlHsXBjdwl/xFUopmgdre +SnM57MeiVEWOFVplzblnWIDCJ0OfkTSKCCY6ZtBb3OQhqDnLVwOd08a1LDfsNoXiN2ZCzmz6V9bv OSknz3IDewYR3gbYViDk5TixG7MbHsa193V+310PWGkD+kF6fuYcoKOddmAE0nA0pHuFjn1NlZUaB 6IcDE2Nw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iqlKx-0003mS-Jt; Sun, 12 Jan 2020 22:03:59 +0000 Received: from mail-lj1-x229.google.com ([2a00:1450:4864:20::229]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iqlJm-0002Bd-KU for hostap@lists.infradead.org; Sun, 12 Jan 2020 22:02:49 +0000 Received: by mail-lj1-x229.google.com with SMTP id j1so7880590lja.2 for ; Sun, 12 Jan 2020 14:02:46 -0800 (PST) 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=q/w4/E58KQWyM7Ee+fEAFkUQvv+Ig3ntNX3qBaH2Ah0=; b=HjD2ZyvkvPAC4TcJ2PsVGhE2Jdsu7YC98YZUuoRpJiJsk7E2WB9pcZK9FGwNMr8z00 pMSom4A9pQBU4M+7nqxNw+5S2ei313b8Awqjo/AOCOItZAeNewLW+Hv443UV7RGlDUTx zGjRXRVp9LWDNY0NDvjQK35YkTSg+RguXL1sATUaYusn11jlVSLQnIpM3UF50wxM+FVf 0+cy8V8pKiB+E9qKniiy+JQ7GdsJUymYRVMa23YjLoqlLOFTfKgY8sIQslvUMalu8VrY JPYbneaWyh9j3yh2qb24Js77fqsD18Y+/jE1QTSVFQa6ExDG6rOIOPqahxFQWfRARPY/ vt5g== 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=q/w4/E58KQWyM7Ee+fEAFkUQvv+Ig3ntNX3qBaH2Ah0=; b=nGbGi4x8Clx1Km2iI44BGw3DMx5O5Fd80WS0HJ0+Qt5qbrJYFlCnAgHmjjl/91pcwL PDSIh9NOH+xCjoIubl1ZWr86pBmsmJ8palg6tMEP0EcUtY6wP34L6JlUYXv9PzguVjM8 lr7MDTF++xYUghHM3/qWKp47zX29El47F0EW4WS+q052+HFQILR24pIEcKft/9Z5LGIF nU4Lbo9fPZUSLLWS7tnEMCEsHE3p9lHfaME8Iqc/VkZJkYfUnjqZh79HC4WGmhQQEih+ YSh70JhP5mDp2VoFX9BQsLMjNMeZtqwX4B41ekB27g6y12SY2ibWG8miAozWZyVCzX99 e4bg== X-Gm-Message-State: APjAAAUJjetjkgHicWBxcd4p2tD8MWwVyF++kr9uCNjQm14wgfwYr1WJ XZObXCOsqRH+Kjp0YfWq3tDdOIYj X-Google-Smtp-Source: APXvYqwBch/AIvH8vAbZaXugdoWFiD6rOzxuNXM9+BZe7IZNBbMs5YmoXnvCjaYQk+pc+Ll9TSMu6Q== X-Received: by 2002:a2e:844e:: with SMTP id u14mr8907785ljh.183.1578866564404; Sun, 12 Jan 2020 14:02:44 -0800 (PST) Received: from e4300.lan ([62.141.210.6]) by smtp.gmail.com with ESMTPSA id u18sm4831325lje.69.2020.01.12.14.02.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Jan 2020 14:02:43 -0800 (PST) From: Janusz Dziedzic To: hostap@lists.infradead.org Subject: [PATCH 11/12] tests: fix multi_check() Date: Sun, 12 Jan 2020 23:02:25 +0100 Message-Id: <20200112220226.5056-11-janusz.dziedzic@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200112220226.5056-1-janusz.dziedzic@gmail.com> References: <20200112220226.5056-1-janusz.dziedzic@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200112_140246_708089_A8BAC21C X-CRM114-Status: GOOD ( 10.20 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.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:229 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_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.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 Don't use hardcoded bssid. Instead use real bssid. Signed-off-by: Janusz Dziedzic --- tests/hwsim/test_ap_dynamic.py | 63 +++++++++++++++++----------------- 1 file changed, 32 insertions(+), 31 deletions(-) diff --git a/tests/hwsim/test_ap_dynamic.py b/tests/hwsim/test_ap_dynamic.py index 7a2ddcc7d..c99f05683 100644 --- a/tests/hwsim/test_ap_dynamic.py +++ b/tests/hwsim/test_ap_dynamic.py @@ -15,6 +15,7 @@ import hwsim_utils import hostapd from utils import alloc_fail, require_under_vm, get_phy from test_ap_acs import force_prev_ap_on_24g +import hostapd_conf @remote_compatible def test_ap_change_ssid(dev, apdev): @@ -37,7 +38,7 @@ def test_ap_change_ssid(dev, apdev): dev[0].set_network_quoted(id, "ssid", "test-wpa2-psk-new") dev[0].connect_network(id) -def multi_check(dev, check, scan_opt=True): +def multi_check(apdev, dev, check, scan_opt=True): id = [] num_bss = len(check) for i in range(0, num_bss): @@ -51,7 +52,7 @@ def multi_check(dev, check, scan_opt=True): for i in range(num_bss): if not check[i]: continue - bssid = '02:00:00:00:03:0' + str(i) + bssid = hostapd_conf.bssid_inc(apdev, i) if scan_opt: dev[i].scan_for_bss(bssid, freq=2412) id.append(dev[i].connect("bss-" + str(i + 1), key_mgmt="NONE", @@ -98,59 +99,59 @@ def _test_ap_bss_add_remove(dev, apdev): ifname3 = apdev[0]['ifname'] + '-3' logger.info("Set up three BSSes one by one") hostapd.add_bss(apdev[0], ifname1, 'bss-1.conf') - multi_check(dev, [True, False, False]) + multi_check(apdev[0], dev, [True, False, False]) hostapd.add_bss(apdev[0], ifname2, 'bss-2.conf') - multi_check(dev, [True, True, False]) + multi_check(apdev[0], dev, [True, True, False]) hostapd.add_bss(apdev[0], ifname3, 'bss-3.conf') - multi_check(dev, [True, True, True]) + multi_check(apdev[0], dev, [True, True, True]) logger.info("Remove the last BSS and re-add it") hostapd.remove_bss(apdev[0], ifname3) - multi_check(dev, [True, True, False]) + multi_check(apdev[0], dev, [True, True, False]) hostapd.add_bss(apdev[0], ifname3, 'bss-3.conf') - multi_check(dev, [True, True, True]) + multi_check(apdev[0], dev, [True, True, True]) logger.info("Remove the middle BSS and re-add it") hostapd.remove_bss(apdev[0], ifname2) - multi_check(dev, [True, False, True]) + multi_check(apdev[0], dev, [True, False, True]) hostapd.add_bss(apdev[0], ifname2, 'bss-2.conf') - multi_check(dev, [True, True, True]) + multi_check(apdev[0], dev, [True, True, True]) logger.info("Remove the first BSS and re-add it and other BSSs") hostapd.remove_bss(apdev[0], ifname1) - multi_check(dev, [False, False, False]) + multi_check(apdev[0], dev, [False, False, False]) hostapd.add_bss(apdev[0], ifname1, 'bss-1.conf') hostapd.add_bss(apdev[0], ifname2, 'bss-2.conf') hostapd.add_bss(apdev[0], ifname3, 'bss-3.conf') - multi_check(dev, [True, True, True]) + multi_check(apdev[0], dev, [True, True, True]) logger.info("Remove two BSSes and re-add them") hostapd.remove_bss(apdev[0], ifname2) - multi_check(dev, [True, False, True]) + multi_check(apdev[0], dev, [True, False, True]) hostapd.remove_bss(apdev[0], ifname3) - multi_check(dev, [True, False, False]) + multi_check(apdev[0], dev, [True, False, False]) hostapd.add_bss(apdev[0], ifname2, 'bss-2.conf') - multi_check(dev, [True, True, False]) + multi_check(apdev[0], dev, [True, True, False]) hostapd.add_bss(apdev[0], ifname3, 'bss-3.conf') - multi_check(dev, [True, True, True]) + multi_check(apdev[0], dev, [True, True, True]) logger.info("Remove three BSSes in and re-add them") hostapd.remove_bss(apdev[0], ifname3) - multi_check(dev, [True, True, False]) + multi_check(apdev[0], dev, [True, True, False]) hostapd.remove_bss(apdev[0], ifname2) - multi_check(dev, [True, False, False]) + multi_check(apdev[0], dev, [True, False, False]) hostapd.remove_bss(apdev[0], ifname1) - multi_check(dev, [False, False, False]) + multi_check(apdev[0], dev, [False, False, False]) hostapd.add_bss(apdev[0], ifname1, 'bss-1.conf') - multi_check(dev, [True, False, False]) + multi_check(apdev[0], dev, [True, False, False]) hostapd.add_bss(apdev[0], ifname2, 'bss-2.conf') - multi_check(dev, [True, True, False]) + multi_check(apdev[0], dev, [True, True, False]) hostapd.add_bss(apdev[0], ifname3, 'bss-3.conf') - multi_check(dev, [True, True, True]) + multi_check(apdev[0], dev, [True, True, True]) logger.info("Test error handling if a duplicate ifname is tried") hostapd.add_bss(apdev[0], ifname3, 'bss-3.conf', ignore_error=True) - multi_check(dev, [True, True, True]) + multi_check(apdev[0], dev, [True, True, True]) def test_ap_bss_add_remove_during_ht_scan(dev, apdev): """Dynamic BSS add during HT40 co-ex scan""" @@ -160,20 +161,20 @@ def test_ap_bss_add_remove_during_ht_scan(dev, apdev): ifname2 = apdev[0]['ifname'] + '-2' hostapd.add_bss(apdev[0], ifname1, 'bss-ht40-1.conf') hostapd.add_bss(apdev[0], ifname2, 'bss-ht40-2.conf') - multi_check(dev, [True, True], scan_opt=False) + multi_check(apdev[0], dev, [True, True], scan_opt=False) hostapd.remove_bss(apdev[0], ifname2) hostapd.remove_bss(apdev[0], ifname1) hostapd.add_bss(apdev[0], ifname1, 'bss-ht40-1.conf') hostapd.add_bss(apdev[0], ifname2, 'bss-ht40-2.conf') hostapd.remove_bss(apdev[0], ifname2) - multi_check(dev, [True, False], scan_opt=False) + multi_check(apdev[0], dev, [True, False], scan_opt=False) hostapd.remove_bss(apdev[0], ifname1) hostapd.add_bss(apdev[0], ifname1, 'bss-ht40-1.conf') hostapd.add_bss(apdev[0], ifname2, 'bss-ht40-2.conf') hostapd.remove_bss(apdev[0], ifname1) - multi_check(dev, [False, False]) + multi_check(apdev[0], dev, [False, False]) def test_ap_multi_bss_config(dev, apdev): """hostapd start with a multi-BSS configuration file""" @@ -185,18 +186,18 @@ def test_ap_multi_bss_config(dev, apdev): logger.info("Set up three BSSes with one configuration file") hapd = hostapd.add_iface(apdev[0], 'multi-bss.conf') hapd.enable() - multi_check(dev, [True, True, True]) + multi_check(apdev[0], dev, [True, True, True]) hostapd.remove_bss(apdev[0], ifname2) - multi_check(dev, [True, False, True]) + multi_check(apdev[0], dev, [True, False, True]) hostapd.remove_bss(apdev[0], ifname3) - multi_check(dev, [True, False, False]) + multi_check(apdev[0], dev, [True, False, False]) hostapd.remove_bss(apdev[0], ifname1) - multi_check(dev, [False, False, False]) + multi_check(apdev[0], dev, [False, False, False]) hapd = hostapd.add_iface(apdev[0], 'multi-bss.conf') hapd.enable() hostapd.remove_bss(apdev[0], ifname1) - multi_check(dev, [False, False, False]) + multi_check(apdev[0], dev, [False, False, False]) def invalid_ap(ap): logger.info("Trying to start AP " + ap['ifname'] + " with invalid configuration") @@ -507,7 +508,7 @@ def test_ap_bss_config_file(dev, apdev, params): res = subprocess.check_call(cmd) if res != 0: raise Exception("Could not start hostapd: %s" % str(res)) - multi_check(dev, [True, True, True]) + multi_check(apdev[0], dev, [True, True, True]) for i in range(0, 3): dev[i].request("DISCONNECT") From patchwork Sun Jan 12 22:02:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janusz Dziedzic X-Patchwork-Id: 1221883 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=2607:7c80:54:e::133; helo=bombadil.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; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20170209 header.b=j6HoJWrF; 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=j9WrJjdM; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (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 47wrNL3j2Kz9sPW for ; Mon, 13 Jan 2020 09:04:18 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.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=3aYFIi36Jad5VUPlM5wpmUOv2shNOoMCkk6FesoZI8s=; b=j6HoJWrFxpGvmHnzitgga5Y5K3 w7ZVsZewlGXrM8Aen5uxTGPzdkGxzqn79jA2sLiuNq1dAoEJJfebzAvYPSG01WtJ/lxFOq/3pOcFC 4klChkqHyFEptTxGh/iWJIEsk+8//9HbxjUhDJeb+y2gXXq4h4Wd32e1mvOQjuKMZhY/FRlG2M8Gj pf4JozpZa3eEdQx6Lv7cpz3FyxXh/cTash92TQsmxmjxEYfizySoIQG7WzPsmpJEPuvPnHPfyD/9z uOjxDTG/gDOCDsbbg9VNJt22QKhxgDAcj7pxxo5L2+M12CwKFatvtLTOKv+5zobkNtC/J7aHDAAC9 x57buPOg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iqlL9-0003zY-Bs; Sun, 12 Jan 2020 22:04:11 +0000 Received: from mail-lf1-x129.google.com ([2a00:1450:4864:20::129]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iqlJn-0002CU-G2 for hostap@lists.infradead.org; Sun, 12 Jan 2020 22:02:48 +0000 Received: by mail-lf1-x129.google.com with SMTP id v201so5401025lfa.11 for ; Sun, 12 Jan 2020 14:02:47 -0800 (PST) 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=xuJikUMzdYMKRBxPeXOnzWF6N+R+12ewdb/Tj+2NJqY=; b=j9WrJjdMDprxuLfPlZKnKARpuQhcW1xDjNtY7IkkSuNUrFQZZ7WteOP3FyXLLo83Hd DhC0lGLUbxlatZlzuHmZUXikShbIS+AUst2uaFK96aWpcpf+faUfG3Hij04zLGI+LcRM Df/ybYCOjafYNUB9U5r3VgcwoIvB6jXr9WKbgM9EhF7u/CcoEyCbIBYxDQkx3GsmWq3F qzK2DDIi8jO45V6e1ey2uQQdnEz4U+DN8f1xk9eqi+z57i9wy6EGIYHL1E8vd3JSDp3M XAcPcuj2a/WpUhSwRPmwUGx62SLLQQNWFadyspkKXeoUkJThb7pqBnbZb9nYYXlxoHwL cAtQ== 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=xuJikUMzdYMKRBxPeXOnzWF6N+R+12ewdb/Tj+2NJqY=; b=gqmREMRiZhE/Q04KwUdilRPQwZyR7enTNfaeg//fZPGinBcTb4FaEohKJ7a2VKzd48 JxYmIbLLs36aw9CVsGX+9vOVIs9vjberMom+hmuZ+Y1xXfdguu9W6K08Kke7mofO7vCt YtPA/WkFL/i7LJQ6yjfEZpDljhILmNUr50oi9sefQ3dot3hBuriEC9h1w4m8lwn4DfEI fkQ7gWYV9vOK9Ct/+uatmEkEY1OSl7WSamGC8eahCFTZtlKfPAlm4eBTx08Cs5O4DmNs I9FoEeRZVD5Oy9hSu33+WTT+A/dc1SP0+eEZMdnD7w0kNHIRvBmwZRNei5Ujb/oBsKP6 E/OA== X-Gm-Message-State: APjAAAWPVBSE6LO3JUZ5KXGxUO86x2mBd4ViLwCFEF0CGo5cGF9hhNCU 8OoI/cBPI3gCjZRQcn8OedJg9HdM X-Google-Smtp-Source: APXvYqxJiFJD4MgzdLtxdj6zD+6F3abCVjEC0QzXDna8GN/uo4yg43MkYOcf40JCP4YNouRsdGlR3w== X-Received: by 2002:a19:4b87:: with SMTP id y129mr8055036lfa.32.1578866565426; Sun, 12 Jan 2020 14:02:45 -0800 (PST) Received: from e4300.lan ([62.141.210.6]) by smtp.gmail.com with ESMTPSA id u18sm4831325lje.69.2020.01.12.14.02.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Jan 2020 14:02:44 -0800 (PST) From: Janusz Dziedzic To: hostap@lists.infradead.org Subject: [PATCH 12/12] tests: fix filter in wpas_ctrl_bssid_filter Date: Sun, 12 Jan 2020 23:02:26 +0100 Message-Id: <20200112220226.5056-12-janusz.dziedzic@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200112220226.5056-1-janusz.dziedzic@gmail.com> References: <20200112220226.5056-1-janusz.dziedzic@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200112_140247_562391_625B6326 X-CRM114-Status: GOOD ( 10.72 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.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:129 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_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.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 When run this TC in remote test env we could have more scan results after disable bssid_filter. Signed-off-by: Janusz Dziedzic --- tests/hwsim/test_wpas_ctrl.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/hwsim/test_wpas_ctrl.py b/tests/hwsim/test_wpas_ctrl.py index bac373f2f..1a10ba85c 100644 --- a/tests/hwsim/test_wpas_ctrl.py +++ b/tests/hwsim/test_wpas_ctrl.py @@ -802,6 +802,7 @@ def test_wpas_ctrl_level(dev): finally: dev[2].mon.request("LEVEL 3") +@remote_compatible def test_wpas_ctrl_bssid_filter(dev, apdev): """wpa_supplicant bssid_filter""" try: @@ -818,7 +819,7 @@ def test_wpas_ctrl_bssid_filter(dev, apdev): bss = dev[2].get_bss(apdev[1]['bssid']) if bss and len(bss) != 0: raise Exception("Unexpected BSS data") - dev[2].request("SET bssid_filter ") + dev[2].request("SET bssid_filter " + apdev[0]['bssid'] + " " + apdev[1]['bssid']) dev[2].scan(freq="2412") bss = dev[2].get_bss(apdev[0]['bssid']) if bss is None or len(bss) == 0: