diff mbox series

nfs02: Add subtest for O_DIRECT

Message ID 20240528124756.18977-1-mdoucha@suse.cz
State Accepted
Headers show
Series nfs02: Add subtest for O_DIRECT | expand

Commit Message

Martin Doucha May 28, 2024, 12:47 p.m. UTC
Signed-off-by: Martin Doucha <mdoucha@suse.cz>
---
 testcases/network/nfs/nfs_stress/nfs02.sh | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

Comments

Petr Vorel June 5, 2024, 1:38 p.m. UTC | #1
Hi Martin,

> Signed-off-by: Martin Doucha <mdoucha@suse.cz>
> ---
>  testcases/network/nfs/nfs_stress/nfs02.sh | 15 ++++++++++++++-
>  1 file changed, 14 insertions(+), 1 deletion(-)

> diff --git a/testcases/network/nfs/nfs_stress/nfs02.sh b/testcases/network/nfs/nfs_stress/nfs02.sh
> index b7fbbce9c..100909790 100755
> --- a/testcases/network/nfs/nfs_stress/nfs02.sh
> +++ b/testcases/network/nfs/nfs_stress/nfs02.sh
> @@ -8,7 +8,7 @@

>  # Ported by: Robbie Williamson (robbiew@us.ibm.com)

> -TST_CNT=3
> +TST_CNT=4
>  TST_TESTFUNC="do_test"
>  LTP_DATAFILES="$LTPROOT/testcases/bin/datafiles"

> @@ -46,5 +46,18 @@ do_test3()
>  	tst_res TPASS "test3 passed"
>  }

> +do_test4()
> +{

I suggest to add here before merge:

tst_require_cmds dd diff

Thank you for this test!
Reviewed-by: Petr Vorel <pvorel@suse.cz>

Kind regards,
Petr

> +	tst_res TINFO "do_test4, copy data in direct mode"
> +	ROD dd oflag=direct if="$LTP_DATAFILES/ascii.jmb" of=ascii2.jmb
> +	echo 3 >/proc/sys/vm/drop_caches
> +	ROD dd iflag=direct if=ascii2.jmb of="$TST_TMPDIR/ascii2.jmb"
> +	echo 3 >/proc/sys/vm/drop_caches
> +	tst_res TINFO "compare both ascii.jmbs"
> +	ROD diff "$LTP_DATAFILES/ascii.jmb" ascii2.jmb
> +	ROD diff "$LTP_DATAFILES/ascii.jmb" "$TST_TMPDIR/ascii2.jmb"
> +	tst_res TPASS "test4 passed"
> +}
> +
>  . nfs_lib.sh
>  tst_run
Martin Doucha June 5, 2024, 1:46 p.m. UTC | #2
On 05. 06. 24 15:38, Petr Vorel wrote:
> Hi Martin,
> 
>> @@ -46,5 +46,18 @@ do_test3()
>>   	tst_res TPASS "test3 passed"
>>   }
> 
>> +do_test4()
>> +{
> 
> I suggest to add here before merge:
> 
> tst_require_cmds dd diff

Please do. Thanks.
Petr Vorel June 5, 2024, 7:16 p.m. UTC | #3
Hi Martin,

> > I suggest to add here before merge:

> > tst_require_cmds dd diff

> Please do. Thanks.

Merged with this change.
Thanks a lot for this test!

Kind regards,
Petr
diff mbox series

Patch

diff --git a/testcases/network/nfs/nfs_stress/nfs02.sh b/testcases/network/nfs/nfs_stress/nfs02.sh
index b7fbbce9c..100909790 100755
--- a/testcases/network/nfs/nfs_stress/nfs02.sh
+++ b/testcases/network/nfs/nfs_stress/nfs02.sh
@@ -8,7 +8,7 @@ 
 #
 # Ported by: Robbie Williamson (robbiew@us.ibm.com)
 
-TST_CNT=3
+TST_CNT=4
 TST_TESTFUNC="do_test"
 LTP_DATAFILES="$LTPROOT/testcases/bin/datafiles"
 
@@ -46,5 +46,18 @@  do_test3()
 	tst_res TPASS "test3 passed"
 }
 
+do_test4()
+{
+	tst_res TINFO "do_test4, copy data in direct mode"
+	ROD dd oflag=direct if="$LTP_DATAFILES/ascii.jmb" of=ascii2.jmb
+	echo 3 >/proc/sys/vm/drop_caches
+	ROD dd iflag=direct if=ascii2.jmb of="$TST_TMPDIR/ascii2.jmb"
+	echo 3 >/proc/sys/vm/drop_caches
+	tst_res TINFO "compare both ascii.jmbs"
+	ROD diff "$LTP_DATAFILES/ascii.jmb" ascii2.jmb
+	ROD diff "$LTP_DATAFILES/ascii.jmb" "$TST_TMPDIR/ascii2.jmb"
+	tst_res TPASS "test4 passed"
+}
+
 . nfs_lib.sh
 tst_run