From 042edcbe1ed6df300ef26133d4fd50fb6df251d1 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Sat, 14 Jul 2012 13:02:04 -0700 Subject: [PATCH] schedule/suite: schedule job, suite N times --- teuthology/run.py | 13 +++++++++++-- teuthology/suite.py | 7 +++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/teuthology/run.py b/teuthology/run.py index 714a3c71d7115..b95c0dc53cbb4 100644 --- a/teuthology/run.py +++ b/teuthology/run.py @@ -216,6 +216,12 @@ def schedule(): nargs='*', help='list of jobs to remove from the queue', ) + parser.add_argument( + '-n', '--num', + default=1, + type=int, + help='number of times to run/queue the job' + ) parser.add_argument( '-v', '--verbose', action='store_true', @@ -260,5 +266,8 @@ def schedule(): job_config['results_timeout'] = ctx.timeout job = yaml.safe_dump(job_config) - jid = beanstalk.put(job, ttr=60*60*24) - print 'Job scheduled with ID {jid}'.format(jid=jid) + num = ctx.num + while num > 0: + jid = beanstalk.put(job, ttr=60*60*24) + print 'Job scheduled with ID {jid}'.format(jid=jid) + num -= 1 diff --git a/teuthology/suite.py b/teuthology/suite.py index 00a40f8ceb1e9..73386d8a851d8 100644 --- a/teuthology/suite.py +++ b/teuthology/suite.py @@ -59,6 +59,12 @@ combination, and will override anything in the suite. '--timeout', help='how many seconds to wait for jobs to finish before emailing results', ) + parser.add_argument( + '-n', '--num', + default=1, + type=int, + help='number of times to run/queue each job' + ) parser.add_argument( 'config', metavar='CONFFILE', @@ -80,6 +86,7 @@ combination, and will override anything in the suite. base_arg = [ os.path.join(os.path.dirname(sys.argv[0]), 'teuthology-schedule'), '--name', args.name, + '--num', str(args.num), ] if args.verbose: base_arg.append('-v') -- 2.39.5