aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2015-12-28 15:26:20 (GMT)
committerJouni Malinen <j@w1.fi>2015-12-28 15:33:09 (GMT)
commit721ec02da53ee498ded0d30c92e8e739dda45448 (patch)
tree2ebb7da154ad0f30e15d5bcb3052bb18f3dd0762 /tests
parentef3866ab016e8ff58c2adbfb1ec673a7f7e1dfd8 (diff)
downloadhostap-721ec02da53ee498ded0d30c92e8e739dda45448.zip
hostap-721ec02da53ee498ded0d30c92e8e739dda45448.tar.gz
hostap-721ec02da53ee498ded0d30c92e8e739dda45448.tar.bz2
tests: Clear p2p_no_go_freq 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.py30
-rw-r--r--tests/hwsim/wpasupplicant.py1
2 files changed, 18 insertions, 13 deletions
diff --git a/tests/hwsim/test_p2p_grpform.py b/tests/hwsim/test_p2p_grpform.py
index e06fd39..9f70a09 100644
--- a/tests/hwsim/test_p2p_grpform.py
+++ b/tests/hwsim/test_p2p_grpform.py
@@ -368,21 +368,27 @@ def test_grpform_pref_chan_go_overridden(dev):
def test_grpform_no_go_freq_forcing_chan(dev):
"""P2P group formation with no-GO freq forcing channel"""
- dev[1].request("SET p2p_no_go_freq 100-200,300,4000-6000")
- [i_res, r_res] = go_neg_pin_authorized(i_dev=dev[0], i_intent=0,
- r_dev=dev[1], r_intent=15,
- test_data=False)
- check_grpform_results(i_res, r_res)
- if int(i_res['freq']) > 4000:
- raise Exception("Unexpected channel - did not follow no-GO freq")
- remove_group(dev[0], dev[1])
+ try:
+ dev[1].request("SET p2p_no_go_freq 100-200,300,4000-6000")
+ [i_res, r_res] = go_neg_pin_authorized(i_dev=dev[0], i_intent=0,
+ r_dev=dev[1], r_intent=15,
+ test_data=False)
+ check_grpform_results(i_res, r_res)
+ if int(i_res['freq']) > 4000:
+ raise Exception("Unexpected channel - did not follow no-GO freq")
+ remove_group(dev[0], dev[1])
+ finally:
+ dev[1].request("SET p2p_no_go_freq ")
def test_grpform_no_go_freq_conflict(dev):
"""P2P group formation fails due to no-GO range forced by client"""
- dev[1].request("SET p2p_no_go_freq 2000-3000")
- go_neg_pin_authorized(i_dev=dev[0], i_intent=0, i_freq=2422,
- r_dev=dev[1], r_intent=15,
- expect_failure=True, i_go_neg_status=7)
+ try:
+ dev[1].request("SET p2p_no_go_freq 2000-3000")
+ go_neg_pin_authorized(i_dev=dev[0], i_intent=0, i_freq=2422,
+ r_dev=dev[1], r_intent=15,
+ expect_failure=True, i_go_neg_status=7)
+ finally:
+ dev[1].request("SET p2p_no_go_freq ")
def test_grpform_no_5ghz_world_roaming(dev):
"""P2P group formation with world roaming regulatory"""
diff --git a/tests/hwsim/wpasupplicant.py b/tests/hwsim/wpasupplicant.py
index e046152..2f8290e 100644
--- a/tests/hwsim/wpasupplicant.py
+++ b/tests/hwsim/wpasupplicant.py
@@ -123,7 +123,6 @@ class WpaSupplicant:
logger.info("FLUSH to " + self.ifname + " failed: " + res)
self.global_request("REMOVE_NETWORK all")
self.global_request("SET p2p_add_cli_chan 0")
- self.global_request("SET p2p_no_go_freq ")
self.global_request("SET p2p_pref_chan ")
self.global_request("SET p2p_no_group_iface 1")
self.global_request("SET p2p_go_intent 7")