From patchwork Mon Dec 27 16:01:36 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Goldish X-Patchwork-Id: 434371 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 oBRKCV9Y025997 for ; Mon, 27 Dec 2010 20:16:54 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754357Ab0L0QCV (ORCPT ); Mon, 27 Dec 2010 11:02:21 -0500 Received: from mx1.redhat.com ([209.132.183.28]:40883 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754350Ab0L0QCR (ORCPT ); Mon, 27 Dec 2010 11:02:17 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id oBRG2Gt2023423 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 27 Dec 2010 11:02:16 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id oBRG2GUr032104; Mon, 27 Dec 2010 11:02:16 -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 oBRG1rFv017175; Mon, 27 Dec 2010 11:02:15 -0500 From: Michael Goldish To: autotest@test.kernel.org, kvm@vger.kernel.org Cc: Michael Goldish Subject: [KVM-AUTOTEST PATCH 09/28] KVM test: remove kvm_test_utils.BackgroundTest Date: Mon, 27 Dec 2010 18:01:36 +0200 Message-Id: <1293465715-16599-9-git-send-email-mgoldish@redhat.com> In-Reply-To: <1293465715-16599-1-git-send-email-mgoldish@redhat.com> References: <1293465715-16599-1-git-send-email-mgoldish@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 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, 27 Dec 2010 20:16:54 +0000 (UTC) diff --git a/client/tests/kvm/kvm_test_utils.py b/client/tests/kvm/kvm_test_utils.py index 2a3a062..6569d3b 100644 --- a/client/tests/kvm/kvm_test_utils.py +++ b/client/tests/kvm/kvm_test_utils.py @@ -593,53 +593,6 @@ def run_autotest(vm, session, control_path, timeout, outputdir): raise error.TestFail(e_msg) -class BackgroundTest(object): - """ - This class would run a test in background through a dedicated thread. - """ - - def __init__(self, func, params): - """ - Initialize the object and set a few attributes. - """ - self.thread = threading.Thread(target=self.launch, - args=(func, params)) - self.exception = None - - - def launch(self, func, params): - """ - Catch and record the exception. - """ - try: - func(*params) - except Exception, e: - self.exception = e - - - def start(self): - """ - Run func(params) in a dedicated thread - """ - self.thread.start() - - - def join(self): - """ - Wait for the join of thread and raise its exception if any. - """ - self.thread.join() - if self.exception: - raise self.exception - - - def is_alive(self): - """ - Check whether the test is still alive. - """ - return self.thread.isAlive() - - def get_loss_ratio(output): """ Get the packet loss ratio from the output of ping