From patchwork Sun Jun 13 14:33:45 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Goldish X-Patchwork-Id: 105819 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 o5DEYRrB026976 for ; Sun, 13 Jun 2010 14:34:33 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753921Ab0FMOe1 (ORCPT ); Sun, 13 Jun 2010 10:34:27 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60211 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753906Ab0FMOe0 (ORCPT ); Sun, 13 Jun 2010 10:34:26 -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 o5DEYPtW013085 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 13 Jun 2010 10:34:25 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o5DEYPJS029179; Sun, 13 Jun 2010 10:34:25 -0400 Received: from localhost.localdomain (dhcp-1-188.tlv.redhat.com [10.35.1.188]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id o5DEY6v9030030; Sun, 13 Jun 2010 10:34:24 -0400 From: Michael Goldish To: autotest@test.kernel.org, kvm@vger.kernel.org Cc: Michael Goldish Subject: [KVM-AUTOTEST PATCH 14/14] KVM test: migration: support QMP Date: Sun, 13 Jun 2010 17:33:45 +0300 Message-Id: <1276439625-32472-14-git-send-email-mgoldish@redhat.com> In-Reply-To: <1276439625-32472-13-git-send-email-mgoldish@redhat.com> References: <1276439625-32472-1-git-send-email-mgoldish@redhat.com> <1276439625-32472-2-git-send-email-mgoldish@redhat.com> <1276439625-32472-3-git-send-email-mgoldish@redhat.com> <1276439625-32472-4-git-send-email-mgoldish@redhat.com> <1276439625-32472-5-git-send-email-mgoldish@redhat.com> <1276439625-32472-6-git-send-email-mgoldish@redhat.com> <1276439625-32472-7-git-send-email-mgoldish@redhat.com> <1276439625-32472-8-git-send-email-mgoldish@redhat.com> <1276439625-32472-9-git-send-email-mgoldish@redhat.com> <1276439625-32472-10-git-send-email-mgoldish@redhat.com> <1276439625-32472-11-git-send-email-mgoldish@redhat.com> <1276439625-32472-12-git-send-email-mgoldish@redhat.com> <1276439625-32472-13-git-send-email-mgoldish@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]); Sun, 13 Jun 2010 14:34:33 +0000 (UTC) diff --git a/client/tests/kvm/kvm_test_utils.py b/client/tests/kvm/kvm_test_utils.py index c3b6b8a..9fdea87 100644 --- a/client/tests/kvm/kvm_test_utils.py +++ b/client/tests/kvm/kvm_test_utils.py @@ -120,15 +120,24 @@ def migrate(vm, env=None): # Helper functions def mig_finished(): o = vm.monitor.info("migrate") - return "status: active" not in o + if isinstance(o, str): + return "status: active" not in o + else: + return o.get("status") != "active" def mig_succeeded(): o = vm.monitor.info("migrate") - return "status: completed" in o + if isinstance(o, str): + return "status: completed" in o + else: + return o.get("status") == "completed" def mig_failed(): o = vm.monitor.info("migrate") - return "status: failed" in o + if isinstance(o, str): + return "status: failed" in o + else: + return o.get("status") == "failed" # Clone the source VM and ask the clone to wait for incoming migration dest_vm = vm.clone()