test_p2p_device.py 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  1. #!/usr/bin/python
  2. #
  3. # cfg80211 P2P Device
  4. # Copyright (c) 2013, Jouni Malinen <j@w1.fi>
  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 time
  11. from wpasupplicant import WpaSupplicant
  12. from test_p2p_grpform import go_neg_pin_authorized
  13. from test_p2p_grpform import check_grpform_results
  14. from test_p2p_grpform import remove_group
  15. def test_p2p_device_grpform(dev, apdev):
  16. """P2P group formation with driver using cfg80211 P2P Device"""
  17. wpas = WpaSupplicant(global_iface='/tmp/wpas-wlan5')
  18. wpas.interface_add("wlan5")
  19. [i_res, r_res] = go_neg_pin_authorized(i_dev=dev[0], i_intent=15,
  20. r_dev=wpas, r_intent=0)
  21. check_grpform_results(i_res, r_res)
  22. remove_group(dev[0], wpas)
  23. def test_p2p_device_grpform2(dev, apdev):
  24. """P2P group formation with driver using cfg80211 P2P Device (reverse)"""
  25. wpas = WpaSupplicant(global_iface='/tmp/wpas-wlan5')
  26. wpas.interface_add("wlan5")
  27. [i_res, r_res] = go_neg_pin_authorized(i_dev=wpas, i_intent=15,
  28. r_dev=dev[0], r_intent=0)
  29. check_grpform_results(i_res, r_res)
  30. remove_group(wpas, dev[0])