@@ -561,4 +561,21 @@ def testRemove(t, env):
sleeptime = 20
_verify_cb_occurred(t, c, count)
-
+def _listToPath(components):
+ return '/'+reduce((lambda x,y:x+'/'+y), components)
+
+def testServerRemove(t, env):
+ """DELEGATION test
+
+ Get read delegation, then ensure removing the file on the server
+ recalls it. Respond properly and send DELEGRETURN.
+
+ FLAGS: delegations
+ CODE: DELEG16
+ """
+ c = env.c1
+ count = c.cb_server.opcounts[OP_CB_RECALL]
+ c.init_connection('pynfs%i_%s' % (os.getpid(), t.code), cb_ident=0)
+ _get_deleg(t, c, c.homedir + [t.code], _recall, NFS4_OK)
+ env.serverhelper("unlink " + _listToPath(c.homedir + [t.code]));
+ _verify_cb_occurred(t, c, count)
@@ -1,9 +1,11 @@
#!/bin/bash
-# A simple script for the reboot tests that reboots a virtual guest.
-# It would be used by adding
-# --serverhelper=sample/send_reboot.py --serverhelperarg=SERVERNAME
-# to testserver.py's commandline arguments.
+# A simple script that can reboot a virtual guest using virsh, or unlink
+# a file on the server. It would be used by adding
+# --serverhelper=sample/server_helper.sh --serverhelperarg=SERVERNAME
+# to testserver.py's commandline arguments, where SERVERNAME is
+# something that works either as a libvirt domain or as a hostname to
+# ssh to.
server=$1
command=$2
@@ -14,4 +16,7 @@ reboot )
virsh destroy $server
virsh start $server
;;
+unlink )
+ path=$1
+ ssh $server "rm $1"
esac
Add a test that checks whether a delegreturn is sent when a file is unlinked on the server using some other means than NFS. Signed-off-by: J. Bruce Fields <bfields@redhat.com> --- lib/nfs4/servertests/st_delegation.py | 19 ++++++++++++++++++- sample_files/server_helper.sh | 13 +++++++++---- 2 files changed, 27 insertions(+), 5 deletions(-)