blob: d9ea9209fa50b81abd075071a79074c464f1c7ef [file] [log] [blame]
mbligh066b0eb2008-11-04 17:11:09 +00001#!/usr/bin/python
2import sys, os, textwrap
3import common
4from autotest_lib.client.common_lib import control_data
5
6if len(sys.argv) != 2:
7 print "Usage %s <control file>" % os.path.basename(sys.argv[0])
8 sys.exit(1)
9
10if not os.path.exists(sys.argv[1]):
11 print "File %s does not exist" % sys.argv[1]
12 sys.exit(1)
13
14try:
15 cd = control_data.parse_control(sys.argv[1], True)
16except Exception, e:
17 print "This control file does not adhear to the spec set forth in"
18 print "http://autotest.kernel.org/wiki/ControlRequirements"
19 print
20 print "Specific error:"
21 print '\n'.join(textwrap.wrap(str(e), initial_indent=' ',
22 subsequent_indent=' '))
23 sys.exit(1)
24
25if cd.experimental:
26 print textwrap.wrap("WARNING: This file is marked experimental. It will "
27 "not show up on the autotest frontend unless "
28 "experimental is set to False.")
29 sys.exit(0)
30
31print "Control file looks good!"