diff mbox series

[2/5] tests: hwsim: remove useless test list

Message ID 20190202221607.9965-2-johannes@sipsolutions.net
State Accepted
Headers show
Series [1/5] tests: hwsim: add test reconnecting on assoc failure | expand

Commit Message

Johannes Berg Feb. 2, 2019, 10:16 p.m. UTC
From: Johannes Berg <johannes.berg@intel.com>

There's no point in printing out a 3k+ long list, just remove it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 tests/hwsim/run-tests.py | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

Comments

Johannes Berg Feb. 2, 2019, 10:53 p.m. UTC | #1
On Sat, 2019-02-02 at 23:16 +0100, Johannes Berg wrote:
> 
> @@ -252,6 +251,15 @@ def main():
>          print('Invalid arguments - only one of (test, test modules, modules file) can be given.')
>          sys.exit(2)
>  
> +    if args.tests:
> +        fail = False
> +        for t in args.tests:
> +            if not t in test_names:
> +                print 'Invalid arguments - test "%s" not known' % t

Oops, here we go - looks like I undid a python3 conversion here by not
having parentheses, could you fix it while applying?

johannes
diff mbox series

Patch

diff --git a/tests/hwsim/run-tests.py b/tests/hwsim/run-tests.py
index be0edcb7a7c1..391b3a84887a 100755
--- a/tests/hwsim/run-tests.py
+++ b/tests/hwsim/run-tests.py
@@ -243,8 +243,7 @@  def main():
     parser.add_argument('-i', action='store_true', dest='stdin_ctrl',
                         help='stdin-controlled test case execution')
     parser.add_argument('tests', metavar='<test>', nargs='*', type=str,
-                        help='tests to run (only valid without -f)',
-                        choices=[[]] + test_names)
+                        help='tests to run (only valid without -f)')
 
     args = parser.parse_args()
 
@@ -252,6 +251,15 @@  def main():
         print('Invalid arguments - only one of (test, test modules, modules file) can be given.')
         sys.exit(2)
 
+    if args.tests:
+        fail = False
+        for t in args.tests:
+            if not t in test_names:
+                print 'Invalid arguments - test "%s" not known' % t
+                fail = True
+        if fail:
+            sys.exit(2)
+
     if args.database:
         if not sqlite3_imported:
             print("No sqlite3 module found")