[PATCH] pynfs: do not fail test which expects STALE_STATEID

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

 



Stale stateid tests assume to know how state ids are constructed.
When this is not the case, then server will return BAD_STATEID
and test will fail.

update **check** function to always add BAD_STATEID status code
to the warning list.

Some code duplication, due to testing framework structure.

Signed-off-by: Tigran Mkrtchyan <tigran.mkrtchyan@xxxxxxx>
---
 nfs4.0/servertests/environment.py   | 6 ++++++
 nfs4.1/server41tests/environment.py | 6 ++++++
 2 files changed, 12 insertions(+)

diff --git a/nfs4.0/servertests/environment.py b/nfs4.0/servertests/environment.py
index 11658b3..c6ede8f 100644
--- a/nfs4.0/servertests/environment.py
+++ b/nfs4.0/servertests/environment.py
@@ -248,6 +248,12 @@ def check(res, stat=NFS4_OK, msg=None, warnlist=[]):
         if not (debug_fail and msg):
             return
 
+    # stale state id test expect some structure stateid.other field.
+    # as this is not the case for all server, do not fail tests if they
+    # have returned BAD_STATEID
+    if res.status == NFS4ERR_STALE_STATEID:
+        warnlist.append(NFS4ERR_BAD_STATEID)
+
     statnames = [nfsstat4[stat] for stat in statlist]
     desired = ' or '.join(statnames)
     if not desired:
diff --git a/nfs4.1/server41tests/environment.py b/nfs4.1/server41tests/environment.py
index a910a69..8bae69b 100644
--- a/nfs4.1/server41tests/environment.py
+++ b/nfs4.1/server41tests/environment.py
@@ -282,6 +282,12 @@ def check(res, stat=NFS4_OK, msg=None, warnlist=[]):
         if not (debug_fail and msg):
             return
 
+    # stale state id test expect some structure stateid.other field.
+    # as this is not the case for all server, do not fail tests if they
+    # have returned BAD_STATEID
+    if res.status == NFS4ERR_STALE_STATEID:
+        warnlist.append(NFS4ERR_BAD_STATEID)
+
     statnames = [nfsstat4[stat] for stat in statlist]
     desired = ' or '.join(statnames)
     if not desired:
-- 
2.9.3

--
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