Date: Fri, 9 Dec 2016 23:42:04 +0000 (UTC) From: Ngie Cooper <ngie@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309778 - head/contrib/netbsd-tests/fs/tmpfs Message-ID: <201612092342.uB9Ng4a9031885@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ngie Date: Fri Dec 9 23:42:04 2016 New Revision: 309778 URL: https://svnweb.freebsd.org/changeset/base/309778 Log: 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" MFC after: 1 week Modified: head/contrib/netbsd-tests/fs/tmpfs/h_funcs.subr Modified: head/contrib/netbsd-tests/fs/tmpfs/h_funcs.subr ============================================================================== --- head/contrib/netbsd-tests/fs/tmpfs/h_funcs.subr Fri Dec 9 23:37:14 2016 (r309777) +++ head/contrib/netbsd-tests/fs/tmpfs/h_funcs.subr Fri Dec 9 23:42:04 2016 (r309778) @@ -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] #
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201612092342.uB9Ng4a9031885>