From patchwork Mon Jan 3 18:34:10 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Goldish X-Patchwork-Id: 448921 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 p03IXixu027593 for ; Mon, 3 Jan 2011 18:33:46 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754856Ab1ACSdn (ORCPT ); Mon, 3 Jan 2011 13:33:43 -0500 Received: from mx1.redhat.com ([209.132.183.28]:29777 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754742Ab1ACSdm (ORCPT ); Mon, 3 Jan 2011 13:33:42 -0500 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id p03IXfOA026461 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 3 Jan 2011 13:33:41 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p03IXf6d025364; Mon, 3 Jan 2011 13:33:41 -0500 Received: from moof.tlv.redhat.com (dhcp-1-185.tlv.redhat.com [10.35.1.185]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id p03IXWw0027804; Mon, 3 Jan 2011 13:33:39 -0500 From: Michael Goldish To: autotest@test.kernel.org, kvm@vger.kernel.org Cc: Michael Goldish Subject: [KVM-AUTOTEST PATCH 6/7] [RFC] KVM test: use error.context() in migration_with_file_transfer Date: Mon, 3 Jan 2011 20:34:10 +0200 Message-Id: <1294079651-21631-6-git-send-email-mgoldish@redhat.com> In-Reply-To: <1294079651-21631-1-git-send-email-mgoldish@redhat.com> References: <1294079651-21631-1-git-send-email-mgoldish@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 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 (demeter1.kernel.org [140.211.167.41]); Mon, 03 Jan 2011 18:33:46 +0000 (UTC) diff --git a/client/tests/kvm/tests/migration_with_file_transfer.py b/client/tests/kvm/tests/migration_with_file_transfer.py index 27c1fe1..d0159c5 100644 --- a/client/tests/kvm/tests/migration_with_file_transfer.py +++ b/client/tests/kvm/tests/migration_with_file_transfer.py @@ -47,24 +47,26 @@ def run_migration_with_file_transfer(test, params, env): finally: bg.join() - logging.info("Transferring file from host to guest") + error.context("transferring file to guest while migrating") bg = kvm_utils.Thread(vm.copy_files_to, (host_path, guest_path, 0, transfer_timeout)) run_and_migrate(bg) - logging.info("Transferring file back from guest to host") + error.context("transferring file back to host while migrating") bg = kvm_utils.Thread(vm.copy_files_from, (guest_path, host_path_returned, 0, transfer_timeout)) run_and_migrate(bg) - # Make sure the returned file is indentical to the original one + # Make sure the returned file is identical to the original one + error.context("comparing hashes") orig_hash = client_utils.hash_file(host_path) returned_hash = client_utils.hash_file(host_path_returned) if orig_hash != returned_hash: raise error.TestFail("Returned file hash (%s) differs from " "original one (%s)" % (returned_hash, orig_hash)) + error.context("cleanup") finally: session.close() if os.path.isfile(host_path):