From mboxrd@z Thu Jan 1 00:00:00 1970 From: Luiz Capitulino Subject: [PATCH 1/3] QMPMonitor: Introduce the get_greeting() method Date: Thu, 7 Oct 2010 16:52:05 -0300 Message-ID: <1286481127-24640-2-git-send-email-lcapitulino@redhat.com> References: <1286481127-24640-1-git-send-email-lcapitulino@redhat.com> Cc: kvm@vger.kernel.org, lmr@redhat.com, ehabkost@redhat.com, armbru@redhat.com To: autotest@test.kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:28633 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754976Ab0JGTwT (ORCPT ); Thu, 7 Oct 2010 15:52:19 -0400 In-Reply-To: <1286481127-24640-1-git-send-email-lcapitulino@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: It returns the QMP's greeting message as sent by the monitor. Please, note that this commit also changes the QMPMonitor's constructor to store the full greeting message (it currently stores only its contents). This new method is going to be used by the QMP test-suite, which fully checks the greeting message. Signed-off-by: Luiz Capitulino --- client/tests/kvm/kvm_monitor.py | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/client/tests/kvm/kvm_monitor.py b/client/tests/kvm/kvm_monitor.py index 8440835..c23835c 100644 --- a/client/tests/kvm/kvm_monitor.py +++ b/client/tests/kvm/kvm_monitor.py @@ -408,7 +408,7 @@ class QMPMonitor(Monitor): while time.time() < end_time: for obj in self._read_objects(): if "QMP" in obj: - self._greeting = obj["QMP"] + self._greeting = obj break if self._greeting: break @@ -597,6 +597,13 @@ class QMPMonitor(Monitor): self._lock.release() + def get_greeting(self): + """ + Return QMP greeting message. + """ + return self._greeting + + # Command wrappers # Note: all of the following functions raise exceptions in a similar manner # to cmd() and _get_command_output(). -- 1.7.3.1.104.gc752e