From patchwork Mon Aug 1 11:08:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFwaGHDq2wgTcOpbG90dGU=?= X-Patchwork-Id: 1662508 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=Fn/6+0Hq; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=mind.be header.i=@mind.be header.a=rsa-sha256 header.s=google header.b=Xv+/y7+6; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LxFmc3TbJz9sGP for ; Mon, 1 Aug 2022 21:11:12 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=qHGtYhE92ifTOhWo46OQshb3MJTCVw3yLwDMgaMcZx4=; b=Fn/6+0HqxT1uUh ZWTLEpiqYn7bAD7aJyNhTLgF7VIh2ByXjYmaJYEqZNAB9ASryY0EKKkSDF0epZPoKYMiMNd/IUxLN HkmVctfGW+ClKfbHIWl5ELWVfN+iEAaZVnSpuGcL6urIese8cjOCCocZdW8sJV3PYl2B5q/ONXgeV 6DHanCs+DwEm3XVzRKdgw1ik0KFGz8UFkretS8NWI+D4PeFlVrm8IxBA5BeI/OjUq0viTfeVt9DIG YYuSeCj9cTrmim0Hd0yQHAb+I+EWOgV0p7Mvy9PYJUOtVd6OXpL4AVYsOrAWhP3187w0MJrRiLWcd 5YtZ8LEqV32qb7tofX5g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oITJO-005NcC-0A; Mon, 01 Aug 2022 11:10:14 +0000 Received: from mail-ej1-x62e.google.com ([2a00:1450:4864:20::62e]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oITI9-005N3X-U2 for hostap@lists.infradead.org; Mon, 01 Aug 2022 11:08:59 +0000 Received: by mail-ej1-x62e.google.com with SMTP id rq15so13642836ejc.10 for ; Mon, 01 Aug 2022 04:08:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mind.be; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=tGcjD4ipAKywra8a4GN54QPaxSpEoVjML7k8DVWZO8I=; b=Xv+/y7+6KMThHKBjRc0HWcipKdQ0yGfFCalB4XYgLYLnBRpMu13LhQz7zw1lNA7g0p m2X8MYXT+0LD/CLkTZyQt2OkjwElaL0HJ55ctXgBOezhLa2b7Kz/Gb7rj7jroGmeZP37 IlttyJ39FBu5KT3VEbhu6j49+09+hVGdnxg06N7/83nY7cRS1hFTUjvtmJOpF3dQKqvE WJdFhBTltsbSoRrrFLMNe3bPqtcfmN1s7M+1AZMoxkZerG3Pm+3g7T4wUqmBLYs51CIC PJ7BfcH53jWoNrJSglnKRviO6wOUaxuML3EVAViHAaD0sq/f7XwMGJkqI4FM4Uilw39u g3IQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=tGcjD4ipAKywra8a4GN54QPaxSpEoVjML7k8DVWZO8I=; b=62ufIa9ceExaDoDMmYR1/PTDjvh4p25qWw+VYeqp3UQoTa84rVy2I8UN4TR6Oq4pwf 3LR4zAmeGhnmACmahmr3H53kVidsux9COqVb9RboqWAUdjakstv+u22TRH9KQunhYJ0e dergOvVZoUr4UYtjts2ywc9sIgQxxs/l4bD1ZhJfnZNbIBCzFFbsxi1ZzV+HIBaXt+m2 sTs58L+GRxAz2iDARO8wMtG/GfvMHTvx7t3ZfnVwiIjESeNDgRXt4+QE+AGIKUG6A5VK Gp9JCF21wknNAMVOXnj1Kpq7g4w6kiFCMhI1pwXuxUAwLuqJv42wo+hCWpscYU9VLrCy gJtQ== X-Gm-Message-State: AJIora8HHzUgEW82H6O10RVvOpBvWDJZ/opnLlSAJlNQeX88sTcII3dA 9lQIGV1kEcUf2az5OCVrAGM/oZi1LYNn2Q== X-Google-Smtp-Source: AGRyM1sL4WuNkXPVShCeje2PCN/qJrg8IjEePig1YqpwSiFi0RKPNMzJJVnVXFQDgTkdxzOU7CtuDw== X-Received: by 2002:a17:907:9620:b0:72b:5822:93d0 with SMTP id gb32-20020a170907962000b0072b582293d0mr12395673ejc.235.1659352135548; Mon, 01 Aug 2022 04:08:55 -0700 (PDT) Received: from debian-hp-1.fritz.box ([212.233.42.58]) by smtp.gmail.com with ESMTPSA id y8-20020aa7c248000000b0043c7efb8badsm6632260edo.61.2022.08.01.04.08.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Aug 2022 04:08:55 -0700 (PDT) From: =?utf-8?b?UmFwaGHDq2wgTcOpbG90dGU=?= To: hostap@lists.infradead.org Cc: john@phrozen.org, raphael.melotte@mind.be Subject: [PATCH 4/7] tests: hwsim: write_hostapd_config: Add iface_params and bss_params Date: Mon, 1 Aug 2022 13:08:24 +0200 Message-Id: <20220801110827.237391-5-raphael.melotte@mind.be> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220801110827.237391-1-raphael.melotte@mind.be> References: <20220801110827.237391-1-raphael.melotte@mind.be> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220801_040858_029713_CE6CCCB2 X-CRM114-Status: GOOD ( 11.77 ) X-Spam-Score: 0.1 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: To make it easier to write custom hostapd configuration files, add "iface_params" and "bss_params". They are both meant to be lists of parameters that the user can supply to append additional parameters to the configuration file. Content analysis details: (0.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:62e listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org To make it easier to write custom hostapd configuration files, add "iface_params" and "bss_params". They are both meant to be lists of parameters that the user can supply to append additional parameters to the configuration file. Signed-off-by: Raphaël Mélotte --- tests/hwsim/test_ap_config.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/hwsim/test_ap_config.py b/tests/hwsim/test_ap_config.py index b1d9d2133..a1e068203 100644 --- a/tests/hwsim/test_ap_config.py +++ b/tests/hwsim/test_ap_config.py @@ -136,7 +136,8 @@ def test_ap_config_reload_file_while_disabled(dev, apdev, params): hapd.enable() dev[0].connect("foobar", key_mgmt="NONE", scan_freq="2412") -def write_hostapd_config(conffile, ifname, ssid, ht=True, bss2=False): +def write_hostapd_config(conffile, ifname, ssid, ht=True, bss2=False, + iface_params=None, bss_params=None): with open(conffile, "w") as f: f.write("driver=nl80211\n") f.write("hw_mode=g\n") @@ -145,9 +146,15 @@ def write_hostapd_config(conffile, ifname, ssid, ht=True, bss2=False): f.write("ieee80211n=1\n") f.write("interface=" + ifname + "\n") f.write("ssid=" + ssid + "\n") + if iface_params: + for l in iface_params: + f.write(l + "\n") if bss2: f.write("bss=" + ifname + "_2\n") f.write("ssid=" + ssid + "-2\n") + if bss_params: + for l in bss_params: + f.write(l + "\n") def test_ap_config_reload_on_sighup(dev, apdev, params): """hostapd configuration reload modification from file on SIGHUP"""