diff mbox series

[pynfs,1/3] nfs4.1: don't cache sessionids and clientids after destroying

Message ID 20190311154951.6144-2-smayhew@redhat.com (mailing list archive)
State New, archived
Headers show
Series a few fixes | expand

Commit Message

Scott Mayhew March 11, 2019, 3:49 p.m. UTC
Test.run() cleans up session and client records after every test, but
that cleanup doesn't get rid of the locally cached sessionids and
clientids, resulting in subsequent tests sending a multiple bogus
DESTROY_SESSIONs and DESTROY_CLIENTIDs which all return
NFS4ERR_BADSESSION and NFS4ERR_STALE_CLIENTID.

Signed-off-by: Scott Mayhew <smayhew@redhat.com>
---
 nfs4.1/server41tests/environment.py | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/nfs4.1/server41tests/environment.py b/nfs4.1/server41tests/environment.py
index 9e1201f..1a898f8 100644
--- a/nfs4.1/server41tests/environment.py
+++ b/nfs4.1/server41tests/environment.py
@@ -256,11 +256,13 @@  class Environment(testmod.Environment):
         """Destroy client name env.c1"""
         for sessionid in self.c1.sessions.keys():
             self.c1.compound([op.destroy_session(sessionid)])
+            del(self.c1.sessions[sessionid])
 
     def clean_clients(self):
         """Destroy client name env.c1"""
         for clientid in self.c1.clients.keys():
             self.c1.compound([op.destroy_clientid(clientid)])
+            del(self.c1.clients[clientid])
 
 #########################################
 debug_fail = False