diff --git a/tests/hwsim/run-p2p-tests.py b/tests/hwsim/run-p2p-tests.py index e8060b946..151c538d8 100755 --- a/tests/hwsim/run-p2p-tests.py +++ b/tests/hwsim/run-p2p-tests.py @@ -7,6 +7,7 @@ # See README for more details. import os +import re import sys import time @@ -14,9 +15,6 @@ import logging from wpasupplicant import WpaSupplicant -import test_p2p_grpform -import test_p2p_autogo - def main(): idx = 1 if len(sys.argv) > 1 and sys.argv[1] == '-d': @@ -46,8 +44,12 @@ def main(): print "DEV: " + d.ifname + ": " + d.p2p_dev_addr() tests = [] - test_p2p_grpform.add_tests(tests) - test_p2p_autogo.add_tests(tests) + for t in os.listdir("."): + m = re.match(r'(test_p2p_.*)\.py$', t) + if m: + print "Import test cases from " + t + mod = __import__(m.group(1)) + mod.add_tests(tests) passed = [] failed = []