From: Michael Goldish Subject: [KVM-AUTOTEST PATCH 3/3] KVM test: kvm_subprocess.py: automatically close unreferenced shell sessions Date: Tue, 13 Oct 2009 13:48:36 +0200 Message-ID: <1255434516-22142-3-git-send-email-mgoldish@redhat.com> References: <1255434516-22142-1-git-send-email-mgoldish@redhat.com> <1255434516-22142-2-git-send-email-mgoldish@redhat.com> Cc: Michael Goldish To: autotest@test.kernel.org, kvm@vger.kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:14387 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759568AbZJMLwP (ORCPT ); Tue, 13 Oct 2009 07:52:15 -0400 In-Reply-To: <1255434516-22142-2-git-send-email-mgoldish@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Note that if a session has a tracking thread (i.e. if output_func or termination_func are set to something other than None) then the session will not be garbage collected (it must be closed explicitly by the test). Signed-off-by: Michael Goldish --- client/tests/kvm/kvm_subprocess.py | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/client/tests/kvm/kvm_subprocess.py b/client/tests/kvm/kvm_subprocess.py index a625315..859aa2b 100755 --- a/client/tests/kvm/kvm_subprocess.py +++ b/client/tests/kvm/kvm_subprocess.py @@ -1010,6 +1010,10 @@ class kvm_shell_session(kvm_expect): self.status_test_command) + def __del__(self): + self.close() + + def set_prompt(self, prompt): """ Set the prompt attribute for later use by read_up_to_prompt. -- 1.5.4.1