From patchwork Wed Jan 1 13:32:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peer, Ilan" X-Patchwork-Id: 305965 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from maxx.maxx.shmoo.com (maxx.shmoo.com [205.134.188.171]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id AD9CA2C00C3 for ; Thu, 2 Jan 2014 00:32:37 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id BCF3017C02D; Wed, 1 Jan 2014 08:32:24 -0500 (EST) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mTMK0E8UK6ab; Wed, 1 Jan 2014 08:32:24 -0500 (EST) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id D4BF917C02E; Wed, 1 Jan 2014 08:31:23 -0500 (EST) X-Original-To: mailman-post+hostap@maxx.shmoo.com Delivered-To: mailman-post+hostap@maxx.shmoo.com Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id F04E49D468 for ; Wed, 1 Jan 2014 08:31:21 -0500 (EST) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4ijQknBgD+JE for ; Wed, 1 Jan 2014 08:31:17 -0500 (EST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id DD2809D47D for ; Wed, 1 Jan 2014 08:31:09 -0500 (EST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 01 Jan 2014 05:31:09 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.95,585,1384329600"; d="scan'208";a="458655574" Received: from ipeer-e6430-1.jer.intel.com ([10.12.217.171]) by fmsmga002.fm.intel.com with ESMTP; 01 Jan 2014 05:31:08 -0800 From: Ilan Peer To: hostap@lists.shmoo.com Subject: [PATCH 5/5] hwsim: Skip CSA tests if the driver doesn't support it Date: Wed, 1 Jan 2014 15:32:13 +0200 Message-Id: <1388583133-14842-6-git-send-email-ilan.peer@intel.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1388583133-14842-1-git-send-email-ilan.peer@intel.com> References: <1388583133-14842-1-git-send-email-ilan.peer@intel.com> X-BeenThere: hostap@lists.shmoo.com X-Mailman-Version: 2.1.11 Precedence: list List-Id: HostAP Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: hostap-bounces@lists.shmoo.com Errors-To: hostap-bounces@lists.shmoo.com From: Andrei Otcheretianski Check wether wpa_supplicant or hostapd on the ap interface support channel switch announcement and skip the tests otherwise. Signed-hostap: Andrei Otcheretianski --- tests/hwsim/test_ap_csa.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tests/hwsim/test_ap_csa.py b/tests/hwsim/test_ap_csa.py index 9b2feb0..61ef86e 100644 --- a/tests/hwsim/test_ap_csa.py +++ b/tests/hwsim/test_ap_csa.py @@ -30,9 +30,21 @@ def switch_channel(ap, count, freq): raise Exception("Unexpected channel in CSA finished event") time.sleep(0.1) +# This function checks wether the provided dev, which may be either +# WpaSupplicant or Hostapd supports CSA +def csa_supported(dev): + # For WpaSupplicant we check driver's capability with get_driver_status + if hasattr(dev, 'get_driver_status'): + res = dev.get_driver_status() + return (int(res['capa.flags'], 0) & 0x40000000) != 0 + # Otherwise it's Hostapd and CSA support is published with STATUS command + return int(dev.get_status_field('csa_supported') or 0) + def test_ap_csa_1_switch(dev, apdev): """AP Channel Switch, one switch""" ap = connect(dev[0], apdev) + if not csa_supported(ap): + return "skip" hwsim_utils.test_connectivity(dev[0].ifname, apdev[0]['ifname']) switch_channel(ap, 10, 2462) @@ -41,6 +53,8 @@ def test_ap_csa_1_switch(dev, apdev): def test_ap_csa_2_switches(dev, apdev): """AP Channel Switch, two switches""" ap = connect(dev[0], apdev) + if not csa_supported(ap): + return "skip" hwsim_utils.test_connectivity(dev[0].ifname, apdev[0]['ifname']) switch_channel(ap, 10, 2462) @@ -51,6 +65,8 @@ def test_ap_csa_2_switches(dev, apdev): def test_ap_csa_1_switch_count_0(dev, apdev): """AP Channel Switch, one switch with count 0""" ap = connect(dev[0], apdev) + if not csa_supported(ap): + return "skip" hwsim_utils.test_connectivity(dev[0].ifname, apdev[0]['ifname']) switch_channel(ap, 0, 2462) @@ -59,6 +75,8 @@ def test_ap_csa_1_switch_count_0(dev, apdev): def test_ap_csa_2_switches_count_0(dev, apdev): """AP Channel Switch, two switches with count 0""" ap = connect(dev[0], apdev) + if not csa_supported(ap): + return "skip" hwsim_utils.test_connectivity(dev[0].ifname, apdev[0]['ifname']) switch_channel(ap, 0, 2462) @@ -69,6 +87,8 @@ def test_ap_csa_2_switches_count_0(dev, apdev): def test_ap_csa_1_switch_count_1(dev, apdev): """AP Channel Switch, one switch with count 1""" ap = connect(dev[0], apdev) + if not csa_supported(ap): + return "skip" hwsim_utils.test_connectivity(dev[0].ifname, apdev[0]['ifname']) switch_channel(ap, 1, 2462) @@ -77,6 +97,8 @@ def test_ap_csa_1_switch_count_1(dev, apdev): def test_ap_csa_2_switches_count_1(dev, apdev): """AP Channel Switch, two switches with count 1""" ap = connect(dev[0], apdev) + if not csa_supported(ap): + return "skip" hwsim_utils.test_connectivity(dev[0].ifname, apdev[0]['ifname']) switch_channel(ap, 1, 2462)