[KVM-AUTOTEST PATCH 3/3] KVM test: kvm_subprocess.py: automatically close unreferenced shell sessions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux