From patchwork Wed Jan 19 18:03:21 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lucas Meneghel Rodrigues X-Patchwork-Id: 489051 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p0JEuJFe010815 for ; Wed, 19 Jan 2011 18:54:57 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753839Ab1ASSDd (ORCPT ); Wed, 19 Jan 2011 13:03:33 -0500 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 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 p0JI3U2W012675 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 19 Jan 2011 13:03:30 -0500 Received: from freedom.redhat.com (vpn-9-208.rdu.redhat.com [10.11.9.208]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p0JI3PP8008037; Wed, 19 Jan 2011 13:03:29 -0500 From: Lucas Meneghel Rodrigues To: autotest@test.kernel.org Cc: kvm@vger.kernel.org, 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> In-Reply-To: <1295460204-3093-1-git-send-email-lmr@redhat.com> References: <1295460204-3093-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.6 (demeter1.kernel.org [140.211.167.41]); Wed, 19 Jan 2011 18:55:31 +0000 (UTC) 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")