test_module_tests.py 889 B

12345678910111213141516171819202122232425262728
  1. # Module tests
  2. # Copyright (c) 2014, Jouni Malinen <j@w1.fi>
  3. #
  4. # This software may be distributed under the terms of the BSD license.
  5. # See README for more details.
  6. import os
  7. import time
  8. import hostapd
  9. def test_module_wpa_supplicant(dev, apdev, params):
  10. """wpa_supplicant module tests"""
  11. if "OK" not in dev[0].global_request("MODULE_TESTS"):
  12. raise Exception("Module tests failed")
  13. # allow eloop test to complete
  14. time.sleep(0.75)
  15. dev[0].relog()
  16. with open(os.path.join(params['logdir'], 'log0'), 'r') as f:
  17. res = f.read()
  18. if "FAIL - should not have called this function" in res:
  19. raise Exception("eloop test failed")
  20. def test_module_hostapd(dev):
  21. """hostapd module tests"""
  22. hapd_global = hostapd.HostapdGlobal()
  23. if "OK" not in hapd_global.ctrl.request("MODULE_TESTS"):
  24. raise Exception("Module tests failed")