test_ap_params.py 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #!/usr/bin/python
  2. #
  3. # Test various AP mode parameters
  4. # Copyright (c) 2014, Qualcomm Atheros, Inc.
  5. #
  6. # This software may be distributed under the terms of the BSD license.
  7. # See README for more details.
  8. import logging
  9. logger = logging.getLogger()
  10. import hwsim_utils
  11. import hostapd
  12. def test_ap_fragmentation_rts_set_high(dev, apdev):
  13. """WPA2-PSK AP with fragmentation and RTS thresholds larger than frame length"""
  14. ssid = "test-wpa2-psk"
  15. passphrase = 'qwertyuiop'
  16. params = hostapd.wpa2_params(ssid=ssid, passphrase=passphrase)
  17. params['rts_threshold'] = "1000"
  18. params['fragm_threshold'] = "2000"
  19. hostapd.add_ap(apdev[0]['ifname'], params)
  20. dev[0].connect(ssid, psk=passphrase, scan_freq="2412")
  21. hwsim_utils.test_connectivity(dev[0].ifname, apdev[0]['ifname'])
  22. def test_ap_fragmentation_open(dev, apdev):
  23. """Open AP with fragmentation threshold"""
  24. ssid = "fragmentation"
  25. params = {}
  26. params['ssid'] = ssid
  27. params['fragm_threshold'] = "1000"
  28. hostapd.add_ap(apdev[0]['ifname'], params)
  29. dev[0].connect(ssid, key_mgmt="NONE", scan_freq="2412")
  30. hwsim_utils.test_connectivity(dev[0].ifname, apdev[0]['ifname'])
  31. def test_ap_fragmentation_wpa2(dev, apdev):
  32. """WPA2-PSK AP with fragmentation threshold"""
  33. ssid = "test-wpa2-psk"
  34. passphrase = 'qwertyuiop'
  35. params = hostapd.wpa2_params(ssid=ssid, passphrase=passphrase)
  36. params['fragm_threshold'] = "1000"
  37. hostapd.add_ap(apdev[0]['ifname'], params)
  38. dev[0].connect(ssid, psk=passphrase, scan_freq="2412")
  39. # TODO: figure out why this fails.. mac80211 bug?
  40. #hwsim_utils.test_connectivity(dev[0].ifname, apdev[0]['ifname'])