2014-02-20 23:14:30 +01:00
|
|
|
# Module tests
|
|
|
|
# Copyright (c) 2014, Jouni Malinen <j@w1.fi>
|
|
|
|
#
|
|
|
|
# This software may be distributed under the terms of the BSD license.
|
|
|
|
# See README for more details.
|
|
|
|
|
2015-07-23 17:39:02 +02:00
|
|
|
import os
|
|
|
|
import time
|
|
|
|
|
2014-02-20 23:14:30 +01:00
|
|
|
import hostapd
|
|
|
|
|
2015-07-23 17:39:02 +02:00
|
|
|
def test_module_wpa_supplicant(dev, apdev, params):
|
2014-02-20 23:14:30 +01:00
|
|
|
"""wpa_supplicant module tests"""
|
|
|
|
if "OK" not in dev[0].global_request("MODULE_TESTS"):
|
|
|
|
raise Exception("Module tests failed")
|
2015-07-23 17:39:02 +02:00
|
|
|
# allow eloop test to complete
|
|
|
|
time.sleep(0.75)
|
|
|
|
dev[0].relog()
|
|
|
|
with open(os.path.join(params['logdir'], 'log0'), 'r') as f:
|
|
|
|
res = f.read()
|
|
|
|
if "FAIL - should not have called this function" in res:
|
|
|
|
raise Exception("eloop test failed")
|
2014-02-20 23:14:30 +01:00
|
|
|
|
|
|
|
def test_module_hostapd(dev):
|
|
|
|
"""hostapd module tests"""
|
|
|
|
hapd_global = hostapd.HostapdGlobal()
|
|
|
|
if "OK" not in hapd_global.ctrl.request("MODULE_TESTS"):
|
|
|
|
raise Exception("Module tests failed")
|