]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Allow test cases to receive additional parameters
authorJouni Malinen <j@w1.fi>
Sun, 23 Mar 2014 09:59:43 +0000 (11:59 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 23 Mar 2014 10:01:10 +0000 (12:01 +0200)
The optional third argument to the test case functions can now be used
to receive additional parameters from run-tests.py. As the initial
parameter, logdir value is provided so that test cases can use it to
review the debug logs from the test run.

Signed-off-by: Jouni Malinen <j@w1.fi>
tests/hwsim/run-tests.py

index 1bcf0823d7a092617edfefb77d90ea56fc5ac1bd..a5ddbc313c5f51027f4711a190e54946c102dd09 100755 (executable)
@@ -340,7 +340,11 @@ def main():
                         conn = None
                     sys.exit(1)
             try:
-                if t.func_code.co_argcount > 1:
+                if t.func_code.co_argcount > 2:
+                    params = {}
+                    params['logdir'] = args.logdir
+                    res = t(dev, apdev, params)
+                elif t.func_code.co_argcount > 1:
                     res = t(dev, apdev)
                 else:
                     res = t(dev)