Signed-off-by: Tigran Mkrtchyan <tigran.mkrtchyan@xxxxxxx> --- nfs4.1/server41tests/st_open.py | 27 ++++++++++++++++++++++++++- 1 files changed, 26 insertions(+), 1 deletions(-) diff --git a/nfs4.1/server41tests/st_open.py b/nfs4.1/server41tests/st_open.py index c809c95..6c991c8 100644 --- a/nfs4.1/server41tests/st_open.py +++ b/nfs4.1/server41tests/st_open.py @@ -290,4 +290,29 @@ def testOpenWriteClose(t, env): open_op = open_create_file_op(sess1, env.testname(t), open_create=OPEN4_CREATE) res = sess1.compound(open_op + [op.write(current_stateid, 5, FILE_SYNC4, data), op.close(0, current_stateid)]) - check(res, NFS4_OK) \ No newline at end of file + check(res, NFS4_OK) + +def testLockWriteLocku(t, env): + """test current state id processing by having LOCK, WRITE and LOCKU + in a single compound + + FLAGS: open all + CODE: OPEN34 + """ + current_stateid = stateid4(1, '\0' * 12) + sess1 = env.c1.new_client_session(env.testname(t)) + + res = create_file(sess1, env.testname(t)) + check(res) + fh = res.resarray[-1].object + stateid = res.resarray[-2].stateid + + data = "write test data" + open_to_lock_owner = open_to_lock_owner4( 0, stateid, 0, lock_owner4(0, "lock1")) + lock_owner = locker4(open_owner=open_to_lock_owner, new_lock_owner=True) + lock_ops = [ op.lock(WRITE_LT, False, 0, NFS4_UINT64_MAX, lock_owner), + op.write(current_stateid, 5, FILE_SYNC4, data), + op.locku(WRITE_LT, 0, current_stateid, 0, NFS4_UINT64_MAX), + op.close(0, stateid)] + res = sess1.compound([op.putfh(fh)] + lock_ops) + check(res, NFS4_OK) -- 1.7.7 -- 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