Date: Fri, 10 Feb 2017 03:04:42 +0000 (UTC) From: Ngie Cooper <ngie@FreeBSD.org> 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 Message-ID: <201702100304.v1A34gsi015344@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201702100304.v1A34gsi015344>