OLD | NEW |
1 import logging, time, os | 1 import logging, time, os |
2 from autotest_lib.client.common_lib import error | 2 from autotest_lib.client.common_lib import error |
3 from autotest_lib.client.bin import utils | 3 from autotest_lib.client.bin import utils |
4 from autotest_lib.client.tests.iozone import postprocessing | 4 from autotest_lib.client.tests.iozone import postprocessing |
5 import kvm_subprocess, kvm_test_utils, kvm_utils | 5 import kvm_subprocess, kvm_test_utils, kvm_utils |
6 | 6 |
7 | 7 |
8 def run_iozone_windows(test, params, env): | 8 def run_iozone_windows(test, params, env): |
9 """ | 9 """ |
10 Run IOzone for windows on a windows guest: | 10 Run IOzone for windows on a windows guest: |
(...skipping 10 matching lines...) Expand all Loading... |
21 timeout = int(params.get("login_timeout", 360)) | 21 timeout = int(params.get("login_timeout", 360)) |
22 session = kvm_test_utils.wait_for_login(vm, timeout=timeout) | 22 session = kvm_test_utils.wait_for_login(vm, timeout=timeout) |
23 results_path = os.path.join(test.resultsdir, | 23 results_path = os.path.join(test.resultsdir, |
24 'raw_output_%s' % test.iteration) | 24 'raw_output_%s' % test.iteration) |
25 analysisdir = os.path.join(test.resultsdir, 'analysis_%s' % test.iteration) | 25 analysisdir = os.path.join(test.resultsdir, 'analysis_%s' % test.iteration) |
26 | 26 |
27 # Run IOzone and record its results | 27 # Run IOzone and record its results |
28 c = params.get("iozone_cmd") | 28 c = params.get("iozone_cmd") |
29 t = int(params.get("iozone_timeout")) | 29 t = int(params.get("iozone_timeout")) |
30 logging.info("Running IOzone command on guest, timeout %ss", t) | 30 logging.info("Running IOzone command on guest, timeout %ss", t) |
31 results = session.cmd_output(command=c, timeout=t, | 31 results = session.get_command_output(command=c, timeout=t, |
32 print_func=logging.debug) | 32 print_func=logging.debug) |
33 utils.open_write_close(results_path, results) | 33 utils.open_write_close(results_path, results) |
34 | 34 |
35 # Postprocess the results using the IOzone postprocessing module | 35 # Postprocess the results using the IOzone postprocessing module |
36 logging.info("Iteration succeed, postprocessing") | 36 logging.info("Iteration succeed, postprocessing") |
37 a = postprocessing.IOzoneAnalyzer(list_files=[results_path], | 37 a = postprocessing.IOzoneAnalyzer(list_files=[results_path], |
38 output_dir=analysisdir) | 38 output_dir=analysisdir) |
39 a.analyze() | 39 a.analyze() |
40 p = postprocessing.IOzonePlotter(results_file=results_path, | 40 p = postprocessing.IOzonePlotter(results_file=results_path, |
41 output_dir=analysisdir) | 41 output_dir=analysisdir) |
42 p.plot_all() | 42 p.plot_all() |
OLD | NEW |