[PATCH 05/32] tests: Fix ap_track_sta_no_auth_passive false negative by using common finalizer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



ap_track_sta_no_auth_passive fails with this message.

---------------
wlan0: Country code not reset back to 00: is US
wlan0: Country code cleared back to 00
---------------

This patch fixes the issue.

Signed-off-by: Masashi Honma <masashi.honma@xxxxxxxxx>
---
 tests/hwsim/test_ap_track.py | 43 ++++++++++++++++++------------------
 1 file changed, 21 insertions(+), 22 deletions(-)

diff --git a/tests/hwsim/test_ap_track.py b/tests/hwsim/test_ap_track.py
index eede9b285..779a5787b 100644
--- a/tests/hwsim/test_ap_track.py
+++ b/tests/hwsim/test_ap_track.py
@@ -171,31 +171,30 @@ def _test_ap_track_sta_no_auth(dev, bssid, bssid2):
 def test_ap_track_sta_no_auth_passive(dev, apdev):
     """AP rejecting authentication from dualband STA on 2.4 GHz (passive)"""
     try:
-        _test_ap_track_sta_no_auth_passive(dev, apdev)
-    finally:
-        subprocess.call(['iw', 'reg', 'set', '00'])
-        time.sleep(0.1)
+        params = {"ssid": "track",
+                  "country_code": "US",
+                  "hw_mode": "g",
+                  "channel": "6",
+                  "no_auth_if_seen_on": apdev[1]['ifname']}
+        hapd = hostapd.add_ap(apdev[0], params)
 
-def _test_ap_track_sta_no_auth_passive(dev, apdev):
-    dev[0].flush_scan_cache()
+        params = {"ssid": "track",
+                  "country_code": "US",
+                  "hw_mode": "a",
+                  "channel": "40",
+                  "interworking": "1",
+                  "venue_name": "eng:Venue",
+                  "track_sta_max_num": "100"}
+        hapd2 = hostapd.add_ap(apdev[1], params)
 
-    params = {"ssid": "track",
-              "country_code": "US",
-              "hw_mode": "g",
-              "channel": "6",
-              "no_auth_if_seen_on": apdev[1]['ifname']}
-    hapd = hostapd.add_ap(apdev[0], params)
-    bssid = apdev[0]['bssid']
+        _test_ap_track_sta_no_auth_passive(dev, apdev[0]['bssid'], apdev[1]['bssid'])
+    finally:
+        disable_hapd(hapd)
+        disable_hapd(hapd2)
+        clear_regdom_dev(dev)
 
-    params = {"ssid": "track",
-              "country_code": "US",
-              "hw_mode": "a",
-              "channel": "40",
-              "interworking": "1",
-              "venue_name": "eng:Venue",
-              "track_sta_max_num": "100"}
-    hapd2 = hostapd.add_ap(apdev[1], params)
-    bssid2 = apdev[1]['bssid']
+def _test_ap_track_sta_no_auth_passive(dev, bssid, bssid2):
+    dev[0].flush_scan_cache()
 
     dev[0].scan_for_bss(bssid, freq=2437, force_scan=True)
     for i in range(10):
-- 
2.17.1


_______________________________________________
Hostap mailing list
Hostap@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/hostap



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux