From patchwork Wed Jan 9 20:04:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Matyukevich X-Patchwork-Id: 1022613 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) 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.b="Do9g7gR/"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="GbI9t0C0"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43Zg8465Mpz9sMp for ; Thu, 10 Jan 2019 07:04:36 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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=zQ42pdROnnOueqnPT4glLJuK+JnVoOnSe8erXlYbpv0=; b=Do9g7gR/LZXNZ7 qXXYAOZrbmPd0ie/HP0xR3bMxIxhzfMj9Isr804MQIzRd2qhkunyjMJeN1KO0SG/T7vFtFtQylSbM dURUBtSD6xKUqwc+c003eWgQwEwcrJzgSLHqr4DjiaUJErE9P8CMIqi5pFdia0p+N9S0JGC59fzxE t2Ya38ThGnSE0xXcdWdRZkjci1pz56USWsqvFg6cMtMorxZHyAUh5bfa4fltE9EEDEV2vvWaRoGGa NSoJWoJpNsNxLUnOO+rNjYXI2fepa/I32bnhoZMtj6bV22HghAFF2f4fynmSJDKeBLwQ7L32a1ikW /Eu2bCExGLxKHpRNDFSw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1ghK5Q-0005Ti-6u; Wed, 09 Jan 2019 20:04:24 +0000 Received: from mail-lf1-x134.google.com ([2a00:1450:4864:20::134]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1ghK5N-0005TJ-I4 for hostap@lists.infradead.org; Wed, 09 Jan 2019 20:04:23 +0000 Received: by mail-lf1-x134.google.com with SMTP id z13so6576474lfe.11 for ; Wed, 09 Jan 2019 12:04:20 -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:mime-version :content-transfer-encoding; bh=Mcsi8e+Cznw525GxV4idbI/QPGj5rKgQJ5lFRBx7Oec=; b=GbI9t0C0gO2b5tTZC8IHSpiYV6TUIWbulAEPTkoFg7drMwFoajGpC+Ew6uZml9xUMK uIZKVrbm/5QvgRcqV2EO5qqwNPmclc20xPdC7+aX9B1VfiAT89+0rMyN8TUXvDsauxz6 K9jZ8n4kkXN7mUvcv8NtHRqNkfJSu5m4B86ghHvZQoRDJ21owPJfypSiSrKnx2PI/npn wK+36OGTOxjifSoAudKdahSYVmbVEVJWaOrP6S7kn2ZZfdCPYvCk0W3uexk2DwMGzMKK /XzjVIoqMYNJmMNGAIEJk/Ptylday7pTwGpzrOpArveMwcxu4MVhsFWu/jsKYfkZBUBk udRw== 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:mime-version :content-transfer-encoding; bh=Mcsi8e+Cznw525GxV4idbI/QPGj5rKgQJ5lFRBx7Oec=; b=OUS5pLp3V1EsYoNs2sfu8UgkjF4+LrEz+jvGxZMkgwMzCvjXDXP3BHRH6iU+yYZ9EB 1E6Mp9OvaQFhWb0rvQm7hSqKh3VEsEOqYAaoUlj1XugqQlNx4gRL5vavPTu/zGG0iNRh QMyRtSGJVRXp9wna/vfr3MOYNgRNLEPdZWmhdIHf07B4aRZxobC0i/UYxol3sRpktnj9 PXeYD8BcoAjasP1vOyJibF4EIqS7tJSb5eq0kotx2RZDgTctO4EJU9/BNGVv6Ar74vy3 mTPb0zH/GjK2Ph7CGcaxgXjevT9GfmYi2IrsGv0x3TosxcMjWI6mIlfU9HUIkq8POFb6 WU2Q== X-Gm-Message-State: AJcUuke/Z/b3/aCSCJ7k2YHkUJWAriW5EiYD4GOswAnvV4N/oJ4JFlyz 3L9MKna8MWSIs24M7I8lvxJ+sfQY X-Google-Smtp-Source: ALg8bN6+cuJ0PFx6g6Mu5wTgOTghtCLpX6FJVZEYCJ1Ma5orM/Q/obDB3MOicks92QYtcqED0/4tiA== X-Received: by 2002:a19:54d7:: with SMTP id b84mr4058602lfl.131.1547064258737; Wed, 09 Jan 2019 12:04:18 -0800 (PST) Received: from localhost.localdomain ([178.71.112.187]) by smtp.googlemail.com with ESMTPSA id r26-v6sm15188284lji.25.2019.01.09.12.04.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Jan 2019 12:04:18 -0800 (PST) From: Sergey Matyukevich To: hostap@lists.infradead.org Subject: [RFC] tests: verify RX/TX STBC overrides Date: Wed, 9 Jan 2019 23:04:26 +0300 Message-Id: <20190109200426.4100-1-geomatsi@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190109_120421_621628_1A6F126A X-CRM114-Status: GOOD ( 10.56 ) 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 http://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:134 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 (geomatsi[at]gmail.com) -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jouni Malinen , Sergey Matyukevich Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Sergey Matyukevich Commit cdeea70f59d0 added wpa_s configuration options allowing HT STBC modifications for RX/TX spatial streams. Add tests to verify overriding of default HT STBC configuration for Tx and Rx spatial streams for hwsim driver. The test flow is straightforward: use wpa_s 'tx_stbc' and 'rx_stbc' configuration options to override default HT Rx/Tx STBC settings and check HT capabilities IEs in ASSOC frames. The following tests have been added: - ap_ht_stbc_disabled make sure that HT Rx/Tx STBC is disabled by default for hwsim driver - ap_ht_stbc_tx make sure that Tx STBC can be properly enabled for hwsim driver using wpa_s 'tx_stbc' configuration option - ap_ht_stbc_rx make sure that Tx STBC can be properly enabled for hwsim driver using wpa_s 'tx_stbc' configuration option Signed-off-by: Sergey Matyukevich --- This patch depends on the following hwsim driver change: https://patchwork.kernel.org/patch/10752835/ tests/hwsim/test_ap_ht.py | 68 +++++++++++++++++++++++++++++++++++---- 1 file changed, 62 insertions(+), 6 deletions(-) diff --git a/tests/hwsim/test_ap_ht.py b/tests/hwsim/test_ap_ht.py index e6f6502f4..bd452d5ba 100644 --- a/tests/hwsim/test_ap_ht.py +++ b/tests/hwsim/test_ap_ht.py @@ -9,11 +9,13 @@ import time import logging logger = logging.getLogger() import struct +import os import hostapd from utils import HwsimSkip, alloc_fail, parse_ie import hwsim_utils from test_ap_csa import csa_supported +from tshark import run_tshark def clear_scan_cache(apdev): ifname = apdev['ifname'] @@ -851,16 +853,70 @@ def test_ap_require_ht(dev, apdev): ampdu_density="1", disable_ht40="1", disable_sgi="1", disable_ldpc="1", rx_stbc="2", tx_stbc="1") -def test_ap_ht_stbc(dev, apdev): - """HT STBC overrides""" +def test_ap_ht_stbc_disabled(dev, apdev, p): + """HT STBC overrides: RX/TX STBC is disabled by default""" params = { "ssid": "ht" } hapd = hostapd.add_ap(apdev[0], params) dev[0].connect("ht", key_mgmt="NONE", scan_freq="2412") - dev[1].connect("ht", key_mgmt="NONE", scan_freq="2412", - rx_stbc="0", tx_stbc="0") - dev[2].connect("ht", key_mgmt="NONE", scan_freq="2412", - rx_stbc="1", tx_stbc="1") + dev[1].connect("ht", key_mgmt="NONE", scan_freq="2412", tx_stbc="-1", rx_stbc="-1") + dev[2].connect("ht", key_mgmt="NONE", scan_freq="2412", tx_stbc="0", rx_stbc="0") + + capfile = os.path.join(p['logdir'], "hwsim0.pcapng") + filt = "wlan.sa==%s && wlan.fc.type_subtype == 0x0" + + for sta in [0, 1, 2]: + res = run_tshark(capfile, filt % dev[sta].own_addr(), [ "wlan.ht.capabilities.txstbc" ]) + res = res.splitlines() + res = [int(x) for x in res] + for tx_stbc in res: + if tx_stbc != 0: + raise Exception("STA[%d]: TX STBC should be disabled, actual value: %d" % (sta, tx_stbc)) + + res = run_tshark(capfile, filt % dev[sta].own_addr(), [ "wlan.ht.capabilities.rxstbc" ]) + res = res.splitlines() + res = [int(x, 16) for x in res] + for rx_stbc in res: + if rx_stbc != 0: + raise Exception("STA[%d]: RX STBC should be disabled, actual value: %d" % (sta, rx_stbc)) + +def test_ap_ht_stbc_tx(dev, apdev, p): + """HT STBC overrides: verify TX STBC configuration""" + params = { "ssid": "ht" } + hapd = hostapd.add_ap(apdev[0], params) + + dev[0].connect("ht", key_mgmt="NONE", scan_freq="2412", tx_stbc="1") + + capfile = os.path.join(p['logdir'], "hwsim0.pcapng") + filt = "wlan.sa==%s && wlan.fc.type_subtype == 0x0" + + res = run_tshark(capfile, filt % dev[0].own_addr(), [ "wlan.ht.capabilities.txstbc" ]) + res = res.splitlines() + res = [int(x) for x in res] + for tx_stbc in res: + if tx_stbc != 1: + raise Exception("TX STBC should be enabled, actual value: %d" % tx_stbc) + +def test_ap_ht_stbc_rx(dev, apdev, p): + """HT STBC overrides: verify RX STBC configuration""" + params = { "ssid": "ht" } + hapd = hostapd.add_ap(apdev[0], params) + + dev[0].connect("ht", key_mgmt="NONE", scan_freq="2412", rx_stbc="1") + dev[1].connect("ht", key_mgmt="NONE", scan_freq="2412", rx_stbc="2") + dev[2].connect("ht", key_mgmt="NONE", scan_freq="2412", rx_stbc="3") + + capfile = os.path.join(p['logdir'], "hwsim0.pcapng") + filt = "wlan.sa==%s && wlan.fc.type_subtype == 0x0" + + for sta in [0, 1, 2]: + res = run_tshark(capfile, filt % dev[sta].own_addr(), [ "wlan.ht.capabilities.rxstbc" ]) + res = res.splitlines() + res = [int(x, 16) for x in res] + expected = sta + 1 + for actual in res: + if actual != expected: + raise Exception("STA[%d]: RX STBC expected %d, actual %d" % (sta, expected, actual)) @remote_compatible def test_ap_require_ht_limited_rates(dev, apdev):