generic/571: skip test if locktest -t on NFS returns EAGAIN
authorsuy.fnst@fujitsu.com <suy.fnst@fujitsu.com>
Mon, 29 Nov 2021 01:26:48 +0000 (01:26 +0000)
committerEryu Guan <guaneryu@gmail.com>
Sun, 5 Dec 2021 13:42:17 +0000 (21:42 +0800)
As kernel commit e93a5e9306a5 ("NFSv4: Add support for application
leases underpinned by a delegation") describes, NFS now supports
file leases only after delegations.  However, fstests lacks many NFS
functionalities including delegation.

So let's skip generic/571 if locktest -t on NFS returns EAGAIN
because of commit df2c7b951f43 ("NFSv4: setlease should return
EAGAIN if locks are not available").

Signed-off-by: Su Yue <suy.fnst@fujitsu.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
common/rc

index 8e351f17bbbeba91d01294f2761ccf3f83cb5761..2d83c1e5e6bebdbe180f3422213ffb128777a738 100644 (file)
--- a/common/rc
+++ b/common/rc
@@ -3982,7 +3982,10 @@ _require_test_fcntl_setlease()
        _require_test_program "locktest"
        touch $TEST_DIR/setlease_testfile
        $here/src/locktest -t $TEST_DIR/setlease_testfile >/dev/null 2>&1
-       [ $? -eq 22 ] && _notrun "Require fcntl setlease support"
+       local ret=$?
+       [ $ret -eq 22 ] && _notrun "Require fcntl setlease support"
+       [ "$FSTYP" == "nfs" -a $ret -eq 11 ] && \
+               _notrun "NFS requires delegation before setlease"
 }
 
 _require_ofd_locks()