blob: 42f623877066463183915fad0af53f80691e1fe0 [file] [log] [blame]
mbligh7c8ea992009-06-22 19:03:08 +00001#!/usr/bin/python
mbligh279346a2007-07-27 01:04:27 +00002import sys,os
mblighfeb25f12007-07-24 19:01:05 +00003
mbligh8d83cdc2007-12-03 18:09:18 +00004autodir = None
5try:
jadmanski0afbb632008-06-06 21:10:57 +00006 autodir = os.path.dirname(os.path.realpath('/etc/autotest.conf'))
mbligh8d83cdc2007-12-03 18:09:18 +00007except:
jadmanski0afbb632008-06-06 21:10:57 +00008 pass
mbligh8d83cdc2007-12-03 18:09:18 +00009if not autodir:
jadmanski0afbb632008-06-06 21:10:57 +000010 for path in ['/usr/local/autotest', '/home/autotest']:
11 if os.path.exists(os.path.join(path, '/bin/autotest')):
12 autodir = path
mbligh8d83cdc2007-12-03 18:09:18 +000013
mblighfeb25f12007-07-24 19:01:05 +000014autotest = os.path.join(autodir, 'bin/autotest')
15control = os.path.join(autodir, 'control')
mbligh8d83cdc2007-12-03 18:09:18 +000016state = os.path.join(autodir, 'control.state')
mblighfeb25f12007-07-24 19:01:05 +000017
mbligh8d83cdc2007-12-03 18:09:18 +000018if len(sys.argv) == 1 or sys.argv[1] == 'start':
jadmanski0afbb632008-06-06 21:10:57 +000019 if os.path.exists(state):
20 print "Restarting partially completed autotest job"
21 os.system(autotest + ' --continue ' + control)
22 else:
23 print "No autotest jobs outstanding"