| OLD | NEW | 
|---|
| 1 AUTHOR = """ | 1 AUTHOR = """ | 
| 2 uril@redhat.com (Uri Lublin) | 2 uril@redhat.com (Uri Lublin) | 
| 3 drusso@redhat.com (Dror Russo) | 3 drusso@redhat.com (Dror Russo) | 
| 4 mgoldish@redhat.com (Michael Goldish) | 4 mgoldish@redhat.com (Michael Goldish) | 
| 5 dhuff@redhat.com (David Huff) | 5 dhuff@redhat.com (David Huff) | 
| 6 aeromenk@redhat.com (Alexey Eromenko) | 6 aeromenk@redhat.com (Alexey Eromenko) | 
| 7 mburns@redhat.com (Mike Burns) | 7 mburns@redhat.com (Mike Burns) | 
| 8 """ | 8 """ | 
| 9 TIME = 'SHORT' | 9 TIME = 'SHORT' | 
| 10 NAME = 'KVM test' | 10 NAME = 'KVM test' | 
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 156         sys.exit(1) | 156         sys.exit(1) | 
| 157 | 157 | 
| 158 # ---------------------------------------------------------- | 158 # ---------------------------------------------------------- | 
| 159 # Get test set (dictionary list) from the configuration file | 159 # Get test set (dictionary list) from the configuration file | 
| 160 # ---------------------------------------------------------- | 160 # ---------------------------------------------------------- | 
| 161 import kvm_config | 161 import kvm_config | 
| 162 | 162 | 
| 163 str = """ | 163 str = """ | 
| 164 # This string will be parsed after tests.cfg.  Make any desired changes to the | 164 # This string will be parsed after tests.cfg.  Make any desired changes to the | 
| 165 # test configuration here.  For example: | 165 # test configuration here.  For example: | 
| 166 #install|setup: timeout_multiplier = 3 | 166 #install, setup: timeout_multiplier = 3 | 
| 167 #only fc8_quick |  | 
| 168 #display = sdl | 167 #display = sdl | 
| 169 """ | 168 """ | 
| 170 cfg = kvm_config.config() |  | 
| 171 filename = os.path.join(pwd, "tests.cfg") |  | 
| 172 cfg.fork_and_parse(filename, str) |  | 
| 173 | 169 | 
| 174 tests = cfg.get_list() | 170 parser = kvm_config.Parser() | 
|  | 171 parser.parse_file(os.path.join(pwd, "tests.cfg")) | 
|  | 172 parser.parse_string(str) | 
| 175 | 173 | 
|  | 174 tests = list(parser.get_dicts()) | 
| 176 | 175 | 
| 177 # ------------- | 176 # ------------- | 
| 178 # Run the tests | 177 # Run the tests | 
| 179 # ------------- | 178 # ------------- | 
| 180 import kvm_scheduler | 179 import kvm_scheduler | 
| 181 from autotest_lib.client.bin import utils | 180 from autotest_lib.client.bin import utils | 
| 182 | 181 | 
| 183 # total_cpus defaults to the number of CPUs reported by /proc/cpuinfo | 182 # total_cpus defaults to the number of CPUs reported by /proc/cpuinfo | 
| 184 total_cpus = utils.count_cpus() | 183 total_cpus = utils.count_cpus() | 
| 185 # total_mem defaults to 3/4 of the total memory reported by 'free' | 184 # total_mem defaults to 3/4 of the total memory reported by 'free' | 
| 186 total_mem = int(commands.getoutput("free -m").splitlines()[1].split()[1]) * 3/4 | 185 total_mem = int(commands.getoutput("free -m").splitlines()[1].split()[1]) * 3/4 | 
| 187 # We probably won't need more workers than CPUs | 186 # We probably won't need more workers than CPUs | 
| 188 num_workers = total_cpus | 187 num_workers = total_cpus | 
| 189 | 188 | 
| 190 # Start the scheduler and workers | 189 # Start the scheduler and workers | 
| 191 s = kvm_scheduler.scheduler(tests, num_workers, total_cpus, total_mem, pwd) | 190 s = kvm_scheduler.scheduler(tests, num_workers, total_cpus, total_mem, pwd) | 
| 192 job.parallel([s.scheduler], | 191 job.parallel([s.scheduler], | 
| 193              *[(s.worker, i, job.run_test) for i in range(num_workers)]) | 192              *[(s.worker, i, job.run_test) for i in range(num_workers)]) | 
| 194 | 193 | 
| 195 |  | 
| 196 # create the html report in result dir | 194 # create the html report in result dir | 
| 197 reporter = os.path.join(pwd, 'make_html_report.py') | 195 reporter = os.path.join(pwd, 'make_html_report.py') | 
| 198 html_file = os.path.join(job.resultdir,'results.html') | 196 html_file = os.path.join(job.resultdir,'results.html') | 
| 199 os.system('%s -r %s -f %s -R'%(reporter, job.resultdir, html_file)) | 197 os.system('%s -r %s -f %s -R'%(reporter, job.resultdir, html_file)) | 
| OLD | NEW | 
|---|