Re: [PATCH] nfsv4.0/release-lockowner: Check for proper LOCKS_HELD response

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

 



Thanks, applied.

(Though I'd prefer new tests go under nfs4.1/server41tests/ where
possible.)

--b.

On Sun, May 29, 2022 at 01:07:31PM -0400, Chuck Lever wrote:
> 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)
> 



[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