diff mbox

[v2,5/8] tests: setup wlantest once for qosmap tests

Message ID 1468429565-16488-3-git-send-email-jonathan@wizery.com
State Accepted
Headers show

Commit Message

Jonathan Afek July 13, 2016, 5:06 p.m. UTC
Some tests call the check_qos_map() func more than once.
Make sure each test setups wlantest only once before the first
time the function is called.

The wlantest setup sets the channel for the wlantest interface
and executes the wlantest executable.
It is more efficient to do that only once for each test.

Signed-off-by: Jonathan Afek <jonathanx.afek@intel.com>
---
 tests/hwsim/test_ap_qosmap.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Jouni Malinen Sept. 17, 2016, 7:50 p.m. UTC | #1
On Wed, Jul 13, 2016 at 08:06:05PM +0300, Jonathan Afek wrote:
> Some tests call the check_qos_map() func more than once.
> Make sure each test setups wlantest only once before the first
> time the function is called.
> 
> The wlantest setup sets the channel for the wlantest interface
> and executes the wlantest executable.
> It is more efficient to do that only once for each test.

Thanks, applied.
diff mbox

Patch

diff --git a/tests/hwsim/test_ap_qosmap.py b/tests/hwsim/test_ap_qosmap.py
index 0ddc456..3e0f57a 100644
--- a/tests/hwsim/test_ap_qosmap.py
+++ b/tests/hwsim/test_ap_qosmap.py
@@ -18,7 +18,6 @@  def check_qos_map(ap, hapd, dev, sta, dscp, tid, ap_tid=None):
     if not ap_tid:
         ap_tid = tid
     bssid = ap['bssid']
-    Wlantest.setup(hapd)
     wt = Wlantest()
     wt.clear_sta_counters(bssid, sta)
     hwsim_utils.test_connectivity(dev, hapd, dscp=dscp, config=False)
@@ -52,6 +51,7 @@  def test_ap_qosmap(dev, apdev):
     addr = dev[0].p2p_interface_addr()
     dev[0].request("DATA_TEST_CONFIG 1")
     hapd.request("DATA_TEST_CONFIG 1")
+    Wlantest.setup(hapd)
     check_qos_map(apdev[0], hapd, dev[0], addr, 53, 2)
     check_qos_map(apdev[0], hapd, dev[0], addr, 22, 6)
     check_qos_map(apdev[0], hapd, dev[0], addr, 8, 0)
@@ -87,6 +87,7 @@  def test_ap_qosmap_default(dev, apdev):
     addr = dev[0].p2p_interface_addr()
     dev[0].request("DATA_TEST_CONFIG 1")
     hapd.request("DATA_TEST_CONFIG 1")
+    Wlantest.setup(hapd)
     for dscp in [ 0, 7, 8, 15, 16, 23, 24, 31, 32, 39, 40, 47, 48, 55, 56, 63]:
         check_qos_map(apdev[0], hapd, dev[0], addr, dscp, dscp >> 3)
     dev[0].request("DATA_TEST_CONFIG 0")
@@ -122,6 +123,7 @@  def test_ap_qosmap_default_acm(dev, apdev):
     addr = dev[0].p2p_interface_addr()
     dev[0].request("DATA_TEST_CONFIG 1")
     hapd.request("DATA_TEST_CONFIG 1")
+    Wlantest.setup(hapd)
     for dscp in [ 0, 7, 8, 15, 16, 23, 24, 31, 32, 39, 40, 47, 48, 55, 56, 63]:
         ap_tid = dscp >> 3
         tid = ap_tid