| OLD | NEW | 
|   1 #!/usr/bin/python -u |   1 #!/usr/bin/python -u | 
|   2 # |   2 # | 
|   3 # autotest <control file> - run the autotest control file specified. |   3 # autotest <control file> - run the autotest control file specified. | 
|   4 # |   4 # | 
|   5 import os, sys |   5 import os, sys | 
|   6 import common |   6 import common | 
|   7 from optparse import OptionParser |   7 from optparse import OptionParser | 
|   8 from autotest_lib.client.bin import job |   8 from autotest_lib.client.bin import job | 
|   9 from autotest_lib.client.common_lib import global_config |   9 from autotest_lib.client.common_lib import global_config | 
|  10  |  10  | 
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  49  |  49  | 
|  50 parser.add_option('--hostname', dest='hostname', type='string', |  50 parser.add_option('--hostname', dest='hostname', type='string', | 
|  51                   default=None, action='store', |  51                   default=None, action='store', | 
|  52                   help='Take this as the hostname of this machine ' |  52                   help='Take this as the hostname of this machine ' | 
|  53                        '(given by autoserv)') |  53                        '(given by autoserv)') | 
|  54  |  54  | 
|  55 parser.add_option('--client_test_setup', dest='client_test_setup', |  55 parser.add_option('--client_test_setup', dest='client_test_setup', | 
|  56                   type='string', default=None, action='store', |  56                   type='string', default=None, action='store', | 
|  57                   help='a comma seperated list of client tests to prebuild on ' |  57                   help='a comma seperated list of client tests to prebuild on ' | 
|  58                        'the server. Use all to prebuild all of them.') |  58                        'the server. Use all to prebuild all of them.') | 
 |  59  | 
 |  60 parser.add_option('--tap', dest='tap_report', action='store_true', | 
 |  61                   default=None, help='Output TAP (Test anything ' | 
 |  62                   'protocol) reports') | 
 |  63  | 
|  59 def usage(): |  64 def usage(): | 
|  60     parser.print_help() |  65     parser.print_help() | 
|  61     sys.exit(1) |  66     sys.exit(1) | 
|  62  |  67  | 
|  63 options, args = parser.parse_args() |  68 options, args = parser.parse_args() | 
|  64  |  69  | 
|  65 # Check for a control file if not in prebuild mode. |  70 # Check for a control file if not in prebuild mode. | 
|  66 if len(args) != 1 and options.client_test_setup is None: |  71 if len(args) != 1 and options.client_test_setup is None: | 
|  67     usage() |  72     usage() | 
|  68  |  73  | 
|  69 drop_caches = global_config.global_config.get_config_value('CLIENT', |  74 drop_caches = global_config.global_config.get_config_value('CLIENT', | 
|  70                                                            'drop_caches', |  75                                                            'drop_caches', | 
|  71                                                            type=bool, |  76                                                            type=bool, | 
|  72                                                            default=True) |  77                                                            default=True) | 
|  73  |  78  | 
|  74 if options.client_test_setup: |  79 if options.client_test_setup: | 
|  75     from autotest_lib.client.bin import setup_job |  80     from autotest_lib.client.bin import setup_job | 
|  76     exit_code = 0 |  81     exit_code = 0 | 
|  77     try: |  82     try: | 
|  78         setup_job.setup_tests(options) |  83         setup_job.setup_tests(options) | 
|  79     except: |  84     except: | 
|  80         exit_code = 1 |  85         exit_code = 1 | 
|  81     sys.exit(exit_code) |  86     sys.exit(exit_code) | 
|  82  |  87  | 
|  83 # JOB: run the specified job control file. |  88 # JOB: run the specified job control file. | 
|  84 job.runjob(os.path.realpath(args[0]), drop_caches, options) |  89 job.runjob(os.path.realpath(args[0]), drop_caches, options) | 
| OLD | NEW |