KVM test: Modify kvm_utils.run_tests to include non fatal failures
[autotest-zwu.git] / utils / check_control_file_vars.py
blobd9ea9209fa50b81abd075071a79074c464f1c7ef
1 #!/usr/bin/python
2 import sys, os, textwrap
3 import common
4 from autotest_lib.client.common_lib import control_data
6 if len(sys.argv) != 2:
7 print "Usage %s <control file>" % os.path.basename(sys.argv[0])
8 sys.exit(1)
10 if not os.path.exists(sys.argv[1]):
11 print "File %s does not exist" % sys.argv[1]
12 sys.exit(1)
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)
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)
31 print "Control file looks good!"