[PATCH pynfs 04/12] Get rid of the client records as well as the session records

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

 



Signed-off-by: Tom Haynes <loghyr@xxxxxxxxxxxxxxx>
---
 nfs4.1/nfs4client.py                | 5 ++++-
 nfs4.1/server41tests/environment.py | 5 +++++
 nfs4.1/testmod.py                   | 1 +
 3 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/nfs4.1/nfs4client.py b/nfs4.1/nfs4client.py
index 0a25bcf..2e22695 100644
--- a/nfs4.1/nfs4client.py
+++ b/nfs4.1/nfs4client.py
@@ -40,6 +40,7 @@ class NFS4Client(rpc.Client, rpc.Server):
         self.server_address = (host, port)
         self.c1 = self.connect(self.server_address)
         self.sessions = {} # XXX Really, this should be per server
+        self.clients = {} # XXX Really, this should be per server
         self.ctrl_proc = ctrl_proc
         self.summary = summary
 
@@ -313,7 +314,9 @@ class NFS4Client(rpc.Client, rpc.Server):
                             cred)
         nfs4lib.check(res, expect)
         if expect == NFS4_OK:
-            return ClientRecord(res.resarray[0], self, cred, protect)
+            client_rec = ClientRecord(res.resarray[0], self, cred, protect)
+            self.clients[client_rec.clientid] = client_rec
+            return client_rec
         else:
             return None
 
diff --git a/nfs4.1/server41tests/environment.py b/nfs4.1/server41tests/environment.py
index 7384b3c..a910a69 100644
--- a/nfs4.1/server41tests/environment.py
+++ b/nfs4.1/server41tests/environment.py
@@ -257,6 +257,11 @@ class Environment(testmod.Environment):
         for sessionid in self.c1.sessions.keys():
             self.c1.compound([op.destroy_session(sessionid)])
 
+    def clean_clients(self):
+        """Destroy client name env.c1"""
+        for clientid in self.c1.clients.keys():
+            self.c1.compound([op.destroy_clientid(clientid)])
+
 #########################################
 debug_fail = False
 
diff --git a/nfs4.1/testmod.py b/nfs4.1/testmod.py
index ce25974..c5ca0fe 100644
--- a/nfs4.1/testmod.py
+++ b/nfs4.1/testmod.py
@@ -222,6 +222,7 @@ class Test(object):
             self.runtest(self, environment)
             self.result = self._pass_result
 	    environment.clean_sessions()
+	    environment.clean_clients()
         except KeyboardInterrupt:
             raise
         except TestException, e:
-- 
2.3.6

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




[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux