From: 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> References: <1293465715-16599-1-git-send-email-mgoldish@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: autotest@test.kernel.org, kvm@vger.kernel.org Return-path: In-Reply-To: <1293465715-16599-1-git-send-email-mgoldish@redhat.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: autotest-bounces@test.kernel.org Errors-To: autotest-bounces@test.kernel.org List-Id: kvm.vger.kernel.org kvm_utils.Thread is used instead. Signed-off-by: Michael Goldish --- client/tests/kvm/kvm_test_utils.py | 47 ------------------------------------ 1 files changed, 0 insertions(+), 47 deletions(-) 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 -- 1.7.3.3