1import getopt 2 3test = None 4logdir = None 5 6 7def usage(): 8 print "usage: -t <test name> -m <machines> -l <log dir>" 9 10def run(client): 11 m = hosts.create_host(client) 12 at = autotest.Autotest() 13 14 results_dir = os.path.join(logdir, client) 15 at.run_test(test, results_dir, m) 16 17 18def main(): 19 global test, logdir, args 20 21 try: 22 opts, args = getopt.getopt(args, 't:l:', []) 23 except getopt.GetoptError, e: 24 usage() 25 print e 26 sys.exit(1) 27 28 for flag, value in opts: 29 if flag == '-t': 30 test = value 31 elif flag == '-l': 32 logdir = value 33 34 if test is None or logdir is None: 35 usage() 36 sys.exit(1) 37 38 print "Going to launch %s on %r with log dir of %s." % (test, machines, logdir) 39 parallel_simple(run, machines) 40 41 42main() 43