Skip to content

Commit 9e61bb0

Browse files
committed
NFS: Run on btrfs, ext4, xfs
Testing on more filesystems increase test coverage of underlaying filesystem on NFS server. Filesystems (tested the usual LTP way on loop device) are used for server side (exportfs), client side (NFS mount) is kept outside of it. Because there are some problems with at least vfat, exfat and tmpfs (on nfs-utils < 2) instead of testing on all available filesystems, test just on modern Linux filesystems btrfs, ext4, xfs. Use variables: * TST_ALL_FILESYSTEMS=1 to run on all filesystems * TST_FORMAT_DEVICE=1 to get loop device formatted * TST_MOUNT_DEVICE=1 to get it mounted For some reason umounting needs some time before NFS server stops using underlying loop device. Also exportfs needs time before files can be removed. Otherwise second umounting fails: nfs07 4 TINFO: Cleaning up testcase umount: /var/tmp/LTP_nfs07.FNZ7yCbqZe/mntpoint: target is busy. nfs07 4 TINFO: umount(/var/tmp/LTP_nfs07.FNZ7yCbqZe/mntpoint) failed, try 1 ... nfs07 4 TINFO: Likely gvfsd-trash is probing newly mounted fs, kill it to speed up tests. umount: /var/tmp/LTP_nfs07.FNZ7yCbqZe/mntpoint: target is busy. Solved with adding sleep for 2 sec after first umount and sleeps for 1 sec after exportfs. Second umount of the loop device in tst_test.sh works without any extra sleep. Link: https://lore.kernel.org/ltp/[email protected]/ Acked-by: Cyril Hrubis <[email protected]> Signed-off-by: Petr Vorel <[email protected]>
1 parent 9e1baca commit 9e61bb0

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

testcases/network/nfs/nfs_stress/nfs_lib.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ NFS_PARSE_ARGS_CALLER="$TST_PARSE_ARGS"
2828
TST_OPTS="v:t:$TST_OPTS"
2929
TST_PARSE_ARGS=nfs_parse_args
3030
TST_USAGE=nfs_usage
31-
TST_NEEDS_TMPDIR=1
31+
TST_ALL_FILESYSTEMS=1
32+
TST_SKIP_FILESYSTEMS="exfat,ext2,ext3,fuse,ntfs,vfat,tmpfs"
33+
TST_MOUNT_DEVICE=1
34+
TST_FORMAT_DEVICE=1
3235
TST_NEEDS_ROOT=1
3336
TST_NEEDS_CMDS="$TST_NEEDS_CMDS mount exportfs mount.nfs"
3437
TST_SETUP="${TST_SETUP:-nfs_setup}"
@@ -68,7 +71,7 @@ get_remote_dir()
6871
local v="$1"
6972
local n="$2"
7073

71-
echo "$TST_TMPDIR/$v/$n"
74+
echo "$TST_MNTPOINT/$v/$n"
7275
}
7376

7477
nfs_get_remote_path()
@@ -210,6 +213,7 @@ nfs_cleanup()
210213
grep -q "$local_dir" /proc/mounts && umount $local_dir
211214
n=$(( n + 1 ))
212215
done
216+
sleep 2
213217

214218
n=0
215219
for i in $VERSION; do
@@ -219,12 +223,15 @@ nfs_cleanup()
219223
if tst_net_use_netns; then
220224
if test -d $remote_dir; then
221225
exportfs -u *:$remote_dir
226+
sleep 1
222227
rm -rf $remote_dir
223228
fi
224229
else
225230
tst_rhost_run -c "test -d $remote_dir && exportfs -u *:$remote_dir"
231+
sleep 1
226232
tst_rhost_run -c "test -d $remote_dir && rm -rf $remote_dir"
227233
fi
234+
228235
n=$(( n + 1 ))
229236
done
230237
}

0 commit comments

Comments
 (0)