test_hapd_ctrl.py 1014 B

123456789101112131415161718192021222324252627282930
  1. # hostapd control interface
  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. def test_hapd_ctrl_status(dev, apdev):
  8. """hostapd ctrl_iface STATUS commands"""
  9. ssid = "hapd-ctrl"
  10. bssid = apdev[0]['bssid']
  11. params = hostapd.wpa2_params(ssid=ssid, passphrase="12345678")
  12. hapd = hostapd.add_ap(apdev[0]['ifname'], params)
  13. status = hapd.get_status()
  14. driver = hapd.get_driver_status()
  15. if status['bss[0]'] != apdev[0]['ifname']:
  16. raise Exception("Unexpected bss[0]")
  17. if status['ssid[0]'] != ssid:
  18. raise Exception("Unexpected ssid[0]")
  19. if status['bssid[0]'] != bssid:
  20. raise Exception("Unexpected bssid[0]")
  21. if status['freq'] != "2412":
  22. raise Exception("Unexpected freq")
  23. if driver['beacon_set'] != "1":
  24. raise Exception("Unexpected beacon_set")
  25. if driver['addr'] != bssid:
  26. raise Exception("Unexpected addr")