Skip to content

Commit

Permalink
Add test for data integrity over NFS
Browse files Browse the repository at this point in the history
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
mdoucha authored and pevik committed Dec 6, 2024
1 parent f9ee955 commit 0aebcaf
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 0 deletions.
11 changes: 11 additions & 0 deletions runtest/net.nfs
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,17 @@ nfs09_v40_ip6t nfs09.sh -6 -v 4 -t tcp
nfs09_v41_ip6t nfs09.sh -6 -v 4.1 -t tcp
nfs09_v42_ip6t nfs09.sh -6 -v 4.2 -t tcp

nfs10_v30_ip4u nfs10.sh -v 3 -t udp
nfs10_v30_ip4t nfs10.sh -v 3 -t tcp
nfs10_v40_ip4t nfs10.sh -v 4 -t tcp
nfs10_v41_ip4t nfs10.sh -v 4.1 -t tcp
nfs10_v42_ip4t nfs10.sh -v 4.2 -t tcp
nfs10_v30_ip6u nfs10.sh -6 -v 3 -t udp
nfs10_v30_ip6t nfs10.sh -6 -v 3 -t tcp
nfs10_v40_ip6t nfs10.sh -6 -v 4 -t tcp
nfs10_v41_ip6t nfs10.sh -6 -v 4.1 -t tcp
nfs10_v42_ip6t nfs10.sh -6 -v 4.2 -t tcp

nfslock01_v30_ip4u nfslock01.sh -v 3 -t udp
nfslock01_v30_ip4t nfslock01.sh -v 3 -t tcp
nfslock01_v40_ip4t nfslock01.sh -v 4 -t tcp
Expand Down
50 changes: 50 additions & 0 deletions testcases/network/nfs/nfs_stress/nfs10.sh
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

0 comments on commit 0aebcaf

Please sign in to comment.