selftest: Move tests into own subdirectories

Change-Id: Id21cda19df131e24402e1a593036e1e33a914920
diff --git a/selftest/all_tests.py b/selftest/all_tests.py
index 5c1ce59..bb00793 100755
--- a/selftest/all_tests.py
+++ b/selftest/all_tests.py
@@ -72,14 +72,20 @@
 script_dir = sys.path[0]
 
 tests = []
-for f in os.listdir(script_dir):
-    file_path = os.path.join(script_dir, f)
-    if not os.path.isfile(file_path):
+for d in os.listdir(script_dir):
+    dir_path = os.path.join(script_dir, d)
+    if not os.path.isdir(dir_path):
         continue
+    if not dir_path.endswith('_test'):
+        continue
+    for f in os.listdir(dir_path):
+        file_path = os.path.join(script_dir, d, f)
+        if not os.path.isfile(file_path):
+            continue
 
-    if not (file_path.endswith('_test.py') or file_path.endswith('_test.sh')):
-        continue
-    tests.append(file_path)
+        if not (file_path.endswith('_test.py') or file_path.endswith('_test.sh')):
+            continue
+        tests.append(file_path)
 
 ran = []
 errors = []