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