diff options
Diffstat (limited to 'tests/conf')
-rw-r--r-- | tests/conf | 34 |
1 files changed, 29 insertions, 5 deletions
diff --git a/tests/conf b/tests/conf index adb6cd6fb9b53..cf8fb8be0247c 100644 --- a/tests/conf +++ b/tests/conf @@ -1,15 +1,40 @@ # $FreeBSD: head/tools/regression/pjdfstest/tests/conf 211354 2010-08-15 21:29:03Z pjd $ +# vim: filetype=sh noexpandtab ts=8 sw=8 # pjdfstest configuration file # Supported operating systems: FreeBSD, Darwin, SunOS, Linux os=`uname` +unsupported_os() +{ + echo "Unsupported operating system ${os}." >/dev/stderr + exit 1 +} + +get_mountpoint() +{ + case "${os}" in + Darwin|FreeBSD) + df . | tail -1 | awk '{print $NF}' + ;; + *) + unsupported_os + ;; + esac +} + case "${os}" in -FreeBSD|Darwin) +Darwin) GREP=grep #fs=`df -T . | tail -1 | awk '{print $2}'` - pattern="`df . | tail -1 | awk '{printf("%s on %s \n", $1, $6)}'`" - fs=`mount | ${GREP} -E "^${pattern}" | awk -F '[(,]' '{print toupper($2)}'` + mountpoint="`get_mountpoint`" + fs=`mount | grep "on $mountpoint" | sed -e 's/.*(//' -e 's/,.*//g' | tr '[:lower:]' '[:upper:]'` + ;; +FreeBSD) + GREP=grep + #fs=`df -T . | tail -1 | awk '{print $2}'` + mountpoint="`get_mountpoint`" + fs=`mount -p | awk '$2 == "'$mountpoint'" { print toupper($3) }'` ;; Solaris|SunOS) GREP=ggrep @@ -22,8 +47,7 @@ Linux) fs=`df -PT . | tail -1 | awk '{print toupper($2)}'` ;; *) - echo "Unsupported operating system ${os}." >/dev/stderr - exit 1 + unsupported_os ;; esac |