Date: Sat, 17 Dec 2016 03:47:10 +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-11@freebsd.org Subject: svn commit: r310188 - stable/11/contrib/netbsd-tests/fs/tmpfs Message-ID: <201612170347.uBH3lAUH054725@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201612170347.uBH3lAUH054725>