]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Clear p2p_no_go_freq explicitly in test cases where it is used
authorJouni Malinen <jouni@qca.qualcomm.com>
Mon, 28 Dec 2015 15:26:20 +0000 (17:26 +0200)
committerJouni Malinen <j@w1.fi>
Mon, 28 Dec 2015 15:33:09 +0000 (17:33 +0200)
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>
tests/hwsim/test_p2p_grpform.py
tests/hwsim/wpasupplicant.py

index e06fd39e3bbaa20ac8b93854efafe63a8c292b90..9f70a09ecb02e7fc939d73455c1dd7309cf720eb 100644 (file)
@@ -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"""
index e0461524961b75ffa5786a8d66b44dbb13c0027b..2f8290ecd3663807546499eafb6cd8e0dff3ced2 100644 (file)
@@ -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")