diff --git a/tests/hwsim/run-ap-tests.py b/tests/hwsim/run-ap-tests.py index 4554accad..428e4ec92 100755 --- a/tests/hwsim/run-ap-tests.py +++ b/tests/hwsim/run-ap-tests.py @@ -57,14 +57,16 @@ def main(): if m: print "Import test cases from " + t mod = __import__(m.group(1)) - mod.add_tests(tests) + for s in dir(mod): + if s.startswith("test_"): + func = mod.__dict__.get(s) + tests.append(func) passed = [] failed = [] for t in tests: if test_filter: - #if test_filter not in t.__name__: if test_filter != t.__name__: continue reset_devs(dev, hapd_ifaces) diff --git a/tests/hwsim/run-p2p-tests.py b/tests/hwsim/run-p2p-tests.py index c0174abc2..5ae06d22c 100755 --- a/tests/hwsim/run-p2p-tests.py +++ b/tests/hwsim/run-p2p-tests.py @@ -49,14 +49,17 @@ def main(): if m: print "Import test cases from " + t mod = __import__(m.group(1)) - mod.add_tests(tests) + for s in dir(mod): + if s.startswith("test_"): + func = mod.__dict__.get(s) + tests.append(func) passed = [] failed = [] for t in tests: if test_filter: - if test_filter not in t.__name__: + if test_filter != t.__name__: continue for d in dev: d.reset() diff --git a/tests/hwsim/test_ap_tdls.py b/tests/hwsim/test_ap_tdls.py index ad361100c..eca37e2a6 100644 --- a/tests/hwsim/test_ap_tdls.py +++ b/tests/hwsim/test_ap_tdls.py @@ -261,18 +261,3 @@ def test_ap_open_tdls(dev): setup_tdls(dev[0], dev[1], bssid) teardown_tdls(dev[0], dev[1], bssid) setup_tdls(dev[1], dev[0], bssid) - -def add_tests(tests): - tests.append(test_ap_wpa2_tdls) - tests.append(test_ap_wpa2_tdls_concurrent_init) - tests.append(test_ap_wpa2_tdls_concurrent_init2) - tests.append(test_ap_wpa2_tdls_decline_resp) - tests.append(test_ap_wpa2_tdls_long_lifetime) - tests.append(test_ap_wpa2_tdls_long_frame) - tests.append(test_ap_wpa2_tdls_reneg) - tests.append(test_ap_wpa2_tdls_wrong_lifetime_resp) - tests.append(test_ap_wpa2_tdls_diff_rsnie) - tests.append(test_ap_wpa_tdls) - tests.append(test_ap_wpa_mixed_tdls) - tests.append(test_ap_wep_tdls) - tests.append(test_ap_open_tdls) diff --git a/tests/hwsim/test_p2p_autogo.py b/tests/hwsim/test_p2p_autogo.py index e02beac85..ff316a57f 100644 --- a/tests/hwsim/test_p2p_autogo.py +++ b/tests/hwsim/test_p2p_autogo.py @@ -107,8 +107,3 @@ def test_autogo_tdls(dev): dev[2].remove_group() dev[1].remove_group() dev[0].remove_group() - -def add_tests(tests): - tests.append(test_autogo) - tests.append(test_autogo_2cli) - tests.append(test_autogo_tdls) diff --git a/tests/hwsim/test_p2p_discovery.py b/tests/hwsim/test_p2p_discovery.py index 508325adf..d7d568bf0 100644 --- a/tests/hwsim/test_p2p_discovery.py +++ b/tests/hwsim/test_p2p_discovery.py @@ -70,7 +70,3 @@ def test_discovery(dev): dev[0].p2p_stop_find dev[1].p2p_stop_find - - -def add_tests(tests): - tests.append(test_discovery) diff --git a/tests/hwsim/test_p2p_grpform.py b/tests/hwsim/test_p2p_grpform.py index 6c976acb6..c861eb68a 100644 --- a/tests/hwsim/test_p2p_grpform.py +++ b/tests/hwsim/test_p2p_grpform.py @@ -158,12 +158,3 @@ def test_both_go_neg_display(dev): def test_both_go_neg_enter(dev): """P2P GO Negotiation with both devices trying to enter PIN""" go_neg_pin_authorized(i_dev=dev[0], r_dev=dev[1], expect_failure=True, i_go_neg_status=10, i_method='enter', r_method='enter') - -def add_tests(tests): - tests.append(test_grpform) - tests.append(test_grpform2) - tests.append(test_grpform3) - tests.append(test_grpform_pbc) - tests.append(test_both_go_intent_15) - tests.append(test_both_go_neg_display) - tests.append(test_both_go_neg_enter)