[PATCH 5/8] tests: setup the wlantest only once in check_qos_map()

Jouni Malinen j at w1.fi
Mon Jun 27 03:46:03 PDT 2016

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.

Jouni Malinen                                            PGP id EFC895FA

More information about the Hostap mailing list