overlay: correct scratch dirs check

Tests that use _overlay_scratch_mount_dirs instead of _scratch_mount
should use _require_scratch_nocheck instead of _require_scratch
because these tests are either mounting with multiple lower dirs or
mounting with non-default lower/upper/work dir, so
_check_overlay_scratch_fs won't handle these cases correctly. So we
introduce _overlay_check_scratch_dirs helper and should call this
helper with the correct dir arguments for these non-default cases.

This patch modify these tests to optionally call
_overlay_check_scratch_dirs at the end of the test or after
_scratch_umount to mount base filesystem only and run the checker.

Signed-off-by: zhangyi (F) <yi.zhang@huawei.com>
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
This commit is contained in:
zhangyi (F)
2018-03-01 20:13:47 +08:00
committed by Eryu Guan
parent 3ba014aaba
commit 697e465ca3
14 changed files with 122 additions and 16 deletions
+9 -1
View File
@@ -46,7 +46,9 @@ _cleanup()
# real QA test starts here
_supported_fs overlay
_supported_os Linux
_require_scratch
# Use non-default scratch underlying overlay dirs, we need to check
# them explicity after test.
_require_scratch_nocheck
_require_attrs
_require_test_program "t_dir_type"
@@ -163,6 +165,9 @@ subdir_d=$($here/src/t_dir_type $pure_lower_dir $pure_lower_subdir_st_ino)
_scratch_unmount
# check overlayfs
_check_scratch_fs
# Verify pure lower residing in dir which has another lower layer
_scratch_mkfs
@@ -202,6 +207,9 @@ subdir_d=$($here/src/t_dir_type $pure_lower_dir $pure_lower_subdir_st_ino)
[[ $subdir_d == "subdir d" ]] || \
echo "Pure lower in dir which has another lower layer: Invalid d_ino reported for subdir"
# check overlayfs
_overlay_check_scratch_dirs "$middir:$lowerdir" $upperdir $workdir
echo "Silence is golden"
status=0
exit