]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
suite: schedule a list of collections for running instead of a single suite directory
authorJosh Durgin <josh.durgin@dreamhost.com>
Fri, 18 Nov 2011 01:14:05 +0000 (17:14 -0800)
committerJosh Durgin <josh.durgin@dreamhost.com>
Fri, 18 Nov 2011 01:16:23 +0000 (17:16 -0800)
teuthology/suite.py

index 4569328b2e44ac6199236367b89dd01dc034e6e4..ae70f609174a6f8ff01f9c1d496f872217348f1b 100644 (file)
@@ -10,6 +10,7 @@ import time
 import yaml
 
 from teuthology import misc as teuthology
+from teuthology import safepath
 
 log = logging.getLogger(__name__)
 
@@ -17,15 +18,12 @@ def main():
     parser = argparse.ArgumentParser(description="""
 Run a suite of ceph integration tests.
 
-A suite is a directory containing a subdirectory collections/
-containing collections.
+A suite is a set of collections.
 
 A collection is a directory containing facets.
 
 A facet is a directory containing config snippets.
 
-Running the suite means running teuthology for every collection.
-
 Running a collection means running teuthology for every configuration
 combination generated by taking one config snippet from each facet.
 
@@ -38,20 +36,21 @@ combination, and will override anything in the suite.
         help='be more verbose',
         )
     parser.add_argument(
-        '--suite',
+        '--name',
+        help='name for this suite',
+        required=True,
+        )
+    parser.add_argument(
+        '--collections',
         metavar='DIR',
-        help='suite of tests to run',
+        nargs='+',
         required=True,
+        help='the collections to run',
         )
     parser.add_argument(
         '--owner',
         help='job owner',
         )
-    parser.add_argument(
-        '--name',
-        help='name for this suite',
-        required=True,
-        )
     parser.add_argument(
         '--email',
         help='address to email test failures to',
@@ -84,19 +83,6 @@ combination, and will override anything in the suite.
         level=loglevel,
         )
 
-    collection_dir = os.path.join(args.suite,'collections')
-    print collection_dir
-    if os.path.exists(collection_dir) and os.path.isdir(collection_dir):
-        collections = [
-            (os.path.join(collection_dir, f), f)
-            for f in sorted(os.listdir(collection_dir))
-            if not f.startswith('.')
-            and os.path.isdir(os.path.join(collection_dir, f))
-            ]
-    else:
-        # degenerate case; 'suite' is actually a single collection
-        collections = [(args.suite, 'none')]
-
     base_arg = [
         os.path.join(os.path.dirname(sys.argv[0]), 'teuthology-schedule'),
         '--name', args.name,
@@ -106,6 +92,17 @@ combination, and will override anything in the suite.
     if args.owner:
         base_arg.extend(['--owner', args.owner])
 
+    for collection in args.collections:
+        if not os.path.isdir(collection):
+            print >>sys.stderr, 'Collection %s is not a directory' % collection
+            sys.exit(1)
+
+    collections = [
+        (collection,
+         os.path.basename(safepath.munge(collection)))
+        for collection in args.collections
+        ]
+
     for collection, collection_name in sorted(collections):
         log.info('Collection %s in %s' % (collection_name, collection))
         facets = [
@@ -136,7 +133,6 @@ combination, and will override anything in the suite.
                     ])
             arg.extend(path for facet, name, path in configs)
             arg.extend(args.config)
-            print arg
             subprocess.check_call(
                 args=arg,
                 )
@@ -148,7 +144,7 @@ combination, and will override anything in the suite.
     if args.timeout:
         arg.extend(['--timeout', args.timeout])
     subprocess.check_call(
-        args=arg
+        args=arg,
         )
 
 def ls():