aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2016-12-15 12:10:17 (GMT)
committerJouni Malinen <j@w1.fi>2016-12-15 12:17:14 (GMT)
commit670d5eba05fb72e2cc8a8415233697cd4dd3fba7 (patch)
treeb6823adb2ee16cbb4c3a4702990dfd54c82f1798
parentaaa9c60bc29750f7c09685635b6811c8041663cc (diff)
downloadhostap-670d5eba05fb72e2cc8a8415233697cd4dd3fba7.zip
hostap-670d5eba05fb72e2cc8a8415233697cd4dd3fba7.tar.gz
hostap-670d5eba05fb72e2cc8a8415233697cd4dd3fba7.tar.bz2
tests: Fix FST scanning for non-FST APs
The sta2.scan() calls were performing full scan of all channels and reporting only the BSS entry that happened to be the first one in the wpa_supplicant list. This is problematic since it is possible that the target AP was not found and incorrect BSS was selected and used for setting scan_freq which made the connection fail. Furthermore, there is no need to use full scan for these test cases, so use a single channel scan instead. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
-rw-r--r--tests/hwsim/test_fst_module.py34
1 files changed, 13 insertions, 21 deletions
diff --git a/tests/hwsim/test_fst_module.py b/tests/hwsim/test_fst_module.py
index 68a9685..0d6f552 100644
--- a/tests/hwsim/test_fst_module.py
+++ b/tests/hwsim/test_fst_module.py
@@ -743,10 +743,8 @@ def test_fst_sta_connect_to_non_fst_ap(dev, apdev, test_params):
try:
orig_sta1_mbies = sta1.get_local_mbies()
orig_sta2_mbies = sta2.get_local_mbies()
- vals = sta2.scan()
- freq = vals['freq']
sta2.connect_to_external_ap(non_fst_ap, ssid="non_fst_11g",
- key_mgmt="NONE", scan_freq=freq)
+ key_mgmt="NONE", scan_freq='2412')
time.sleep(2)
res_sta1_mbies = sta1.get_local_mbies()
res_sta2_mbies = sta2.get_local_mbies()
@@ -831,9 +829,8 @@ def test_fst_second_sta_connect_to_non_fst_ap(dev, apdev, test_params):
time.sleep(2)
orig_sta1_mbies = sta1.get_local_mbies()
orig_sta2_mbies = sta2.get_local_mbies()
- vals = sta2.scan()
- freq = vals['freq']
- sta2.connect_to_external_ap(non_fst_ap, ssid="non_fst_11g", key_mgmt="NONE", scan_freq=freq)
+ sta2.connect_to_external_ap(non_fst_ap, ssid="non_fst_11g",
+ key_mgmt="NONE", scan_freq='2412')
time.sleep(2)
res_sta1_mbies = sta1.get_local_mbies()
res_sta2_mbies = sta2.get_local_mbies()
@@ -857,9 +854,8 @@ def test_fst_second_sta_connect_to_fst_ap(dev, apdev, test_params):
with HWSimRadio() as (radio, iface):
non_fst_ap = hostapd.add_ap(iface, { "ssid": "non_fst_11g" })
try:
- vals = sta2.scan()
- freq = vals['freq']
- sta2.connect_to_external_ap(non_fst_ap, ssid="non_fst_11g", key_mgmt="NONE", scan_freq=freq)
+ sta2.connect_to_external_ap(non_fst_ap, ssid="non_fst_11g",
+ key_mgmt="NONE", scan_freq='2412')
time.sleep(2)
orig_sta1_mbies = sta1.get_local_mbies()
orig_sta2_mbies = sta2.get_local_mbies()
@@ -890,9 +886,8 @@ def test_fst_disconnect_1_of_2_stas_from_non_fst_ap(dev, apdev, test_params):
try:
vals = sta1.scan(freq=fst_test_common.fst_test_def_freq_a)
sta1.connect(fst_ap1, key_mgmt="NONE", scan_freq=fst_test_common.fst_test_def_freq_a)
- vals = sta2.scan()
- freq = vals['freq']
- sta2.connect_to_external_ap(non_fst_ap, ssid="non_fst_11g", key_mgmt="NONE", scan_freq=freq)
+ sta2.connect_to_external_ap(non_fst_ap, ssid="non_fst_11g",
+ key_mgmt="NONE", scan_freq='2412')
time.sleep(2)
orig_sta1_mbies = sta1.get_local_mbies()
orig_sta2_mbies = sta2.get_local_mbies()
@@ -922,9 +917,8 @@ def test_fst_disconnect_1_of_2_stas_from_fst_ap(dev, apdev, test_params):
try:
vals = sta1.scan(freq=fst_test_common.fst_test_def_freq_a)
sta1.connect(fst_ap1, key_mgmt="NONE", scan_freq=fst_test_common.fst_test_def_freq_a)
- vals = sta2.scan()
- freq = vals['freq']
- sta2.connect_to_external_ap(non_fst_ap, ssid="non_fst_11g", key_mgmt="NONE", scan_freq=freq)
+ sta2.connect_to_external_ap(non_fst_ap, ssid="non_fst_11g",
+ key_mgmt="NONE", scan_freq='2412')
time.sleep(2)
orig_sta1_mbies = sta1.get_local_mbies()
orig_sta2_mbies = sta2.get_local_mbies()
@@ -954,9 +948,8 @@ def test_fst_disconnect_2_of_2_stas_from_non_fst_ap(dev, apdev, test_params):
try:
vals = sta1.scan(freq=fst_test_common.fst_test_def_freq_a)
sta1.connect(fst_ap1, key_mgmt="NONE", scan_freq=fst_test_common.fst_test_def_freq_a)
- vals = sta2.scan()
- freq = vals['freq']
- sta2.connect_to_external_ap(non_fst_ap, ssid="non_fst_11g", key_mgmt="NONE", scan_freq=freq)
+ sta2.connect_to_external_ap(non_fst_ap, ssid="non_fst_11g",
+ key_mgmt="NONE", scan_freq='2412')
time.sleep(2)
sta1.disconnect()
time.sleep(2)
@@ -988,9 +981,8 @@ def test_fst_disconnect_2_of_2_stas_from_fst_ap(dev, apdev, test_params):
try:
vals = sta1.scan(freq=fst_test_common.fst_test_def_freq_a)
sta1.connect(fst_ap1, key_mgmt="NONE", scan_freq=fst_test_common.fst_test_def_freq_a)
- vals = sta2.scan()
- freq = vals['freq']
- sta2.connect_to_external_ap(non_fst_ap, ssid="non_fst_11g", key_mgmt="NONE", scan_freq=freq)
+ sta2.connect_to_external_ap(non_fst_ap, ssid="non_fst_11g",
+ key_mgmt="NONE", scan_freq='2412')
time.sleep(2)
sta2.disconnect_from_external_ap()
time.sleep(2)