From owner-svn-src-stable-11@freebsd.org Sat Dec 17 03:47:11 2016 Return-Path: Delivered-To: svn-src-stable-11@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 93732C8464E; Sat, 17 Dec 2016 03:47:11 +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 6DFCB8E5; Sat, 17 Dec 2016 03:47:11 +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 uBH3lAB1054730; Sat, 17 Dec 2016 03:47:10 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBH3lAUH054725; Sat, 17 Dec 2016 03:47:10 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612170347.uBH3lAUH054725@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 17 Dec 2016 03:47:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310188 - stable/11/contrib/netbsd-tests/fs/tmpfs X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Dec 2016 03:47:11 -0000 Author: ngie Date: Sat Dec 17 03:47:09 2016 New Revision: 310188 URL: https://svnweb.freebsd.org/changeset/base/310188 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/11/contrib/netbsd-tests/fs/tmpfs/h_funcs.subr stable/11/contrib/netbsd-tests/fs/tmpfs/t_link.sh stable/11/contrib/netbsd-tests/fs/tmpfs/t_mount.sh stable/11/contrib/netbsd-tests/fs/tmpfs/t_remove.sh stable/11/contrib/netbsd-tests/fs/tmpfs/t_vnd.sh Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/netbsd-tests/fs/tmpfs/h_funcs.subr ============================================================================== --- stable/11/contrib/netbsd-tests/fs/tmpfs/h_funcs.subr Sat Dec 17 03:41:16 2016 (r310187) +++ stable/11/contrib/netbsd-tests/fs/tmpfs/h_funcs.subr Sat Dec 17 03:47:09 2016 (r310188) @@ -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/11/contrib/netbsd-tests/fs/tmpfs/t_link.sh ============================================================================== --- stable/11/contrib/netbsd-tests/fs/tmpfs/t_link.sh Sat Dec 17 03:41:16 2016 (r310187) +++ stable/11/contrib/netbsd-tests/fs/tmpfs/t_link.sh Sat Dec 17 03:47:09 2016 (r310188) @@ -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/11/contrib/netbsd-tests/fs/tmpfs/t_mount.sh ============================================================================== --- stable/11/contrib/netbsd-tests/fs/tmpfs/t_mount.sh Sat Dec 17 03:41:16 2016 (r310187) +++ stable/11/contrib/netbsd-tests/fs/tmpfs/t_mount.sh Sat Dec 17 03:47:09 2016 (r310188) @@ -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/11/contrib/netbsd-tests/fs/tmpfs/t_remove.sh ============================================================================== --- stable/11/contrib/netbsd-tests/fs/tmpfs/t_remove.sh Sat Dec 17 03:41:16 2016 (r310187) +++ stable/11/contrib/netbsd-tests/fs/tmpfs/t_remove.sh Sat Dec 17 03:47:09 2016 (r310188) @@ -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/11/contrib/netbsd-tests/fs/tmpfs/t_vnd.sh ============================================================================== --- stable/11/contrib/netbsd-tests/fs/tmpfs/t_vnd.sh Sat Dec 17 03:41:16 2016 (r310187) +++ stable/11/contrib/netbsd-tests/fs/tmpfs/t_vnd.sh Sat Dec 17 03:47:09 2016 (r310188) @@ -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