From patchwork Mon May 3 22:03:16 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lucas Meneghel Rodrigues X-Patchwork-Id: 96573 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o43M3Okq021216 for ; Mon, 3 May 2010 22:03:25 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754744Ab0ECWDW (ORCPT ); Mon, 3 May 2010 18:03:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:27967 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753338Ab0ECWDV (ORCPT ); Mon, 3 May 2010 18:03:21 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o43M3KJr026881 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 3 May 2010 18:03:20 -0400 Received: from localhost.localdomain (vpn-9-239.rdu.redhat.com [10.11.9.239]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o43M3ILk030990; Mon, 3 May 2010 18:03:18 -0400 From: Lucas Meneghel Rodrigues To: autotest@test.kernel.org Cc: kvm@vger.kernel.org, jes.sorensen@redhat.com, dlaor@redhat.com, Lucas Meneghel Rodrigues Subject: [PATCH] KVM test: Add new subtest iozone_windows Date: Mon, 3 May 2010 19:03:16 -0300 Message-Id: <1272924196-10392-1-git-send-email-lmr@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Mon, 03 May 2010 22:03:27 +0000 (UTC) diff --git a/client/tests/kvm/tests/iozone_windows.py b/client/tests/kvm/tests/iozone_windows.py new file mode 100644 index 0000000..86ec2c4 --- /dev/null +++ b/client/tests/kvm/tests/iozone_windows.py @@ -0,0 +1,40 @@ +import logging, time, os +from autotest_lib.client.common_lib import error +from autotest_lib.client.bin import utils +from autotest_lib.client.tests.iozone import postprocessing +import kvm_subprocess, kvm_test_utils, kvm_utils + + +def run_iozone_windows(test, params, env): + """ + Run IOzone for windows on a windows guest: + 1) Log into a guest + 2) Execute the IOzone test contained in the winutils.iso + 3) Get results + 4) Postprocess it with the IOzone postprocessing module + + @param test: kvm test object + @param params: Dictionary with the test parameters + @param env: Dictionary with test environment. + """ + vm = kvm_test_utils.get_living_vm(env, params.get("main_vm")) + session = kvm_test_utils.wait_for_login(vm) + results_path = os.path.join(test.resultsdir, + 'raw_output_%s' % test.iteration) + analysisdir = os.path.join(test.resultsdir, 'analysis_%s' % test.iteration) + + # Run IOzone and record its results + c = command=params.get("iozone_cmd") + t = int(params.get("iozone_timeout")) + logging.info("Running IOzone command on guest, timeout %ss", t) + results = session.get_command_output(command=c, timeout=t) + utils.open_write_close(results_path, results) + + # Postprocess the results using the IOzone postprocessing module + logging.info("Iteration succeed, postprocessing") + a = postprocessing.IOzoneAnalyzer(list_files=[results_path], + output_dir=analysisdir) + a.analyze() + p = postprocessing.IOzonePlotter(results_file=results_path, + output_dir=analysisdir) + p.plot_all() diff --git a/client/tests/kvm/tests_base.cfg.sample b/client/tests/kvm/tests_base.cfg.sample index f1104ed..e21f3c8 100644 --- a/client/tests/kvm/tests_base.cfg.sample +++ b/client/tests/kvm/tests_base.cfg.sample @@ -214,6 +214,11 @@ variants: dst_rsc_dir = "C:\" autoit_entry = "C:\autoit\stub\stub.au3" + - iozone_windows: unattended_install + type = iozone_windows + iozone_cmd = "D:\IOzone\iozone.exe -a" + iozone_timeout = 3600 + - guest_s4: install setup unattended_install type = guest_s4 check_s4_support_cmd = grep -q disk /sys/power/state @@ -417,7 +422,7 @@ variants: variants: # Linux section - @Linux: - no autoit + no autoit iozone_windows shutdown_command = shutdown -h now reboot_command = shutdown -r now status_test_command = echo $?