fstests: filter test and scratch together safely
authorMisono, Tomohiro <misono.tomohiro@jp.fujitsu.com>
Fri, 1 Sep 2017 05:39:44 +0000 (14:39 +0900)
committerEryu Guan <eguan@redhat.com>
Sun, 3 Sep 2017 04:20:00 +0000 (12:20 +0800)
commit948b1881f6ee5992503541a40ef20aaaf54aea06
treea58365ee209f516ee5f08c7bcd47fa4efe31ab44
parent0e641bc6ebcc524ae9e5eba47646d5876566e35b
fstests: filter test and scratch together safely

Several tests uses both _filter_test_dir and _filter_scratch
concatenated by pipe to filter $TEST_DIR and $SCRATCH_MNT. However,
this would fail if the shorter string is a substring of the other
(like "/mnt" and "/mnt2").

This patch introduces new common filter function to safely call both
_filter_test_dir and _filter_scratch, and update tests and functions
to use this new function.

I checked this with btrfs/029, generic/409,410,411, and
generic/381,383, xfs/106,108 (which calls _filter_quota). Thanks
Eryu for advice.

[eguan: folded 2nd patch into 1st patch and update commit log a bit]

Signed-off-by: Tomohiro Misono <misono.tomohiro@jp.fujitsu.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
common/filter
tests/btrfs/029
tests/generic/409
tests/generic/410
tests/generic/411