tests: Make ap_reconnect_auth_timeout test more robust

Message ID 1534959105-13163-3-git-send-email-andrei.otcheretianski@intel.com
State Accepted
Headers show
Series
  • tests: Make ap_reconnect_auth_timeout test more robust
Related show

Commit Message

Andrei Otcheretianski Aug. 22, 2018, 5:31 p.m.
This test starts two identical APs and assumes a connection to the first
one, though it is not necessary true.
Fix that by starting the second AP only after the connection is
established.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
---
 tests/hwsim/test_ap_roam.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Jouni Malinen Oct. 16, 2018, 3:38 p.m. | #1
On Wed, Aug 22, 2018 at 08:31:45PM +0300, Andrei Otcheretianski wrote:
> This test starts two identical APs and assumes a connection to the first
> one, though it is not necessary true.
> Fix that by starting the second AP only after the connection is
> established.

Thanks, applied.

Patch

diff --git a/tests/hwsim/test_ap_roam.py b/tests/hwsim/test_ap_roam.py
index 6f8b8d9..63a0b2c 100644
--- a/tests/hwsim/test_ap_roam.py
+++ b/tests/hwsim/test_ap_roam.py
@@ -74,13 +74,14 @@  def test_ap_reconnect_auth_timeout(dev, apdev, params):
     params = hostapd.wpa2_params(ssid="test-wpa2-psk", passphrase="12345678")
     hapd0 = hostapd.add_ap(apdev[0], params)
     bssid0 = hapd0.own_addr()
-    hapd1 = hostapd.add_ap(apdev[1], params)
-    bssid1 = hapd1.own_addr()
 
     wpas.scan_for_bss(bssid0, freq=2412)
     id = wpas.connect("test-wpa2-psk", psk="12345678", scan_freq="2412")
     hwsim_utils.test_connectivity(wpas, hapd0)
 
+    hapd1 = hostapd.add_ap(apdev[1], params)
+    bssid1 = hapd1.own_addr()
+
     wpas.request("BLACKLIST " + bssid0)
 
     wpas.scan_for_bss(bssid1, freq=2412)