test_ap_params.py 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. # Test various AP mode parameters
  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 logging
  7. logger = logging.getLogger()
  8. import hwsim_utils
  9. import hostapd
  10. def test_ap_fragmentation_rts_set_high(dev, apdev):
  11. """WPA2-PSK AP with fragmentation and RTS thresholds larger than frame length"""
  12. ssid = "test-wpa2-psk"
  13. passphrase = 'qwertyuiop'
  14. params = hostapd.wpa2_params(ssid=ssid, passphrase=passphrase)
  15. params['rts_threshold'] = "1000"
  16. params['fragm_threshold'] = "2000"
  17. hostapd.add_ap(apdev[0]['ifname'], params)
  18. dev[0].connect(ssid, psk=passphrase, scan_freq="2412")
  19. hwsim_utils.test_connectivity(dev[0].ifname, apdev[0]['ifname'])
  20. def test_ap_fragmentation_open(dev, apdev):
  21. """Open AP with fragmentation threshold"""
  22. ssid = "fragmentation"
  23. params = {}
  24. params['ssid'] = ssid
  25. params['fragm_threshold'] = "1000"
  26. hostapd.add_ap(apdev[0]['ifname'], params)
  27. dev[0].connect(ssid, key_mgmt="NONE", scan_freq="2412")
  28. hwsim_utils.test_connectivity(dev[0].ifname, apdev[0]['ifname'])
  29. def test_ap_fragmentation_wpa2(dev, apdev):
  30. """WPA2-PSK AP with fragmentation threshold"""
  31. ssid = "test-wpa2-psk"
  32. passphrase = 'qwertyuiop'
  33. params = hostapd.wpa2_params(ssid=ssid, passphrase=passphrase)
  34. params['fragm_threshold'] = "1000"
  35. hostapd.add_ap(apdev[0]['ifname'], params)
  36. dev[0].connect(ssid, psk=passphrase, scan_freq="2412")
  37. # TODO: figure out why this fails.. mac80211 bug?
  38. #hwsim_utils.test_connectivity(dev[0].ifname, apdev[0]['ifname'])