mbligh | 066b0eb | 2008-11-04 17:11:09 +0000 | [diff] [blame] | 1 | #!/usr/bin/python |
| 2 | import sys, os, textwrap |
| 3 | import common |
| 4 | from autotest_lib.client.common_lib import control_data |
| 5 | |
| 6 | if len(sys.argv) != 2: |
| 7 | print "Usage %s <control file>" % os.path.basename(sys.argv[0]) |
| 8 | sys.exit(1) |
| 9 | |
| 10 | if not os.path.exists(sys.argv[1]): |
| 11 | print "File %s does not exist" % sys.argv[1] |
| 12 | sys.exit(1) |
| 13 | |
| 14 | try: |
| 15 | cd = control_data.parse_control(sys.argv[1], True) |
| 16 | except 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 | |
| 25 | if 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 | |
| 31 | print "Control file looks good!" |