blob: f2ee60c73d966c6676304fa17d4d2f02061c0b7f [file] [log] [blame]
mbligh849c75f2007-09-27 17:06:55 +00001import getopt
2
3test = None
4logdir = None
5
6
7def usage():
mbligh95fca572007-09-27 17:11:00 +00008 print "usage: -t <test name> -m <machines> -l <log dir>"
mbligh849c75f2007-09-27 17:06:55 +00009
10def run(client):
mbligh95fca572007-09-27 17:11:00 +000011 m = hosts.SSHHost(client)
12 at = autotest.Autotest()
mbligh849c75f2007-09-27 17:06:55 +000013
mbligh95fca572007-09-27 17:11:00 +000014 results_dir = os.path.join(logdir, client)
15 at.run_test(test, results_dir, m)
mbligh849c75f2007-09-27 17:06:55 +000016
17
18def main():
mbligh95fca572007-09-27 17:11:00 +000019 global test, logdir, args
mbligh849c75f2007-09-27 17:06:55 +000020
mbligh95fca572007-09-27 17:11:00 +000021 try:
22 opts, args = getopt.getopt(args, 't:l:', [])
23 except getopt.GetoptError, e:
24 usage()
25 print e
26 sys.exit(1)
mbligh849c75f2007-09-27 17:06:55 +000027
mbligh95fca572007-09-27 17:11:00 +000028 for flag, value in opts:
29 if flag == '-t':
30 test = value
mbligh849c75f2007-09-27 17:06:55 +000031 elif flag == '-l':
mbligh95fca572007-09-27 17:11:00 +000032 logdir = value
33
34 if test == None or logdir == None:
mbligh849c75f2007-09-27 17:06:55 +000035 usage()
36 sys.exit(1)
37
mbligh95fca572007-09-27 17:11:00 +000038 print "Going to launch %s on %r with log dir of %s." % (test, machines, logdir)
39 parallel_simple(run, machines)
mbligh849c75f2007-09-27 17:06:55 +000040
41
42main()