generic: add test for directory delegations
PATCH 1/1 generic: add test for directory delegations
With the advent of directory delegation support coming to the kernel, add support for testing them to the existing locktest.c program, and add testcases for all of the different ways that they can be broken.
Signed-off-by Jeff Layton <[email protected]>
---
Latest upstream posting of the dir delegation patchset is:
https://lore.kernel.org/linux-nfs/[email protected]/
--- common/locktest | 14 +- src/locktest.c | 429 ++++++++++++++++++++++++++++++++++++++++++++++++-- tests/generic/999 | 22 +++ tests/generic/999.out | 2 + 4 files changed, 452 insertions(+), 15 deletions(-)
common/locktest +11 -3
@@ -13,7 +13,7 @@ _cleanup() { kill $client_pid > /dev/null 2>&1 kill $server_pid > /dev/null 2>&1 - rm -f $TESTFILE + rm -rf $TESTFILE } _dump_logs_fail()
@@ -42,8 +42,6 @@ _run_generic() { rm -f $CLIENT_LOG touch $CLIENT_LOG - touch $TESTFILE - # Start the server $here/src/locktest $mode $TESTFILE 2> $SERVER_LOG 1> $SERVER_PORT & server_pid=$!
@@ -87,9 +85,19 @@ _run_generic() { } _run_locktest() { + touch $TESTFILE + _run_generic "" } _run_leasetest() { + touch $TESTFILE + _run_generic "-L" } + +_run_dirleasetest() { + TESTFILE=$TEST_DIR/lease_dir + mkdir -p $TESTFILE + _run_generic "-D -d" +}
src/locktest.c +417 -12
575 lines not on this page · raw message
tests/generic/999 new file +22 -0
@@ -0,0 +1,22 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) 2019 Intel, Corp. All Rights Reserved. +# +# FSQA Test No. XXX +# +# lease test +# +. ./common/preamble +_begin_fstest auto quick + +# Import common functions. +. ./common/filter +. ./common/locktest + +_require_test +_require_test_fcntl_advisory_locks +_require_test_fcntl_setlease + +_run_dirleasetest + +exit
tests/generic/999.out new file +2 -0
@@ -0,0 +1,2 @@ +QA output created by 999 +success!
---
base-commit: 911e9f16800437cc96349f85c6c916c9d8c2d317
change-id: 20251111-dir-deleg-ff05013ca540
Best regards,
Signature · 1 line
Jeff Layton <[email protected]>