tests: Add general filter for remote tests execution
authorJonathan Afek <jonathan@wizery.com>
Thu, 23 Jun 2016 17:16:35 +0000 (20:16 +0300)
committerJouni Malinen <j@w1.fi>
Mon, 27 Jun 2016 18:47:37 +0000 (21:47 +0300)
Add a new function decorator for the test functions so that they can be
marked as remote compatible tests. Add a general filter to the remote
tests execution script to only execute tests that are remote compatible.

Signed-off-by: Jonathan Afek <jonathanx.afek@intel.com>
tests/hwsim/remotehost.py
tests/remote/run-tests.py

index 39d7253..ce676a3 100644 (file)
@@ -10,6 +10,10 @@ import threading
 
 logger = logging.getLogger()
 
+def remote_compatible(func):
+    func.remote_compatible = True
+    return func
+
 def execute_thread(command, reply):
     cmd = ' '.join(command)
     logger.debug("thread run: " + cmd)
index fea73f5..b438815 100755 (executable)
@@ -191,6 +191,10 @@ def main():
         # setup hwsim_test we should run
         if requested_hwsim_tests[0] == "all":
             hwsim_tests_to_run = hwsim_tests
+        elif requested_hwsim_tests[0] == "remote":
+            hwsim_tests_to_run = [t for t in hwsim_tests
+                                  if hasattr(t, "remote_compatible") and
+                                     t.remote_compatible]
         else:
             for test in requested_hwsim_tests:
                 t = None