From patchwork Fri Nov 26 09:58:20 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?THVrw6HFoSBEb2t0b3I=?= X-Patchwork-Id: 358112 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 oAQ9wZ1N012608 for ; Fri, 26 Nov 2010 09:58:36 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754220Ab0KZJ6a (ORCPT ); Fri, 26 Nov 2010 04:58:30 -0500 Received: from mx1.redhat.com ([209.132.183.28]:20359 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754195Ab0KZJ6a (ORCPT ); Fri, 26 Nov 2010 04:58:30 -0500 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id oAQ9wTJN029672 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 26 Nov 2010 04:58:29 -0500 Received: from dhcp-27-189.brq.redhat.com (dhcp-27-189.brq.redhat.com [10.34.27.189]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id oAQ9wNir015042; Fri, 26 Nov 2010 04:58:27 -0500 From: Lukas Doktor To: autotest@test.kernel.org, kvm@vger.kernel.org, kvm-autotest@redhat.com, akong@redhat.com, lmr@redhat.com, ldoktor@redhat.com, jzupka@redhat.com Subject: [PATCH] Add support for python2.4 virtio_console. Date: Fri, 26 Nov 2010 10:58:20 +0100 Message-Id: <1290765500-5106-2-git-send-email-ldoktor@redhat.com> In-Reply-To: <1290765500-5106-1-git-send-email-ldoktor@redhat.com> References: <1290765500-5106-1-git-send-email-ldoktor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 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]); Fri, 26 Nov 2010 09:58:36 +0000 (UTC) diff --git a/client/tests/kvm/tests/virtio_console.py b/client/tests/kvm/tests/virtio_console.py index d69c0a5..3edd051 100644 --- a/client/tests/kvm/tests/virtio_console.py +++ b/client/tests/kvm/tests/virtio_console.py @@ -102,7 +102,9 @@ def run_virtio_console(test, params, env): """ @return: If any of subtest not pass return True. """ - return True if self.failed > 0 else False + if self.failed > 0: + return True + return False def get_result(self): """ @@ -121,16 +123,20 @@ def run_virtio_console(test, params, env): for arg in result[2]: sargs += str(arg) + "," sargs = sargs[:-1] - return ("Subtest (%s(%s)): -->%s") % (result[1], sargs, - "PASS"if result[0] else "FAIL") + res = "FAIL" + if result[0]: + res = "PASS" + return ("Subtest (%s(%s)): -->%s") % (result[1], sargs,res) def result_to_string(self, result): """ @param result: Result of test. """ - return ("Subtest (%s): -->%s") % (result[1], "PASS"if result[0] - else "FAIL") + res = "FAIL" + if result[0]: + res = "PASS" + return ("Subtest (%s): -->%s") % (result[1], res) def get_full_text_result(self):