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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 # links to point to the newly built executables. | 151 # links to point to the newly built executables. |
152 | 152 |
153 if not params.get("mode") == "noinstall": | 153 if not params.get("mode") == "noinstall": |
154 if not job.run_test("kvm", params=params, tag=params.get("shortname")): | 154 if not job.run_test("kvm", params=params, tag=params.get("shortname")): |
155 print 'kvm_installation failed ... exiting' | 155 print 'kvm_installation failed ... exiting' |
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 from autotest_lib.client.common_lib import cartesian_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 #display = sdl | 167 #display = sdl |
168 """ | 168 """ |
169 | 169 |
170 parser = kvm_config.Parser() | 170 parser = cartesian_config.Parser() |
171 parser.parse_file(os.path.join(pwd, "tests.cfg")) | 171 parser.parse_file(os.path.join(pwd, "tests.cfg")) |
172 parser.parse_string(str) | 172 parser.parse_string(str) |
173 | 173 |
174 tests = list(parser.get_dicts()) | 174 tests = list(parser.get_dicts()) |
175 | 175 |
176 # ------------- | 176 # ------------- |
177 # Run the tests | 177 # Run the tests |
178 # ------------- | 178 # ------------- |
179 import kvm_scheduler | 179 from autotest_lib.client.virt import virt_scheduler |
180 from autotest_lib.client.bin import utils | 180 from autotest_lib.client.bin import utils |
181 | 181 |
182 # 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 |
183 total_cpus = utils.count_cpus() | 183 total_cpus = utils.count_cpus() |
184 # 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' |
185 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 |
186 # We probably won't need more workers than CPUs | 186 # We probably won't need more workers than CPUs |
187 num_workers = total_cpus | 187 num_workers = total_cpus |
188 | 188 |
189 # Start the scheduler and workers | 189 # Start the scheduler and workers |
190 s = kvm_scheduler.scheduler(tests, num_workers, total_cpus, total_mem, pwd) | 190 s = virt_scheduler.scheduler(tests, num_workers, total_cpus, total_mem, pwd) |
191 job.parallel([s.scheduler], | 191 job.parallel([s.scheduler], |
192 *[(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)]) |
193 | 193 |
194 # create the html report in result dir | 194 # create the html report in result dir |
195 reporter = os.path.join(pwd, 'make_html_report.py') | 195 reporter = os.path.join(pwd, 'make_html_report.py') |
196 html_file = os.path.join(job.resultdir,'results.html') | 196 html_file = os.path.join(job.resultdir,'results.html') |
197 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 |