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