Updated through tag hostap_2_5 from git://w1.fi/hostap.git
[mech_eap.git] / libeap / tests / hwsim / test_module_tests.py
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
7 import os
8 import time
9
10 import hostapd
11
12 def test_module_wpa_supplicant(dev, apdev, params):
13     """wpa_supplicant module tests"""
14     if "OK" not in dev[0].global_request("MODULE_TESTS"):
15         raise Exception("Module tests failed")
16     # allow eloop test to complete
17     time.sleep(0.75)
18     dev[0].relog()
19     with open(os.path.join(params['logdir'], 'log0'), 'r') as f:
20         res = f.read()
21         if "FAIL - should not have called this function" in res:
22             raise Exception("eloop test failed")
23
24 def test_module_hostapd(dev):
25     """hostapd module tests"""
26     hapd_global = hostapd.HostapdGlobal()
27     if "OK" not in hapd_global.ctrl.request("MODULE_TESTS"):
28         raise Exception("Module tests failed")