-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test for data integrity over NFS
Add NFS test which checks data integrity of random writes into a file, with both buffered and direct I/O. Link: https://lore.kernel.org/ltp/[email protected]/ Reviewed-by: Petr Vorel <[email protected]> Signed-off-by: Martin Doucha <[email protected]>
- Loading branch information
Showing
2 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#!/bin/sh | ||
# SPDX-License-Identifier: GPL-2.0-or-later | ||
# Copyright (C) 2024 SUSE LLC <[email protected]> | ||
# | ||
# DESCRIPTION: Verify data integrity over NFS, with and without O_DIRECT | ||
|
||
TST_CNT=4 | ||
TST_SETUP="nfs10_setup" | ||
TST_TESTFUNC="do_test" | ||
TST_DEVICE_SIZE=1024 | ||
TST_TIMEOUT=660 | ||
|
||
nfs10_setup() | ||
{ | ||
local bsize=$(stat -f -c %s .) | ||
|
||
if [ -z "$bsize" ] || [ "$bsize" -lt 1024 ]; then | ||
bsize=1024 | ||
fi | ||
|
||
NFS_MOUNT_OPTS="rsize=$bsize,wsize=$bsize" | ||
nfs_setup | ||
} | ||
|
||
do_test1() | ||
{ | ||
tst_res TINFO "Testing buffered write, buffered read" | ||
EXPECT_PASS fsplough -c 512 -d "$PWD" | ||
} | ||
|
||
do_test2() | ||
{ | ||
tst_res TINFO "Testing buffered write, direct read" | ||
EXPECT_PASS fsplough -c 512 -R -d "$PWD" | ||
} | ||
|
||
do_test3() | ||
{ | ||
tst_res TINFO "Testing direct write, buffered read" | ||
EXPECT_PASS fsplough -c 512 -W -d "$PWD" | ||
} | ||
|
||
do_test4() | ||
{ | ||
tst_res TINFO "Testing direct write, direct read" | ||
EXPECT_PASS fsplough -c 512 -RW -d "$PWD" | ||
} | ||
|
||
. nfs_lib.sh | ||
tst_run |