OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 import sys,os | 2 import sys,os |
3 | 3 |
4 autodir = None | 4 autodir = None |
5 autotest_conf = os.path.realpath('/etc/autotest.conf') | 5 autotest_conf = os.path.realpath('/etc/autotest.conf') |
6 | 6 |
7 if os.path.isfile(autotest_conf): | 7 if os.path.isfile(autotest_conf): |
8 autodir = os.path.dirname(autotest_conf) | 8 autodir = os.path.dirname(autotest_conf) |
9 | |
10 if not autodir: | 9 if not autodir: |
11 for path in ['/usr/local/autotest', '/home/autotest']: | 10 for path in ['/usr/local/autotest', '/home/autotest']: |
12 if os.path.exists(os.path.join(path, 'bin/autotest')): | 11 if os.path.exists(os.path.join(path, 'bin/autotest')): |
13 autodir = path | 12 autodir = path |
14 | 13 |
15 if not autodir: | 14 if not autodir: |
16 print "Autotest home dir NOT FOUND" | 15 print "Autotest home dir NOT FOUND" |
17 sys.exit() | 16 sys.exit() |
18 | 17 |
19 autotest = os.path.join(autodir, 'bin/autotest') | 18 autotest = os.path.join(autodir, 'bin/autotest') |
20 control = os.path.join(autodir, 'control') | 19 control = os.path.join(autodir, 'control') |
21 state = os.path.join(autodir, 'control.state') | 20 state = os.path.join(autodir, 'control.state') |
22 | 21 |
23 if len(sys.argv) == 1 or sys.argv[1] == 'start': | 22 if len(sys.argv) == 1 or sys.argv[1] == 'start': |
24 if os.path.exists(state): | 23 if os.path.exists(state): |
25 print "Restarting partially completed autotest job" | 24 print "Restarting partially completed autotest job" |
26 os.system(autotest + ' --continue ' + control) | 25 os.system(autotest + ' --continue ' + control) |
27 else: | 26 else: |
28 print "No autotest jobs outstanding" | 27 print "No autotest jobs outstanding" |
OLD | NEW |