diff mbox

NFS4.1: try to clean sessions after testing

Message ID 5396D7FA.4050303@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Kinglong Mee June 10, 2014, 10:03 a.m. UTC
There are many sessions left after testing, they hold drc memory at server.
This patch tries to clean session after each testcase.

Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
---
 nfs4.1/server41tests/environment.py | 7 ++++++-
 nfs4.1/testmod.py                   | 1 +
 2 files changed, 7 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/nfs4.1/server41tests/environment.py b/nfs4.1/server41tests/environment.py
index b2df732..7632655 100644
--- a/nfs4.1/server41tests/environment.py
+++ b/nfs4.1/server41tests/environment.py
@@ -248,7 +248,12 @@  class Environment(testmod.Environment):
     def testname(self, t):
         """Returns a name for the test that is unique between runs"""
         return "%s_%i" % (t.code, self.timestamp)
-    
+
+    def clean_sessions(self):
+        """Destroy client name env.c1"""
+        for sessionid in self.c1.sessions.keys():
+            self.c1.compound([op.destroy_session(sessionid)])
+
 #########################################
 debug_fail = False
 
diff --git a/nfs4.1/testmod.py b/nfs4.1/testmod.py
index 5908066..661aed0 100644
--- a/nfs4.1/testmod.py
+++ b/nfs4.1/testmod.py
@@ -220,6 +220,7 @@  class Test(object):
             environment.startUp()
             self.runtest(self, environment)
             self.result = self._pass_result
+	    environment.clean_sessions()
         except KeyboardInterrupt:
             raise
         except TestException, e: