Skip to contentSkip to conversation

TESTS: fix DELEG9

PATCH In review J. Bruce Fields 1 participant 2 messages Sep 14, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 TESTS: fix DELEG9

From: J. Bruce Fields <[email protected]>

The new server doesn't have a recall callback setup, so will never send the delegreturn. (Doing it by hand at the end as attempted here doesn't work well, as the open that precedes that final delegreturn needs the delegreturn before it can succeed.)

Also, we need to set c.cb_server for _verify_cb_occurred to get the correct count.

After this patch, the test passes against the Linux server.

---
 lib/nfs4/servertests/st_delegation.py |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
lib/nfs4/servertests/st_delegation.py +2 -3
index 5fc4fad..14a1d32 100644
@@ -396,9 +396,11 @@ def testChangeDeleg(t, env, funct=_recall):
     deleg_info, fh, stateid = _get_deleg(t, c, c.homedir + [t.code], funct, NFS4_OK)
     # Create new callback server
     new_server = CBServer(c)
+    new_server.set_cb_recall(c.cbid, funct, NFS4_OK);
     cb_thread = threading.Thread(target=new_server.run)
     cb_thread.setDaemon(1)
     cb_thread.start()
+    c.cb_server = new_server
     env.sleep(3)
     # Switch to using new server
     res = c.compound([_set_clientid(c, id, new_server)])
@@ -415,9 +417,6 @@ def testChangeDeleg(t, env, funct=_recall):
     count = new_server.opcounts[OP_CB_RECALL]
     fh2, stateid2 = _cause_recall(t, env)
     _verify_cb_occurred(t, c, count)
-    ops = c.use_obj(fh) + [c.delegreturn_op(deleg_info.read.stateid)]
-    res = c.compound(ops)
-    check(res)
 
 
    
Signature · 1 line
1.7.0.4
#1 lore raw
Quoted 11 lines · bfields

From: J. Bruce Fields <[email protected]>

The new server doesn't have a recall callback setup, so will never send the delegreturn. (Doing it by hand at the end as attempted here doesn't work well, as the open that precedes that final delegreturn needs the delegreturn before it can succeed.)

Also, we need to set c.cb_server for _verify_cb_occurred to get the correct count.

After this patch, the test passes against the Linux server.

This patch, plus the other fixes I need to get usable results against the Linux server, are also available from

git://linux-nfs.org/~bfields/pynfs.git

(and, for 4.1, at:

	git://linux-nfs.org/~bfields/pynfs41.git

).

--b.