test_ap_open.py 824 B

123456789101112131415161718192021
  1. # Open mode AP tests
  2. # Copyright (c) 2014, Qualcomm Atheros, Inc.
  3. #
  4. # This software may be distributed under the terms of the BSD license.
  5. # See README for more details.
  6. import hostapd
  7. import hwsim_utils
  8. def test_ap_open(dev, apdev):
  9. """AP with open mode (no security) configuration"""
  10. hapd = hostapd.add_ap(apdev[0]['ifname'], { "ssid": "open" })
  11. dev[0].connect("open", key_mgmt="NONE", scan_freq="2412")
  12. hwsim_utils.test_connectivity(dev[0].ifname, apdev[0]['ifname'])
  13. ev = hapd.wait_event([ "AP-STA-CONNECTED" ], timeout=5)
  14. if ev is None:
  15. raise Exception("No connection event received from hostapd")
  16. dev[0].request("DISCONNECT")
  17. ev = hapd.wait_event([ "AP-STA-DISCONNECTED" ], timeout=5)
  18. if ev is None:
  19. raise Exception("No disconnection event received from hostapd")