Ensure that RELEASE_LOCKOWNER returns LOCKS_HELD if the lockowner is still in use. Signed-off-by: Chuck Lever <chuck.lever@xxxxxxxxxx> --- nfs4.0/servertests/st_releaselockowner.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/nfs4.0/servertests/st_releaselockowner.py b/nfs4.0/servertests/st_releaselockowner.py index 2c83f99b207f..b296e6c2752a 100644 --- a/nfs4.0/servertests/st_releaselockowner.py +++ b/nfs4.0/servertests/st_releaselockowner.py @@ -49,3 +49,24 @@ def testFile2(t, env): owner = lock_owner4(c.clientid, b"lockowner_RLOWN2") res = c.compound([op.release_lockowner(owner)]) check(res) + +def testLocksHeld(t, env): + """RELEASE_LOCKOWNER - Locks held test + + FLAGS: releaselockowner all + DEPEND: + CODE: RLOWN3 + """ + c = env.c1 + c.init_connection() + fh, stateid = c.create_confirm(t.word()) + res = c.lock_file(t.word(), fh, stateid, lockowner=b"lockowner_RLOWN3") + check(res) + owner = lock_owner4(c.clientid, b"lockowner_RLOWN3") + res2 = c.compound([op.release_lockowner(owner)]) + check(res2, NFS4ERR_LOCKS_HELD) + res = c.unlock_file(1, fh, res.lockid) + check(res) + owner = lock_owner4(c.clientid, b"lockowner_RLOWN3") + res = c.compound([op.release_lockowner(owner)]) + check(res)