From: Lucas Meneghel Rodrigues Subject: [PATCH 2/5] KVM test: Modify enospc test to not require scripts/check_image.py v2 Date: Wed, 19 Jan 2011 16:03:21 -0200 Message-ID: <1295460204-3093-3-git-send-email-lmr@redhat.com> References: <1295460204-3093-1-git-send-email-lmr@redhat.com> Cc: kvm@vger.kernel.org, Lucas Meneghel Rodrigues To: autotest@test.kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:41655 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753464Ab1ASSDb (ORCPT ); Wed, 19 Jan 2011 13:03:31 -0500 In-Reply-To: <1295460204-3093-1-git-send-email-lmr@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: With this we prepare to remove the aforementioned script. Changes from v1: * Accounting for the lost of the check_image_critical logic, now just trap kvm_vm.VMError() exceptions and log them as an error if they happen. Signed-off-by: Lucas Meneghel Rodrigues --- client/tests/kvm/tests/enospc.py | 13 +++++++------ 1 files changed, 7 insertions(+), 6 deletions(-) diff --git a/client/tests/kvm/tests/enospc.py b/client/tests/kvm/tests/enospc.py index 2d8b628..6a149f9 100644 --- a/client/tests/kvm/tests/enospc.py +++ b/client/tests/kvm/tests/enospc.py @@ -1,7 +1,7 @@ import logging, commands, time, os, re from autotest_lib.client.common_lib import error from autotest_lib.client.bin import utils -import kvm_test_utils +import kvm_test_utils, kvm_vm def run_enospc(test, params, env): @@ -46,11 +46,12 @@ def run_enospc(test, params, env): if "paused" in status: pause_n += 1 logging.info("Checking all images in use by the VM") - script_path = os.path.join(test.bindir, "scripts/check_image.py") - try: - cmd_result = utils.run('python %s' % script_path) - except error.CmdError, e: - logging.debug(e.result_obj.stdout) + for image_name in vm.params.objects("images"): + image_params = vm.params.object_params(image_name) + try: + kvm_vm.check_image(image_params, test.bindir) + except kvm_vm.VMError, e: + logging.error(e) logging.info("Guest paused, extending Logical Volume size") try: cmd_result = utils.run("lvextend -L +200M /dev/vgtest/lvtest") -- 1.7.3.4