aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2015-12-28 15:43:46 (GMT)
committerJouni Malinen <j@w1.fi>2015-12-28 15:43:46 (GMT)
commit49d51a0dcb6e4fc638db944a2df50027f552abcf (patch)
tree224009d8751f6b979085e042a140912dc2ca94dc /tests
parentdb3070d289e6938a2e422fc29586445b4658d864 (diff)
downloadhostap-49d51a0dcb6e4fc638db944a2df50027f552abcf.zip
hostap-49d51a0dcb6e4fc638db944a2df50027f552abcf.tar.gz
hostap-49d51a0dcb6e4fc638db944a2df50027f552abcf.tar.bz2
tests: Clear p2p_pref_chan explicitly in test cases where it is used
This parameter is used only in couple of test cases and there is no need to maintain the code to reset it in WpaSupplicant::reset(). Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/hwsim/test_p2p_grpform.py40
-rw-r--r--tests/hwsim/wpasupplicant.py1
2 files changed, 23 insertions, 18 deletions
diff --git a/tests/hwsim/test_p2p_grpform.py b/tests/hwsim/test_p2p_grpform.py
index 899bacb..bd42792 100644
--- a/tests/hwsim/test_p2p_grpform.py
+++ b/tests/hwsim/test_p2p_grpform.py
@@ -345,26 +345,32 @@ def test_grpform_force_chan_conflict(dev):
def test_grpform_pref_chan_go(dev):
"""P2P group formation preferred channel selection by GO"""
- dev[0].request("SET p2p_pref_chan 81:7")
- [i_res, r_res] = go_neg_pin_authorized(i_dev=dev[0], i_intent=15,
- r_dev=dev[1], r_intent=0,
- test_data=False)
- check_grpform_results(i_res, r_res)
- if i_res['freq'] != "2442":
- raise Exception("Unexpected channel - did not follow GO's p2p_pref_chan")
- remove_group(dev[0], dev[1])
+ try:
+ dev[0].request("SET p2p_pref_chan 81:7")
+ [i_res, r_res] = go_neg_pin_authorized(i_dev=dev[0], i_intent=15,
+ r_dev=dev[1], r_intent=0,
+ test_data=False)
+ check_grpform_results(i_res, r_res)
+ if i_res['freq'] != "2442":
+ raise Exception("Unexpected channel - did not follow GO's p2p_pref_chan")
+ remove_group(dev[0], dev[1])
+ finally:
+ dev[0].request("SET p2p_pref_chan ")
def test_grpform_pref_chan_go_overridden(dev):
"""P2P group formation preferred channel selection by GO overridden by client"""
- dev[1].request("SET p2p_pref_chan 81:7")
- [i_res, r_res] = go_neg_pin_authorized(i_dev=dev[0], i_intent=0,
- i_freq=2422,
- r_dev=dev[1], r_intent=15,
- test_data=False)
- check_grpform_results(i_res, r_res)
- if i_res['freq'] != "2422":
- raise Exception("Unexpected channel - did not follow client's forced channel")
- remove_group(dev[0], dev[1])
+ try:
+ dev[1].request("SET p2p_pref_chan 81:7")
+ [i_res, r_res] = go_neg_pin_authorized(i_dev=dev[0], i_intent=0,
+ i_freq=2422,
+ r_dev=dev[1], r_intent=15,
+ test_data=False)
+ check_grpform_results(i_res, r_res)
+ if i_res['freq'] != "2422":
+ raise Exception("Unexpected channel - did not follow client's forced channel")
+ remove_group(dev[0], dev[1])
+ finally:
+ dev[1].request("SET p2p_pref_chan ")
def test_grpform_no_go_freq_forcing_chan(dev):
"""P2P group formation with no-GO freq forcing channel"""
diff --git a/tests/hwsim/wpasupplicant.py b/tests/hwsim/wpasupplicant.py
index e5c3320..6d3ca73 100644
--- a/tests/hwsim/wpasupplicant.py
+++ b/tests/hwsim/wpasupplicant.py
@@ -122,7 +122,6 @@ class WpaSupplicant:
if not "OK" in res:
logger.info("FLUSH to " + self.ifname + " failed: " + res)
self.global_request("REMOVE_NETWORK all")
- self.global_request("SET p2p_pref_chan ")
self.global_request("SET p2p_no_group_iface 1")
self.global_request("P2P_FLUSH")
self.request("SET ignore_old_scan_res 0")