* [PATCH pynfs 0/7] nfs4.1: add some basic directory delegation tests
@ 2025-09-30 11:37 Jeff Layton
2025-09-30 11:37 ` [PATCH pynfs 1/7] nfs4.1: add proposed NOTIFY4_GFLAG_EXTEND flag Jeff Layton
` (7 more replies)
0 siblings, 8 replies; 10+ messages in thread
From: Jeff Layton @ 2025-09-30 11:37 UTC (permalink / raw)
To: Calum Mackay; +Cc: linux-nfs, Jeff Layton
Add basic support for testing both GET_DIR_DELEGATION operations and
CB_NOTIFY.
Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
Jeff Layton (7):
nfs4.1: add proposed NOTIFY4_GFLAG_EXTEND flag
pynfs: add a getfh() to the end of create_obj() compound
server41tests: add a basic GET_DIR_DELEGATION test
server41tests: add a test for duplicate GET_DIR_DELEGATION requests
server41tests: add a test for removal from dir with dir delegation
server41tests: add a test for diretory add notifications
server41tests: add test for rename event notifications
nfs4.1/nfs4client.py | 6 +
nfs4.1/server41tests/__init__.py | 1 +
nfs4.1/server41tests/environment.py | 2 +-
nfs4.1/server41tests/st_dir_deleg.py | 221 +++++++++++++++++++++++++++++++++++
nfs4.1/xdrdef/nfs4.x | 3 +-
5 files changed, 231 insertions(+), 2 deletions(-)
---
base-commit: 3c14d9e3ad12272ab2f6092c85bb28ab03951484
change-id: 20250930-dir-deleg-4ae7364fb398
Best regards,
--
Jeff Layton <jlayton@kernel.org>
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH pynfs 1/7] nfs4.1: add proposed NOTIFY4_GFLAG_EXTEND flag
2025-09-30 11:37 [PATCH pynfs 0/7] nfs4.1: add some basic directory delegation tests Jeff Layton
@ 2025-09-30 11:37 ` Jeff Layton
2025-09-30 11:37 ` [PATCH pynfs 2/7] pynfs: add a getfh() to the end of create_obj() compound Jeff Layton
` (6 subsequent siblings)
7 siblings, 0 replies; 10+ messages in thread
From: Jeff Layton @ 2025-09-30 11:37 UTC (permalink / raw)
To: Calum Mackay; +Cc: linux-nfs, Jeff Layton
Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
nfs4.1/xdrdef/nfs4.x | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/nfs4.1/xdrdef/nfs4.x b/nfs4.1/xdrdef/nfs4.x
index ee3da8aa7a342e4d3829f4b1b1f82543275199c5..f03eb538a2980156a8149f0b00cc9bf19c0a91b9 100644
--- a/nfs4.1/xdrdef/nfs4.x
+++ b/nfs4.1/xdrdef/nfs4.x
@@ -3611,7 +3611,8 @@ enum notify_type4 {
NOTIFY4_REMOVE_ENTRY = 2,
NOTIFY4_ADD_ENTRY = 3,
NOTIFY4_RENAME_ENTRY = 4,
- NOTIFY4_CHANGE_COOKIE_VERIFIER = 5
+ NOTIFY4_CHANGE_COOKIE_VERIFIER = 5,
+ NOTIFY4_GFLAG_EXTEND = 6 /* proposed in rfc8881bis */
};
/* Changed entry information. */
--
2.51.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH pynfs 2/7] pynfs: add a getfh() to the end of create_obj() compound
2025-09-30 11:37 [PATCH pynfs 0/7] nfs4.1: add some basic directory delegation tests Jeff Layton
2025-09-30 11:37 ` [PATCH pynfs 1/7] nfs4.1: add proposed NOTIFY4_GFLAG_EXTEND flag Jeff Layton
@ 2025-09-30 11:37 ` Jeff Layton
2025-09-30 11:37 ` [PATCH pynfs 3/7] server41tests: add a basic GET_DIR_DELEGATION test Jeff Layton
` (5 subsequent siblings)
7 siblings, 0 replies; 10+ messages in thread
From: Jeff Layton @ 2025-09-30 11:37 UTC (permalink / raw)
To: Calum Mackay; +Cc: linux-nfs, Jeff Layton
Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
nfs4.1/server41tests/environment.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/nfs4.1/server41tests/environment.py b/nfs4.1/server41tests/environment.py
index 48284e029634fff60b7690e058cd4131bfea9b08..add13d8565e6529406c3b0db53f4e1396dae846a 100644
--- a/nfs4.1/server41tests/environment.py
+++ b/nfs4.1/server41tests/environment.py
@@ -474,7 +474,7 @@ def create_obj(sess, path, kind=NF4DIR, attrs={FATTR4_MODE:0o755}):
# Ensure using createtype4
if not hasattr(kind, "type"):
kind = createtype4(kind)
- ops = use_obj(path[:-1]) + [op.create(kind, path[-1], attrs)]
+ ops = use_obj(path[:-1]) + [op.create(kind, path[-1], attrs), op.getfh()]
return sess.compound(ops)
def open_create_file(sess, owner, path=None, attrs={FATTR4_MODE: 0o644},
--
2.51.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH pynfs 3/7] server41tests: add a basic GET_DIR_DELEGATION test
2025-09-30 11:37 [PATCH pynfs 0/7] nfs4.1: add some basic directory delegation tests Jeff Layton
2025-09-30 11:37 ` [PATCH pynfs 1/7] nfs4.1: add proposed NOTIFY4_GFLAG_EXTEND flag Jeff Layton
2025-09-30 11:37 ` [PATCH pynfs 2/7] pynfs: add a getfh() to the end of create_obj() compound Jeff Layton
@ 2025-09-30 11:37 ` Jeff Layton
2025-09-30 11:37 ` [PATCH pynfs 4/7] server41tests: add a test for duplicate GET_DIR_DELEGATION requests Jeff Layton
` (4 subsequent siblings)
7 siblings, 0 replies; 10+ messages in thread
From: Jeff Layton @ 2025-09-30 11:37 UTC (permalink / raw)
To: Calum Mackay; +Cc: linux-nfs, Jeff Layton
Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
nfs4.1/nfs4client.py | 6 +++
nfs4.1/server41tests/__init__.py | 1 +
nfs4.1/server41tests/st_dir_deleg.py | 77 ++++++++++++++++++++++++++++++++++++
3 files changed, 84 insertions(+)
diff --git a/nfs4.1/nfs4client.py b/nfs4.1/nfs4client.py
index f4fabcc11be1328f47d6d738f78586b3e8541296..4650c052c118f1ceab30b6961aef885a910b96d5 100644
--- a/nfs4.1/nfs4client.py
+++ b/nfs4.1/nfs4client.py
@@ -283,6 +283,12 @@ class NFS4Client(rpc.Client, rpc.Server):
res = self.posthook(arg, env, res=NFS4_OK)
return encode_status(res)
+ def op_cb_notify(self, arg, env):
+ log_cb.info("In CB_NOTIFY")
+ self.prehook(arg, env)
+ res = self.posthook(arg, env, res=NFS4_OK)
+ return encode_status(res)
+
def op_cb_layoutrecall(self, arg, env):
log_cb.info("In CB_LAYOUTRECALL")
self.prehook(arg, env)
diff --git a/nfs4.1/server41tests/__init__.py b/nfs4.1/server41tests/__init__.py
index 5f223788147816079de4e2b0e9638ae90aa6d908..1422b131b1b4778f1d0bba1a44a5ec51a6ebadcd 100644
--- a/nfs4.1/server41tests/__init__.py
+++ b/nfs4.1/server41tests/__init__.py
@@ -11,6 +11,7 @@ __all__ = ["st_exchange_id.py", # draft 21
"st_trunking.py",
"st_open.py",
"st_delegation.py",
+ "st_dir_deleg.py",
"st_verify.py",
"st_getdevicelist.py",
"st_lookupp.py",
diff --git a/nfs4.1/server41tests/st_dir_deleg.py b/nfs4.1/server41tests/st_dir_deleg.py
new file mode 100644
index 0000000000000000000000000000000000000000..d63a16e06edd4515033ad81986cf1e84871ee7ad
--- /dev/null
+++ b/nfs4.1/server41tests/st_dir_deleg.py
@@ -0,0 +1,77 @@
+from .st_create_session import create_session
+from .st_open import open_claim4
+from xdrdef.nfs4_const import *
+
+from .environment import check, fail, create_obj, use_obj
+from xdrdef.nfs4_type import *
+import nfs_ops
+op = nfs_ops.NFS4ops()
+import nfs4lib
+import threading
+
+zerotime = nfstime4(seconds=0, nseconds=0)
+
+def _getDirDeleg(t, env, notify_mask, cb):
+ def recall_pre_hook(arg, env):
+ cb.stateid = arg.stateid # NOTE this must be done before set()
+ cb.cred = env.cred.raw_cred
+ cb.got_recall = True
+ env.notify = cb.set # This is called after compound sent to queue
+ def recall_post_hook(arg, env, res):
+ return res
+ def notify_pre_hook(arg, env):
+ cb.stateid = arg.cna_stateid
+ cb.fh = arg.cna_fh
+ cb.got_notify = True
+ env.notify = cb.set # This is called after compound sent to queue
+ def notify_post_hook(arg, env, res):
+ return res
+
+ c = env.c1
+ sess1 = c.new_client_session(b"%s_1" % env.testname(t))
+ sess1.client.cb_pre_hook(OP_CB_RECALL, recall_pre_hook)
+ sess1.client.cb_post_hook(OP_CB_RECALL, recall_post_hook)
+ sess1.client.cb_pre_hook(OP_CB_NOTIFY, notify_pre_hook)
+ sess1.client.cb_post_hook(OP_CB_NOTIFY, notify_post_hook)
+
+ topdir = c.homedir + [t.code.encode('utf8')]
+ res = create_obj(sess1, topdir)
+ check(res)
+ fh = res.resarray[-1].object
+
+ notify_mask.append(NOTIFY4_GFLAG_EXTEND)
+ ops = [ op.putfh(fh), op.get_dir_delegation(False,
+ nfs4lib.list2bitmap(notify_mask),
+ zerotime, zerotime,
+ nfs4lib.list2bitmap([]),
+ nfs4lib.list2bitmap([]))]
+ res = sess1.compound(ops)
+ check(res)
+ deleg = res.resarray[-1].gddrnf_resok4.gddr_stateid
+ return (sess1, fh, deleg)
+
+def testDirDelegSimple(t, env):
+ """Test basic dir delegation handout, recall and return
+
+ FLAGS: dirdeleg all
+ CODE: DIRDELEG1
+ """
+ c = env.c1
+ recall = threading.Event()
+ sess1, fh, deleg = _getDirDeleg(t, env, [], recall)
+
+ # new client -- create a file in the dir
+ sess2 = c.new_client_session(b"%s_2" % env.testname(t))
+ claim = open_claim4(CLAIM_NULL, env.testname(t))
+ owner = open_owner4(0, b"owner")
+ how = openflag4(OPEN4_CREATE, createhow4(GUARDED4, {FATTR4_SIZE:0}))
+ open_op = [ op.putfh(fh), op.open(0,
+ OPEN4_SHARE_ACCESS_WRITE | OPEN4_SHARE_ACCESS_WANT_NO_DELEG,
+ OPEN4_SHARE_DENY_NONE, owner, how, claim) ]
+ slot = sess2.compound_async(open_op)
+ completed = recall.wait(2)
+ env.sleep(.1)
+
+ ops = [ op.putfh(fh), op.delegreturn(deleg) ]
+ res = sess1.compound(ops)
+ check(res)
--
2.51.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH pynfs 4/7] server41tests: add a test for duplicate GET_DIR_DELEGATION requests
2025-09-30 11:37 [PATCH pynfs 0/7] nfs4.1: add some basic directory delegation tests Jeff Layton
` (2 preceding siblings ...)
2025-09-30 11:37 ` [PATCH pynfs 3/7] server41tests: add a basic GET_DIR_DELEGATION test Jeff Layton
@ 2025-09-30 11:37 ` Jeff Layton
2025-09-30 11:37 ` [PATCH pynfs 5/7] server41tests: add a test for removal from dir with dir delegation Jeff Layton
` (3 subsequent siblings)
7 siblings, 0 replies; 10+ messages in thread
From: Jeff Layton @ 2025-09-30 11:37 UTC (permalink / raw)
To: Calum Mackay; +Cc: linux-nfs, Jeff Layton
Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
nfs4.1/server41tests/st_dir_deleg.py | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/nfs4.1/server41tests/st_dir_deleg.py b/nfs4.1/server41tests/st_dir_deleg.py
index d63a16e06edd4515033ad81986cf1e84871ee7ad..ccf7eca8bcbe3401aaa8561e10db02d0836ca493 100644
--- a/nfs4.1/server41tests/st_dir_deleg.py
+++ b/nfs4.1/server41tests/st_dir_deleg.py
@@ -75,3 +75,29 @@ def testDirDelegSimple(t, env):
ops = [ op.putfh(fh), op.delegreturn(deleg) ]
res = sess1.compound(ops)
check(res)
+
+def testDirDelegDuplicate(t, env):
+ """Test that server returns GDD4_UNAVAIL on duplicate GDD4 request
+
+ FLAGS: dirdeleg all
+ CODE: DIRDELEG2
+ """
+ c = env.c1
+ recall = threading.Event()
+ sess1, fh, deleg = _getDirDeleg(t, env, [], recall)
+
+ # get a dir deleg with no notifications
+ ops = [ op.putfh(fh), op.get_dir_delegation(False,
+ nfs4lib.list2bitmap([]),
+ zerotime, zerotime,
+ nfs4lib.list2bitmap([]),
+ nfs4lib.list2bitmap([]))]
+ res = sess1.compound(ops)
+ check(res)
+ nfstatus = res.resarray[-1].gddr_res_non_fatal4.gddrnf_status
+ if (nfstatus != GDD4_UNAVAIL):
+ fail("Server replied to duplicate request with %d" % nfstatus)
+
+ ops = [ op.putfh(fh), op.delegreturn(deleg) ]
+ res = sess1.compound(ops)
+ check(res)
--
2.51.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH pynfs 5/7] server41tests: add a test for removal from dir with dir delegation
2025-09-30 11:37 [PATCH pynfs 0/7] nfs4.1: add some basic directory delegation tests Jeff Layton
` (3 preceding siblings ...)
2025-09-30 11:37 ` [PATCH pynfs 4/7] server41tests: add a test for duplicate GET_DIR_DELEGATION requests Jeff Layton
@ 2025-09-30 11:37 ` Jeff Layton
2025-09-30 11:37 ` [PATCH pynfs 6/7] server41tests: add a test for diretory add notifications Jeff Layton
` (2 subsequent siblings)
7 siblings, 0 replies; 10+ messages in thread
From: Jeff Layton @ 2025-09-30 11:37 UTC (permalink / raw)
To: Calum Mackay; +Cc: linux-nfs, Jeff Layton
...and actually request attributes in the GET_DIR_DELEGATION request.
Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
nfs4.1/server41tests/st_dir_deleg.py | 53 ++++++++++++++++++++++++++++++++++--
1 file changed, 51 insertions(+), 2 deletions(-)
diff --git a/nfs4.1/server41tests/st_dir_deleg.py b/nfs4.1/server41tests/st_dir_deleg.py
index ccf7eca8bcbe3401aaa8561e10db02d0836ca493..f44a8f10738b1e6d5868f4496ba4bda1c5be810d 100644
--- a/nfs4.1/server41tests/st_dir_deleg.py
+++ b/nfs4.1/server41tests/st_dir_deleg.py
@@ -43,8 +43,26 @@ def _getDirDeleg(t, env, notify_mask, cb):
ops = [ op.putfh(fh), op.get_dir_delegation(False,
nfs4lib.list2bitmap(notify_mask),
zerotime, zerotime,
- nfs4lib.list2bitmap([]),
- nfs4lib.list2bitmap([]))]
+ nfs4lib.list2bitmap([FATTR4_TYPE,
+ FATTR4_CHANGE,
+ FATTR4_SIZE,
+ FATTR4_FILEID,
+ FATTR4_FILEHANDLE,
+ FATTR4_MODE,
+ FATTR4_NUMLINKS,
+ FATTR4_RAWDEV,
+ FATTR4_SPACE_USED,
+ FATTR4_TIME_ACCESS,
+ FATTR4_TIME_METADATA,
+ FATTR4_TIME_MODIFY,
+ FATTR4_TIME_CREATE]),
+ nfs4lib.list2bitmap([FATTR4_CHANGE,
+ FATTR4_SIZE,
+ FATTR4_NUMLINKS,
+ FATTR4_SPACE_USED,
+ FATTR4_TIME_ACCESS,
+ FATTR4_TIME_METADATA,
+ FATTR4_TIME_MODIFY]))]
res = sess1.compound(ops)
check(res)
deleg = res.resarray[-1].gddrnf_resok4.gddr_stateid
@@ -101,3 +119,34 @@ def testDirDelegDuplicate(t, env):
ops = [ op.putfh(fh), op.delegreturn(deleg) ]
res = sess1.compound(ops)
check(res)
+
+def testDirDelegRemove(t, env):
+ """Create a dir_deleg that accepts notification of REMOVE events
+
+ FLAGS: dirdeleg all
+ CODE: DIRDELEG3
+ """
+ c = env.c1
+ cb = threading.Event()
+ sess1, fh, deleg = _getDirDeleg(t, env, [NOTIFY4_CHANGE_DIR_ATTRS, NOTIFY4_REMOVE_ENTRY], cb)
+
+ claim = open_claim4(CLAIM_NULL, env.testname(t))
+ owner = open_owner4(0, b"owner")
+ how = openflag4(OPEN4_CREATE, createhow4(GUARDED4, {FATTR4_SIZE:0}))
+ open_op = [ op.putfh(fh), op.open(0,
+ OPEN4_SHARE_ACCESS_WRITE | OPEN4_SHARE_ACCESS_WANT_NO_DELEG,
+ OPEN4_SHARE_DENY_NONE, owner, how, claim) ]
+ res = sess1.compound(open_op)
+ check(res)
+
+ sess2 = c.new_client_session(b"%s_2" % env.testname(t))
+ remove_op = [ op.putfh(fh), op.remove(env.testname(t)) ]
+ res = sess2.compound(remove_op)
+ check(res)
+
+ completed = cb.wait(5)
+ ops = [ op.putfh(fh), op.delegreturn(deleg) ]
+ res = sess1.compound(ops)
+
+ if (not completed or not cb.got_notify):
+ fail("Didn't receive a CB_NOTIFY from the server!")
--
2.51.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH pynfs 6/7] server41tests: add a test for diretory add notifications
2025-09-30 11:37 [PATCH pynfs 0/7] nfs4.1: add some basic directory delegation tests Jeff Layton
` (4 preceding siblings ...)
2025-09-30 11:37 ` [PATCH pynfs 5/7] server41tests: add a test for removal from dir with dir delegation Jeff Layton
@ 2025-09-30 11:37 ` Jeff Layton
2025-09-30 11:37 ` [PATCH pynfs 7/7] server41tests: add test for rename event notifications Jeff Layton
2025-09-30 13:48 ` [PATCH pynfs 0/7] nfs4.1: add some basic directory delegation tests Chuck Lever
7 siblings, 0 replies; 10+ messages in thread
From: Jeff Layton @ 2025-09-30 11:37 UTC (permalink / raw)
To: Calum Mackay; +Cc: linux-nfs, Jeff Layton
Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
nfs4.1/server41tests/st_dir_deleg.py | 33 +++++++++++++++++++++++++++++++++
1 file changed, 33 insertions(+)
diff --git a/nfs4.1/server41tests/st_dir_deleg.py b/nfs4.1/server41tests/st_dir_deleg.py
index f44a8f10738b1e6d5868f4496ba4bda1c5be810d..7073c590cb537f83552d7d8afa0ab02da1fe07c9 100644
--- a/nfs4.1/server41tests/st_dir_deleg.py
+++ b/nfs4.1/server41tests/st_dir_deleg.py
@@ -150,3 +150,36 @@ def testDirDelegRemove(t, env):
if (not completed or not cb.got_notify):
fail("Didn't receive a CB_NOTIFY from the server!")
+
+def testDirDelegAdd(t, env):
+ """Create a dir_deleg that accepts notification of ADD events
+
+ FLAGS: dirdeleg all
+ CODE: DIRDELEG4
+ """
+ c = env.c1
+ cb = threading.Event()
+ sess1, fh, deleg = _getDirDeleg(t, env, [NOTIFY4_ADD_ENTRY], cb)
+
+ sess2 = c.new_client_session(b"%s_2" % env.testname(t))
+ claim = open_claim4(CLAIM_NULL, env.testname(t))
+ owner = open_owner4(0, b"owner")
+ how = openflag4(OPEN4_CREATE, createhow4(GUARDED4, {FATTR4_SIZE:0}))
+ open_op = [ op.putfh(fh), op.open(0,
+ OPEN4_SHARE_ACCESS_WRITE | OPEN4_SHARE_ACCESS_WANT_NO_DELEG,
+ OPEN4_SHARE_DENY_NONE, owner, how, claim), op.getfh() ]
+ res = sess2.compound(open_op)
+ check(res)
+
+ completed = cb.wait(2)
+
+ delegreturn_op = [ op.putfh(fh), op.delegreturn(deleg) ]
+ res = sess1.compound(delegreturn_op)
+ check(res)
+
+ remove_op = [ op.putfh(fh), op.remove(env.testname(t)) ]
+ res = sess2.compound(remove_op)
+ check(res)
+
+ if (not completed or not cb.got_notify):
+ fail("Didn't receive a CB_NOTIFY from the server!")
--
2.51.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH pynfs 7/7] server41tests: add test for rename event notifications
2025-09-30 11:37 [PATCH pynfs 0/7] nfs4.1: add some basic directory delegation tests Jeff Layton
` (5 preceding siblings ...)
2025-09-30 11:37 ` [PATCH pynfs 6/7] server41tests: add a test for diretory add notifications Jeff Layton
@ 2025-09-30 11:37 ` Jeff Layton
2025-09-30 13:48 ` [PATCH pynfs 0/7] nfs4.1: add some basic directory delegation tests Chuck Lever
7 siblings, 0 replies; 10+ messages in thread
From: Jeff Layton @ 2025-09-30 11:37 UTC (permalink / raw)
To: Calum Mackay; +Cc: linux-nfs, Jeff Layton
Add a test of notifications for renames within the same dir.
Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
nfs4.1/server41tests/st_dir_deleg.py | 38 +++++++++++++++++++++++++++++++++++-
1 file changed, 37 insertions(+), 1 deletion(-)
diff --git a/nfs4.1/server41tests/st_dir_deleg.py b/nfs4.1/server41tests/st_dir_deleg.py
index 7073c590cb537f83552d7d8afa0ab02da1fe07c9..bd1cd1c2ad5342b3026e245f5eb0823c01b1f9ea 100644
--- a/nfs4.1/server41tests/st_dir_deleg.py
+++ b/nfs4.1/server41tests/st_dir_deleg.py
@@ -2,7 +2,7 @@ from .st_create_session import create_session
from .st_open import open_claim4
from xdrdef.nfs4_const import *
-from .environment import check, fail, create_obj, use_obj
+from .environment import check, fail, create_obj, use_obj, rename_obj
from xdrdef.nfs4_type import *
import nfs_ops
op = nfs_ops.NFS4ops()
@@ -183,3 +183,39 @@ def testDirDelegAdd(t, env):
if (not completed or not cb.got_notify):
fail("Didn't receive a CB_NOTIFY from the server!")
+
+def testDirDelegRename(t, env):
+ """Create a dir_deleg that accepts notification of RENAME events
+
+ FLAGS: dirdeleg all
+ CODE: DIRDELEG5
+ """
+ c = env.c1
+ cb = threading.Event()
+
+ sess1, fh, deleg = _getDirDeleg(t, env, [NOTIFY4_RENAME_ENTRY], cb)
+
+ claim = open_claim4(CLAIM_NULL, env.testname(t))
+ owner = open_owner4(0, b"owner")
+ how = openflag4(OPEN4_CREATE, createhow4(GUARDED4, {FATTR4_SIZE:0}))
+ open_op = [ op.putfh(fh), op.open(0,
+ OPEN4_SHARE_ACCESS_WRITE | OPEN4_SHARE_ACCESS_WANT_NO_DELEG,
+ OPEN4_SHARE_DENY_NONE, owner, how, claim) ]
+ res = sess1.compound(open_op)
+ check(res)
+
+ sess2 = c.new_client_session(b"%s_2" % env.testname(t))
+ topdir = c.homedir + [t.code.encode('utf8')]
+ oldpath = topdir + [env.testname(t)]
+ newpath = topdir + [b"%s_2" % env.testname(t)]
+ res = rename_obj(sess2, oldpath, newpath)
+ check(res)
+
+ completed = cb.wait(2)
+
+ delegreturn_op = [ op.putfh(fh), op.delegreturn(deleg) ]
+ res = sess1.compound(delegreturn_op)
+ check(res)
+
+ if (not completed or not cb.got_notify):
+ fail("Didn't receive a CB_NOTIFY from the server!")
--
2.51.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH pynfs 0/7] nfs4.1: add some basic directory delegation tests
2025-09-30 11:37 [PATCH pynfs 0/7] nfs4.1: add some basic directory delegation tests Jeff Layton
` (6 preceding siblings ...)
2025-09-30 11:37 ` [PATCH pynfs 7/7] server41tests: add test for rename event notifications Jeff Layton
@ 2025-09-30 13:48 ` Chuck Lever
2025-09-30 13:57 ` Jeff Layton
7 siblings, 1 reply; 10+ messages in thread
From: Chuck Lever @ 2025-09-30 13:48 UTC (permalink / raw)
To: Jeff Layton, Calum Mackay; +Cc: linux-nfs
On 9/30/25 7:37 AM, Jeff Layton wrote:
> Add basic support for testing both GET_DIR_DELEGATION operations and
> CB_NOTIFY.
>
> Signed-off-by: Jeff Layton <jlayton@kernel.org>
> ---
> Jeff Layton (7):
> nfs4.1: add proposed NOTIFY4_GFLAG_EXTEND flag
> pynfs: add a getfh() to the end of create_obj() compound
> server41tests: add a basic GET_DIR_DELEGATION test
> server41tests: add a test for duplicate GET_DIR_DELEGATION requests
> server41tests: add a test for removal from dir with dir delegation
> server41tests: add a test for diretory add notifications
> server41tests: add test for rename event notifications
>
> nfs4.1/nfs4client.py | 6 +
> nfs4.1/server41tests/__init__.py | 1 +
> nfs4.1/server41tests/environment.py | 2 +-
> nfs4.1/server41tests/st_dir_deleg.py | 221 +++++++++++++++++++++++++++++++++++
> nfs4.1/xdrdef/nfs4.x | 3 +-
> 5 files changed, 231 insertions(+), 2 deletions(-)
> ---
> base-commit: 3c14d9e3ad12272ab2f6092c85bb28ab03951484
> change-id: 20250930-dir-deleg-4ae7364fb398
>
> Best regards,
Reviewed-by: Chuck Lever <chuck.lever@oracle.com>
But one question: should these new tests not be in the "all" group?
Seems like most NFS server implementations won't support directory
delegations.
--
Chuck Lever
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH pynfs 0/7] nfs4.1: add some basic directory delegation tests
2025-09-30 13:48 ` [PATCH pynfs 0/7] nfs4.1: add some basic directory delegation tests Chuck Lever
@ 2025-09-30 13:57 ` Jeff Layton
0 siblings, 0 replies; 10+ messages in thread
From: Jeff Layton @ 2025-09-30 13:57 UTC (permalink / raw)
To: Chuck Lever, Calum Mackay; +Cc: linux-nfs
On Tue, 2025-09-30 at 09:48 -0400, Chuck Lever wrote:
> On 9/30/25 7:37 AM, Jeff Layton wrote:
> > Add basic support for testing both GET_DIR_DELEGATION operations and
> > CB_NOTIFY.
> >
> > Signed-off-by: Jeff Layton <jlayton@kernel.org>
> > ---
> > Jeff Layton (7):
> > nfs4.1: add proposed NOTIFY4_GFLAG_EXTEND flag
> > pynfs: add a getfh() to the end of create_obj() compound
> > server41tests: add a basic GET_DIR_DELEGATION test
> > server41tests: add a test for duplicate GET_DIR_DELEGATION requests
> > server41tests: add a test for removal from dir with dir delegation
> > server41tests: add a test for diretory add notifications
> > server41tests: add test for rename event notifications
> >
> > nfs4.1/nfs4client.py | 6 +
> > nfs4.1/server41tests/__init__.py | 1 +
> > nfs4.1/server41tests/environment.py | 2 +-
> > nfs4.1/server41tests/st_dir_deleg.py | 221 +++++++++++++++++++++++++++++++++++
> > nfs4.1/xdrdef/nfs4.x | 3 +-
> > 5 files changed, 231 insertions(+), 2 deletions(-)
> > ---
> > base-commit: 3c14d9e3ad12272ab2f6092c85bb28ab03951484
> > change-id: 20250930-dir-deleg-4ae7364fb398
> >
> > Best regards,
>
> Reviewed-by: Chuck Lever <chuck.lever@oracle.com>
>
> But one question: should these new tests not be in the "all" group?
> Seems like most NFS server implementations won't support directory
> delegations.
>
I had meant to remove that group before posting and then forgot about
it. That is a good point though...
Ideally what would best would be to try and run it, and just make it a
non-fatal error if the initial GET_DIR_DELEGATION fails? Maybe just
make it pass_warn() in that case?
I like that idea better than hiding this away where we forget to run
it. I'll see what I can put together.
Thanks,
--
Jeff Layton <jlayton@kernel.org>
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2025-09-30 13:57 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-30 11:37 [PATCH pynfs 0/7] nfs4.1: add some basic directory delegation tests Jeff Layton
2025-09-30 11:37 ` [PATCH pynfs 1/7] nfs4.1: add proposed NOTIFY4_GFLAG_EXTEND flag Jeff Layton
2025-09-30 11:37 ` [PATCH pynfs 2/7] pynfs: add a getfh() to the end of create_obj() compound Jeff Layton
2025-09-30 11:37 ` [PATCH pynfs 3/7] server41tests: add a basic GET_DIR_DELEGATION test Jeff Layton
2025-09-30 11:37 ` [PATCH pynfs 4/7] server41tests: add a test for duplicate GET_DIR_DELEGATION requests Jeff Layton
2025-09-30 11:37 ` [PATCH pynfs 5/7] server41tests: add a test for removal from dir with dir delegation Jeff Layton
2025-09-30 11:37 ` [PATCH pynfs 6/7] server41tests: add a test for diretory add notifications Jeff Layton
2025-09-30 11:37 ` [PATCH pynfs 7/7] server41tests: add test for rename event notifications Jeff Layton
2025-09-30 13:48 ` [PATCH pynfs 0/7] nfs4.1: add some basic directory delegation tests Chuck Lever
2025-09-30 13:57 ` Jeff Layton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).