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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 | 167 #only fc8_quick |
168 #display = sdl | 168 #display = sdl |
169 """ | 169 """ |
170 cfg = kvm_config.config() | 170 cfg = kvm_config.config() |
171 filename = os.path.join(pwd, "tests.cfg") | 171 filename = os.path.join(pwd, "tests.cfg") |
172 cfg.fork_and_parse(filename, str) | 172 cfg.fork_and_parse(filename, str) |
173 | 173 |
174 filename = os.path.join(pwd, "address_pools.cfg") | |
175 if os.path.exists(filename): | |
176 cfg.parse_file(filename) | |
177 hostname = os.uname()[1].split(".")[0] | |
178 if cfg.count("^" + hostname): | |
179 cfg.parse_string("only ^%s" % hostname) | |
180 else: | |
181 cfg.parse_string("only ^default_host") | |
182 | |
183 tests = cfg.get_list() | 174 tests = cfg.get_list() |
184 | 175 |
185 | 176 |
186 # ------------- | 177 # ------------- |
187 # Run the tests | 178 # Run the tests |
188 # ------------- | 179 # ------------- |
189 import kvm_scheduler | 180 import kvm_scheduler |
190 from autotest_lib.client.bin import utils | 181 from autotest_lib.client.bin import utils |
191 | 182 |
192 # total_cpus defaults to the number of CPUs reported by /proc/cpuinfo | 183 # total_cpus defaults to the number of CPUs reported by /proc/cpuinfo |
193 total_cpus = utils.count_cpus() | 184 total_cpus = utils.count_cpus() |
194 # total_mem defaults to 3/4 of the total memory reported by 'free' | 185 # total_mem defaults to 3/4 of the total memory reported by 'free' |
195 total_mem = int(commands.getoutput("free -m").splitlines()[1].split()[1]) * 3/4 | 186 total_mem = int(commands.getoutput("free -m").splitlines()[1].split()[1]) * 3/4 |
196 # We probably won't need more workers than CPUs | 187 # We probably won't need more workers than CPUs |
197 num_workers = total_cpus | 188 num_workers = total_cpus |
198 | 189 |
199 # Start the scheduler and workers | 190 # Start the scheduler and workers |
200 s = kvm_scheduler.scheduler(tests, num_workers, total_cpus, total_mem, pwd) | 191 s = kvm_scheduler.scheduler(tests, num_workers, total_cpus, total_mem, pwd) |
201 job.parallel([s.scheduler], | 192 job.parallel([s.scheduler], |
202 *[(s.worker, i, job.run_test) for i in range(num_workers)]) | 193 *[(s.worker, i, job.run_test) for i in range(num_workers)]) |
203 | 194 |
204 | 195 |
205 # create the html report in result dir | 196 # create the html report in result dir |
206 reporter = os.path.join(pwd, 'make_html_report.py') | 197 reporter = os.path.join(pwd, 'make_html_report.py') |
207 html_file = os.path.join(job.resultdir,'results.html') | 198 html_file = os.path.join(job.resultdir,'results.html') |
208 os.system('%s -r %s -f %s -R'%(reporter, job.resultdir, html_file)) | 199 os.system('%s -r %s -f %s -R'%(reporter, job.resultdir, html_file)) |
OLD | NEW |