Message ID | 1466702196-26828-5-git-send-email-jonathan@wizery.com |
---|---|
State | Changes Requested |
Headers | show |
On Thu, Jun 23, 2016 at 08:16:33PM +0300, Jonathan Afek wrote: > Some tests call the check_qos_map() func more than once. > Make sure it setups the wlantest only once on the first > time it is called. > diff --git a/tests/hwsim/test_ap_qosmap.py b/tests/hwsim/test_ap_qosmap.py > @@ -17,7 +17,8 @@ def check_qos_map(ap, hapd, dev, sta, dscp, tid, ap_tid=None): > - Wlantest.setup(hapd) > + if not Wlantest.setup_done: > + Wlantest.setup(hapd) Is this really the correct thing to do? Isn't that Wlantest.setup_done shared through all test cases? What if the QoS mapping test cases get run after a test case that used wlantest on another channel? If this commit is trying to optimize test execution (the commit message should really provide the reason for doing this change..), that would likely need to be done by maintaining a local variable for the test case(s) in question rather than relying on Wlantest.setup_done.
On Mon, Jun 27, 2016 at 12:46 PM, Jouni Malinen <j@w1.fi> wrote: > Is this really the correct thing to do? Isn't that Wlantest.setup_done > shared through all test cases? It is not shared. The wlantest state is reset between tests. > If this > commit is trying to optimize test execution (the commit message should > really provide the reason for doing this change..), that would likely > need to be done by maintaining a local variable for the test case(s) in > question rather than relying on Wlantest.setup_done. Sending another version.
diff --git a/tests/hwsim/test_ap_qosmap.py b/tests/hwsim/test_ap_qosmap.py index 48348bf..a98176b 100644 --- a/tests/hwsim/test_ap_qosmap.py +++ b/tests/hwsim/test_ap_qosmap.py @@ -17,7 +17,8 @@ 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) + if not Wlantest.setup_done: + Wlantest.setup(hapd) wt = Wlantest() wt.clear_sta_counters(bssid, sta) hwsim_utils.test_connectivity(dev, hapd, dscp=dscp, config=False)
Some tests call the check_qos_map() func more than once. Make sure it setups the wlantest only once on the first time it is called. Signed-off-by: Jonathan Afek <jonathanx.afek@intel.com> --- tests/hwsim/test_ap_qosmap.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)