KVM test: tests_base.cfg: Introduce parameter 'vm_type'
[autotest-zwu.git] / server / samples / run_test.srv
bloba3255f56533ac9a0a56512e29516a21b77e044a0
1 import getopt
3 test = None
4 logdir = None
7 def usage():
8     print "usage: -t <test name> -m <machines> -l <log dir>"
10 def run(client):
11     m = hosts.create_host(client)
12     at = autotest.Autotest()
14     results_dir = os.path.join(logdir, client)
15     at.run_test(test, results_dir, m)
18 def main():
19     global test, logdir, args
21     try:
22         opts, args = getopt.getopt(args, 't:l:', [])
23     except getopt.GetoptError, e:
24         usage()
25         print e
26         sys.exit(1)
28     for flag, value in opts:
29         if flag == '-t':
30             test = value
31         elif flag == '-l':
32             logdir = value
34     if test is None or logdir is None:
35         usage()
36         sys.exit(1)
38     print "Going to launch %s on %r with log dir of %s." % (test, machines, logdir)
39     parallel_simple(run, machines)
42 main()