• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/sh
2# SPDX-License-Identifier: GPL-2.0-or-later
3# Copyright (C) 2024 SUSE LLC <mdoucha@suse.cz>
4#
5# DESCRIPTION: Verify data integrity over NFS, with and without O_DIRECT
6
7TST_CNT=4
8TST_SETUP="nfs10_setup"
9TST_TESTFUNC="do_test"
10TST_DEVICE_SIZE=1024
11TST_TIMEOUT=660
12
13nfs10_setup()
14{
15	local bsize=$(stat -f -c %s .)
16
17	if [ -z "$bsize" ] || [ "$bsize" -lt 1024 ]; then
18		bsize=1024
19	fi
20
21	NFS_MOUNT_OPTS="rsize=$bsize,wsize=$bsize"
22	nfs_setup
23}
24
25do_test1()
26{
27	tst_res TINFO "Testing buffered write, buffered read"
28	EXPECT_PASS fsplough -c 512 -d "$PWD"
29}
30
31do_test2()
32{
33	tst_res TINFO "Testing buffered write, direct read"
34	EXPECT_PASS fsplough -c 512 -R -d "$PWD"
35}
36
37do_test3()
38{
39	tst_res TINFO "Testing direct write, buffered read"
40	EXPECT_PASS fsplough -c 512 -W -d "$PWD"
41}
42
43do_test4()
44{
45	tst_res TINFO "Testing direct write, direct read"
46	EXPECT_PASS fsplough -c 512 -RW -d "$PWD"
47}
48
49. nfs_lib.sh
50tst_run
51