]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Get rid of the unnecessary add_tests() functions
authorJouni Malinen <j@w1.fi>
Fri, 29 Mar 2013 19:03:55 +0000 (21:03 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 29 Mar 2013 19:03:55 +0000 (21:03 +0200)
Signed-hostap: Jouni Malinen <j@w1.fi>

tests/hwsim/run-ap-tests.py
tests/hwsim/run-p2p-tests.py
tests/hwsim/test_ap_tdls.py
tests/hwsim/test_p2p_autogo.py
tests/hwsim/test_p2p_discovery.py
tests/hwsim/test_p2p_grpform.py

index 4554accade17aeb24b1de8fcf9648cb9936d0397..428e4ec92c8962877b63c7218634ce6b0bf3a96e 100755 (executable)
@@ -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)
index c0174abc230959aa8f16f9650eda18bcc037d749..5ae06d22c836362bcf0feee3c93097ed30e6e675 100755 (executable)
@@ -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()
index ad361100c34e52de103d3e382d2e58c4c80cb1fe..eca37e2a6037d3edf68a7aeca25eb85cc8f17bef 100644 (file)
@@ -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)
index e02beac85700939fa75f218db20865723a7161c9..ff316a57f7acf0ebcc2b1e3b26122683b0fa3cc7 100644 (file)
@@ -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)
index 508325adf8c4b01fff5111e590a33fad31d1b664..d7d568bf0dadf57272534ead1c2b2af7f2073675 100644 (file)
@@ -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)
index 6c976acb63ddeeab9881de73b54178a6c6652460..c861eb68a1097841fb04c45fc57c9e6c4b3fa5c8 100644 (file)
@@ -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)