All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] generic/565: change to use filter _filter_testdir_and_scratch
@ 2020-04-03  0:32 Yongcheng Yang
  2020-04-03  3:49 ` Zorro Lang
  0 siblings, 1 reply; 2+ messages in thread
From: Yongcheng Yang @ 2020-04-03  0:32 UTC (permalink / raw)
  To: fstests; +Cc: Amir Goldstein, Yongcheng Yang

If $TEST_DIR is a substring of $SCRATCH_MNT (like /mnt and /mnt2),
this test always fail. Change to use _filter_testdir_and_scratch
which will filter the longer string first if the other string is a
substring of the longer one.

Signed-off-by: Yongcheng Yang <yongcheng.yang@gmail.com>
---

Previously it failed with 565.out.bad:
~~~
QA output created by 565
md5sums after xdev copy:
81615449a98aaaad8dc179b3bec87f38  TEST_DIR/test-565/file
81615449a98aaaad8dc179b3bec87f38  TEST_DIR2/copy
~~~

It can pass with this patch:
~~~
[09:18:16 root@ /var/lib/xfstests]# DIFF_LENGTH=-0 ./check -nfs generic/565
FSTYP         -- nfs
PLATFORM      -- Linux/x86_64 kvm-guest 4.18.0-193.el8.x86_64 #1 SMP Fri Mar 27 14:35:58 UTC 2020
MKFS_OPTIONS  -- test-machine.com:/export-xfstests/dir2
MOUNT_OPTIONS -- -overs=4 -o context=system_u:object_r:root_t:s0 test-machine.com:/export-xfstests/dir2 /mnt/nfsmp2

generic/565	 10s
Ran: generic/565
Passed all 1 tests
~~~

Thanks,
Yongcheng

 tests/generic/565 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/generic/565 b/tests/generic/565
index 39eb20c8..41d85b91 100755
--- a/tests/generic/565
+++ b/tests/generic/565
@@ -57,7 +57,7 @@ echo $testio | grep -q "cross-device" && \
 echo -n $testio
 cmp $testdir/file $SCRATCH_MNT/copy
 echo "md5sums after xdev copy:"
-md5sum $testdir/file $SCRATCH_MNT/copy | _filter_test_dir | _filter_scratch
+md5sum $testdir/file $SCRATCH_MNT/copy | _filter_testdir_and_scratch
 
 # success, all done
 status=0
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] generic/565: change to use filter _filter_testdir_and_scratch
  2020-04-03  0:32 [PATCH] generic/565: change to use filter _filter_testdir_and_scratch Yongcheng Yang
@ 2020-04-03  3:49 ` Zorro Lang
  0 siblings, 0 replies; 2+ messages in thread
From: Zorro Lang @ 2020-04-03  3:49 UTC (permalink / raw)
  To: Yongcheng Yang; +Cc: fstests

On Fri, Apr 03, 2020 at 08:32:31AM +0800, Yongcheng Yang wrote:
> If $TEST_DIR is a substring of $SCRATCH_MNT (like /mnt and /mnt2),
> this test always fail. Change to use _filter_testdir_and_scratch
> which will filter the longer string first if the other string is a
> substring of the longer one.
> 
> Signed-off-by: Yongcheng Yang <yongcheng.yang@gmail.com>
> ---
> 
> Previously it failed with 565.out.bad:
> ~~~
> QA output created by 565
> md5sums after xdev copy:
> 81615449a98aaaad8dc179b3bec87f38  TEST_DIR/test-565/file
> 81615449a98aaaad8dc179b3bec87f38  TEST_DIR2/copy
> ~~~
> 
> It can pass with this patch:
> ~~~
> [09:18:16 root@ /var/lib/xfstests]# DIFF_LENGTH=-0 ./check -nfs generic/565
> FSTYP         -- nfs
> PLATFORM      -- Linux/x86_64 kvm-guest 4.18.0-193.el8.x86_64 #1 SMP Fri Mar 27 14:35:58 UTC 2020
> MKFS_OPTIONS  -- test-machine.com:/export-xfstests/dir2
> MOUNT_OPTIONS -- -overs=4 -o context=system_u:object_r:root_t:s0 test-machine.com:/export-xfstests/dir2 /mnt/nfsmp2
> 
> generic/565	 10s
> Ran: generic/565
> Passed all 1 tests
> ~~~
> 
> Thanks,
> Yongcheng
> 
>  tests/generic/565 | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tests/generic/565 b/tests/generic/565
> index 39eb20c8..41d85b91 100755
> --- a/tests/generic/565
> +++ b/tests/generic/565
> @@ -57,7 +57,7 @@ echo $testio | grep -q "cross-device" && \
>  echo -n $testio
>  cmp $testdir/file $SCRATCH_MNT/copy
>  echo "md5sums after xdev copy:"
> -md5sum $testdir/file $SCRATCH_MNT/copy | _filter_test_dir | _filter_scratch
> +md5sum $testdir/file $SCRATCH_MNT/copy | _filter_testdir_and_scratch

Looks good to me.

If a case need to filter scratch and test together, it really need to use
_filter_testdir_and_scratch. I've check all xfstests cases:

  $ grep -rsn _filter_scratch tests/|grep _filter_test
  tests/generic/565:60:md5sum $testdir/file $SCRATCH_MNT/copy | _filter_test_dir | _filter_scratch

Good news is only g/565 use _filter_test_dir and _filter_scratch together now.
So we don't need to change other cases likes this patch.

Reviewed-by: Zorro Lang <zlang@redhat.com>

Thanks,
Zorro

>  
>  # success, all done
>  status=0
> -- 
> 2.20.1
> 


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-04-03  3:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-03  0:32 [PATCH] generic/565: change to use filter _filter_testdir_and_scratch Yongcheng Yang
2020-04-03  3:49 ` Zorro Lang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.