From patchwork Thu Jan 18 04:00:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhang Yi X-Patchwork-Id: 10172361 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 33DA9603B5 for ; Thu, 18 Jan 2018 03:53:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 289CF1FFE6 for ; Thu, 18 Jan 2018 03:53:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1CC70201F3; Thu, 18 Jan 2018 03:53:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 557971FFE6 for ; Thu, 18 Jan 2018 03:53:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753332AbeARDxf (ORCPT ); Wed, 17 Jan 2018 22:53:35 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:4656 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753228AbeARDxc (ORCPT ); Wed, 17 Jan 2018 22:53:32 -0500 Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id A6585AB901DE8; Thu, 18 Jan 2018 11:53:18 +0800 (CST) Received: from huawei.com (10.175.124.28) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.361.1; Thu, 18 Jan 2018 11:53:14 +0800 From: "zhangyi (F)" To: , CC: , , , , , Subject: [xfstest PATCH v4 7/7] overlay: replace _require_scratch() in optionally dirs cases Date: Thu, 18 Jan 2018 12:00:33 +0800 Message-ID: <20180118040033.19555-8-yi.zhang@huawei.com> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20180118040033.19555-1-yi.zhang@huawei.com> References: <20180118040033.19555-1-yi.zhang@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.124.28] X-CFilter-Loop: Reflected Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Replace _require_scratch() with _require_overlay_scratch_dirs() in overlay test cases that use optionally lower/upper/work test dirs, and check these dirs explicitly if necessary. Signed-off-by: zhangyi (F) --- tests/overlay/005 | 6 +++++- tests/overlay/010 | 6 +++++- tests/overlay/014 | 10 +++++++++- tests/overlay/035 | 6 +++++- tests/overlay/036 | 5 ++++- tests/overlay/037 | 6 +++++- tests/overlay/038 | 10 +++++++++- tests/overlay/041 | 10 +++++++++- tests/overlay/043 | 6 +++++- tests/overlay/044 | 6 +++++- 10 files changed, 61 insertions(+), 10 deletions(-) diff --git a/tests/overlay/005 b/tests/overlay/005 index 17992a3..58481d8 100755 --- a/tests/overlay/005 +++ b/tests/overlay/005 @@ -54,7 +54,7 @@ rm -f $seqres.full # Modify as appropriate. _supported_fs overlay _supported_os Linux -_require_scratch +_require_overlay_scratch_dirs _require_loop # Remove all files from previous tests @@ -102,6 +102,10 @@ $XFS_IO_PROG -f -c "o" ${SCRATCH_MNT}/test_file \ # unmount overlayfs $UMOUNT_PROG $SCRATCH_MNT +# We called _require_overlay_scratch_dirs instead of _require_scratch, +# do check optionally dirs after test +_overlay_check_dirs $lowerd $upperd $workd + # unmount undelying xfs, this tiggers panic if memleak happens $UMOUNT_PROG ${OVL_BASE_SCRATCH_MNT}/uppermnt $UMOUNT_PROG ${OVL_BASE_SCRATCH_MNT}/lowermnt diff --git a/tests/overlay/010 b/tests/overlay/010 index f55ebec..b4a4ee8 100755 --- a/tests/overlay/010 +++ b/tests/overlay/010 @@ -48,7 +48,7 @@ rm -f $seqres.full # real QA test starts here _supported_fs overlay _supported_os Linux -_require_scratch +_require_overlay_scratch_dirs # Remove all files from previous tests _scratch_mkfs @@ -70,6 +70,10 @@ mknod $lowerdir2/testdir/a c 0 0 _overlay_scratch_mount_dirs "$lowerdir2:$lowerdir1" $upperdir $workdir rm -rf $SCRATCH_MNT/testdir +# We called _require_overlay_scratch_dirs instead of _require_scratch, +# do check optionally dirs after test +_overlay_check_dirs "$lowerdir2:$lowerdir1" $upperdir $workdir + # success, all done echo "Silence is golden" status=0 diff --git a/tests/overlay/014 b/tests/overlay/014 index 9f308d3..cc97c96 100755 --- a/tests/overlay/014 +++ b/tests/overlay/014 @@ -53,7 +53,7 @@ rm -f $seqres.full # real QA test starts here _supported_fs overlay _supported_os Linux -_require_scratch +_require_overlay_scratch_dirs # Remove all files from previous tests _scratch_mkfs @@ -78,6 +78,10 @@ mkdir -p $SCRATCH_MNT/testdir/visibledir # unmount overlayfs but not base fs $UMOUNT_PROG $SCRATCH_MNT +# We called _require_overlay_scratch_dirs instead of _require_scratch, +# do check optionally dirs after each test +_overlay_check_dirs $lowerdir1 $lowerdir2 $workdir2 + # mount overlay again, with lowerdir1 and lowerdir2 as multiple lowerdirs, # and create a new file in testdir, triggers copyup from lowerdir, # copyup should not copy overlayfs private xattr @@ -90,6 +94,10 @@ $UMOUNT_PROG $SCRATCH_MNT _overlay_scratch_mount_dirs "$lowerdir2:$lowerdir1" $upperdir $workdir ls $SCRATCH_MNT/testdir +# We called _require_overlay_scratch_dirs instead of _require_scratch, +# do check optionally dirs after each test +_overlay_check_dirs "$lowerdir2:$lowerdir1" $upperdir $workdir + # success, all done status=0 exit diff --git a/tests/overlay/035 b/tests/overlay/035 index 0544774..96643ba 100755 --- a/tests/overlay/035 +++ b/tests/overlay/035 @@ -51,7 +51,7 @@ rm -f $seqres.full # real QA test starts here _supported_fs overlay _supported_os Linux -_require_scratch +_require_overlay_scratch_dirs _require_chattr i # Remove all files from previous tests @@ -81,6 +81,10 @@ _overlay_scratch_mount_dirs $lowerdir2 $upperdir $workdir touch $SCRATCH_MNT/bar 2>&1 | _filter_scratch _scratch_remount rw 2>&1 | _filter_ro_mount +# We called _require_overlay_scratch_dirs instead of _require_scratch, +# do check optionally dirs after test +_overlay_check_dirs $lowerdir2 $upperdir $workdir + # success, all done status=0 exit diff --git a/tests/overlay/036 b/tests/overlay/036 index e0c13ae..ca5adbd 100755 --- a/tests/overlay/036 +++ b/tests/overlay/036 @@ -69,7 +69,7 @@ rm -f $seqres.full # real QA test starts here _supported_fs overlay _supported_os Linux -_require_scratch +_require_overlay_scratch_dirs _require_scratch_feature index # Remove all files from previous tests @@ -110,6 +110,9 @@ _overlay_mount_dirs $lowerdir2 $upperdir $workdir2 \ _overlay_mount_dirs $lowerdir2 $upperdir2 $workdir \ overlay3 $SCRATCH_MNT -oindex=on 2>&1 | _filter_busy_mount +# We called _require_overlay_scratch_dirs instead of _require_scratch, +# but which will not lead to inconsistency after this mount test, +# so do not check optionally dirs after test # success, all done status=0 diff --git a/tests/overlay/037 b/tests/overlay/037 index 6710dda..60290a1 100755 --- a/tests/overlay/037 +++ b/tests/overlay/037 @@ -55,7 +55,7 @@ rm -f $seqres.full # real QA test starts here _supported_fs overlay _supported_os Linux -_require_scratch +_require_overlay_scratch_dirs _require_scratch_feature index # Remove all files from previous tests @@ -87,6 +87,10 @@ $UMOUNT_PROG $SCRATCH_MNT 2>/dev/null # Mount overlay with original lowerdir, upperdir, workdir and index=on - expect success _overlay_scratch_mount_dirs $lowerdir $upperdir $workdir -oindex=on +# We called _require_overlay_scratch_dirs instead of _require_scratch, +# but which will not lead to inconsistency after this mount test, +# so do not check optionally dirs after test + # success, all done status=0 exit diff --git a/tests/overlay/038 b/tests/overlay/038 index bd87156..6a0b0ba 100755 --- a/tests/overlay/038 +++ b/tests/overlay/038 @@ -46,7 +46,7 @@ _cleanup() # real QA test starts here _supported_fs overlay _supported_os Linux -_require_scratch +_require_overlay_scratch_dirs _require_attrs _require_test_program "t_dir_type" @@ -161,6 +161,10 @@ subdir_d=$($here/src/t_dir_type $pure_lower_dir $pure_lower_subdir_st_ino) [[ $subdir_d == "subdir d" ]] || \ echo "Merged dir: Invalid d_ino reported for subdir" +# We called _require_overlay_scratch_dirs instead of _require_scratch, +# do check after each test +_check_scratch_fs + _scratch_unmount # Verify pure lower residing in dir which has another lower layer @@ -202,6 +206,10 @@ 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" +# We called _require_overlay_scratch_dirs instead of _require_scratch, +# do check optionally dirs after each test +_overlay_check_dirs "$middir:$lowerdir" $upperdir $workdir + echo "Silence is golden" status=0 exit diff --git a/tests/overlay/041 b/tests/overlay/041 index 4152107..2775085 100755 --- a/tests/overlay/041 +++ b/tests/overlay/041 @@ -48,7 +48,7 @@ _cleanup() # real QA test starts here _supported_fs overlay _supported_os Linux -_require_scratch +_require_overlay_scratch_dirs _require_test _require_attrs _require_test_program "t_dir_type" @@ -167,6 +167,10 @@ subdir_d=$($here/src/t_dir_type $pure_lower_dir $pure_lower_subdir_st_ino) [[ $subdir_d == "subdir d" ]] || \ echo "Merged dir: Invalid d_ino reported for subdir" +# We called _require_overlay_scratch_dirs instead of _require_scratch, +# do check optionally dirs after each test +_overlay_check_dirs $lowerdir $upperdir $workdir + _scratch_unmount # Verify pure lower residing in dir which has another lower layer @@ -208,6 +212,10 @@ 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" +# We called _require_overlay_scratch_dirs instead of _require_scratch, +# do check optionally dirs after each test +_overlay_check_dirs $middir:$lowerdir $upperdir $workdir + echo "Silence is golden" status=0 exit diff --git a/tests/overlay/043 b/tests/overlay/043 index 858b6a9..e184e14 100755 --- a/tests/overlay/043 +++ b/tests/overlay/043 @@ -56,7 +56,7 @@ _cleanup() # real QA test starts here _supported_fs overlay _supported_os Linux -_require_scratch +_require_overlay_scratch_dirs _require_test _require_test_program "af_unix" _require_test_program "t_dir_type" @@ -155,6 +155,10 @@ _overlay_scratch_mount_dirs $lowerdir $upperdir $workdir \ # Compare inode numbers before/after mount cycle check_inode_numbers $testdir $tmp.after_move $tmp.after_cycle +# We called _require_overlay_scratch_dirs instead of _require_scratch, +# do check optionally dirs after test +_overlay_check_dirs $lowerdir $upperdir $workdir + echo "Silence is golden" status=0 exit diff --git a/tests/overlay/044 b/tests/overlay/044 index 9c0ff04..70fe824 100755 --- a/tests/overlay/044 +++ b/tests/overlay/044 @@ -49,7 +49,7 @@ _cleanup() # real QA test starts here _supported_fs overlay _supported_os Linux -_require_scratch +_require_overlay_scratch_dirs _require_test _require_scratch_feature index _require_test_program "t_dir_type" @@ -141,5 +141,9 @@ echo "== After write two ==" cat $FILES check_ino_nlink $SCRATCH_MNT $tmp.after_one $tmp.after_two +# We called _require_overlay_scratch_dirs instead of _require_scratch, +# do check optionally dirs after test +_overlay_check_dirs $lowerdir $upperdir $workdir + status=0 exit