Date: Sun, 23 Nov 2008 20:02:14 +0000 (UTC) From: Pawel Jakub Dawidek <pjd@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r185223 - head/tools/regression/fstest/tests Message-ID: <200811232002.mANK2EWx062621@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: pjd Date: Sun Nov 23 20:02:14 2008 New Revision: 185223 URL: http://svn.freebsd.org/changeset/base/185223 Log: fstest for Linux: Automatically detect file system type. Modified: head/tools/regression/fstest/tests/conf Modified: head/tools/regression/fstest/tests/conf ============================================================================== --- head/tools/regression/fstest/tests/conf Sun Nov 23 19:59:42 2008 (r185222) +++ head/tools/regression/fstest/tests/conf Sun Nov 23 20:02:14 2008 (r185223) @@ -4,5 +4,29 @@ # Known operating systems: FreeBSD, SunOS, Linux os=`uname` -# Known file systems: UFS, ZFS, other -fs="UFS" +case "${os}" in +FreeBSD|Darwin) + #fs=`df -T . | tail -1 | awk '{print $2}'` + pattern="`df . | tail -1 | awk '{printf("%s on %s \n", $1, $6)}'`" + fs=`mount | egrep "^${pattern}" | awk -F '[(,]' '{print $2}'` + ;; +Solaris) + pattern="`df -k . | tail -1 | awk '{printf("%s on %s \n", $1, $6)}'`" + fs=`mount -v | egrep "^${pattern}" | awk '{print $5}'` + ;; +Linux) + fs=`df -PT . | tail -1 | awk '{print $2}'` + ;; +*) + echo "Unsupported operating system ${os}." >/dev/stderr + exit 1 + ;; +esac + +# If we cannot figure out file system type, define it here. +#fs="UFS" + +if [ -z "${fs}" ]; then + echo "Cannot figure out file system type, define it by hand." >/dev/stderr + exit 1 +fi
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200811232002.mANK2EWx062621>