From owner-svn-src-stable@freebsd.org Fri Feb 10 03:04:43 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6B48CD9478; Fri, 10 Feb 2017 03:04:43 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BE55B27C; Fri, 10 Feb 2017 03:04:43 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1A34gR3015349; Fri, 10 Feb 2017 03:04:42 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1A34gsi015344; Fri, 10 Feb 2017 03:04:42 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201702100304.v1A34gsi015344@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 10 Feb 2017 03:04:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r313518 - stable/10/contrib/netbsd-tests/fs/tmpfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2017 03:04:44 -0000 Author: ngie Date: Fri Feb 10 03:04:42 2017 New Revision: 313518 URL: https://svnweb.freebsd.org/changeset/base/313518 Log: MFC r309774,r309778,r309779,r309780: r309774: Only run mdconfig -d -u 3 if /dev/md3 exists on the system This will prevent "cleanup failures" (exit code != 0 returned) when tmpfs is not loaded r309778: Make test_unmount usable in cleanup subroutines - Duplicate test_unmount to _test_unmount - Remove atf_check calls - Call _test_unmount from test_unmount, checking the exit code at the end, and returning it to maintain the test_unmount "contract" r309779: - Ignore errors from umount - Use _test_unmount instead of test_unmount in cleanup r309780: Use _test_unmount instead of test_unmount in cleanup to avoid false positives with atf_check when tmpfs is not loaded, etc Modified: stable/10/contrib/netbsd-tests/fs/tmpfs/h_funcs.subr stable/10/contrib/netbsd-tests/fs/tmpfs/t_link.sh stable/10/contrib/netbsd-tests/fs/tmpfs/t_mount.sh stable/10/contrib/netbsd-tests/fs/tmpfs/t_remove.sh stable/10/contrib/netbsd-tests/fs/tmpfs/t_vnd.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/netbsd-tests/fs/tmpfs/h_funcs.subr ============================================================================== --- stable/10/contrib/netbsd-tests/fs/tmpfs/h_funcs.subr Fri Feb 10 02:57:37 2017 (r313517) +++ stable/10/contrib/netbsd-tests/fs/tmpfs/h_funcs.subr Fri Feb 10 03:04:42 2017 (r313518) @@ -59,12 +59,31 @@ test_mount() { # Unmounts the file system mounted by test_mount. # test_unmount() { + # Begin FreeBSD + _test_unmount + exit_code=$? + atf_check_equal "$exit_code" "0" + return $exit_code + # End FreeBSD cd - >/dev/null atf_check -s eq:0 -o empty -e empty umount ${Mount_Point} atf_check -s eq:0 -o empty -e empty rmdir ${Mount_Point} Mount_Point= } +# Begin FreeBSD +_test_unmount() { + if [ -z "${Mount_Point}" -o ! -d "${Mount_Point}" ]; then + return 0 + fi + + cd - >/dev/null + umount ${Mount_Point} + rmdir ${Mount_Point} + Mount_Point= +} +# End FreeBSD + # # kqueue_monitor expected_nevents file1 [.. fileN] # Modified: stable/10/contrib/netbsd-tests/fs/tmpfs/t_link.sh ============================================================================== --- stable/10/contrib/netbsd-tests/fs/tmpfs/t_link.sh Fri Feb 10 02:57:37 2017 (r313517) +++ stable/10/contrib/netbsd-tests/fs/tmpfs/t_link.sh Fri Feb 10 03:04:42 2017 (r313518) @@ -97,7 +97,7 @@ subdirs_body() { if true; then atf_test_case kqueue cleanup kqueue_cleanup() { - Mount_Point=$(pwd)/mntpt test_unmount || : + Mount_Point=$(pwd)/mntpt _test_unmount || : } else # End FreeBSD Modified: stable/10/contrib/netbsd-tests/fs/tmpfs/t_mount.sh ============================================================================== --- stable/10/contrib/netbsd-tests/fs/tmpfs/t_mount.sh Fri Feb 10 02:57:37 2017 (r313517) +++ stable/10/contrib/netbsd-tests/fs/tmpfs/t_mount.sh Fri Feb 10 03:04:42 2017 (r313518) @@ -97,7 +97,8 @@ negative_body() { if true; then atf_test_case large cleanup large_cleanup() { - umount -f tmp 2>/dev/null + umount -f tmp 2>/dev/null || : + Mount_Point=$(pwd)/mnt _test_unmount || : } else # End FreeBSD Modified: stable/10/contrib/netbsd-tests/fs/tmpfs/t_remove.sh ============================================================================== --- stable/10/contrib/netbsd-tests/fs/tmpfs/t_remove.sh Fri Feb 10 02:57:37 2017 (r313517) +++ stable/10/contrib/netbsd-tests/fs/tmpfs/t_remove.sh Fri Feb 10 03:04:42 2017 (r313518) @@ -50,7 +50,7 @@ single_body() { if true; then atf_test_case uchg cleanup uchg_cleanup() { - Mount_Point=$(pwd)/mntpt test_unmount || : + Mount_Point=$(pwd)/mntpt _test_unmount } else # End FreeBSD Modified: stable/10/contrib/netbsd-tests/fs/tmpfs/t_vnd.sh ============================================================================== --- stable/10/contrib/netbsd-tests/fs/tmpfs/t_vnd.sh Fri Feb 10 02:57:37 2017 (r313517) +++ stable/10/contrib/netbsd-tests/fs/tmpfs/t_vnd.sh Fri Feb 10 03:04:42 2017 (r313518) @@ -85,7 +85,7 @@ basic_cleanup() { umount mnt 2>/dev/null 1>&2 # Begin FreeBSD if true; then - atf_check -s eq:0 -o empty -e empty mdconfig -d -u 3 + [ ! -c /dev/md3 ] || mdconfig -d -u 3 else # End FreeBSD vndconfig -u /dev/vnd3 2>/dev/null 1>&2