From: Kinglong Mee <kinglongmee@gmail.com>
To: "J. Bruce Fields" <bfields@fieldses.org>
Cc: Linux NFS Mailing List <linux-nfs@vger.kernel.org>,
kinglongmee@gmail.com
Subject: [PATCH] NFS4.1: try to clean sessions after testing
Date: Tue, 10 Jun 2014 18:03:38 +0800 [thread overview]
Message-ID: <5396D7FA.4050303@gmail.com> (raw)
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 --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:
--
1.9.3
next reply other threads:[~2014-06-10 10:04 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-10 10:03 Kinglong Mee [this message]
2014-06-10 11:55 ` [PATCH v2] NFS4.1: try to clean sessions after testing Kinglong Mee
2014-06-11 21:17 ` J. Bruce Fields
2014-06-11 23:24 ` Kinglong Mee
2014-06-12 1:38 ` Kinglong Mee
2014-06-12 15:25 ` J. Bruce Fields
2014-06-13 10:44 ` Kinglong Mee
2014-06-14 9:21 ` Kinglong Mee
2014-06-18 16:05 ` J. Bruce Fields
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5396D7FA.4050303@gmail.com \
--to=kinglongmee@gmail.com \
--cc=bfields@fieldses.org \
--cc=linux-nfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox