KVM test: kvm_subprocess.py: automatically close unreferenced shell sessions
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 <mgoldish@redhat.com>
git-svn-id: http://test.kernel.org/svn/autotest/trunk@3847 592f7852-d20e-0410-864c-8624ca9c26a4
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 @@
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.