freebsd-dev/contrib/pjdfstest/tests/conf
Enji Cooper 3416500aef Pull down pjdfstest 0.1
The summary of changes is as follows..

Generic changes::
- Added configure support [2].
- Check for lchmod filesystem support with create_file(..); for
  testcases that require lchmod, skip the testcase -- otherwise
  use chmod directly [1].
- Added Travis CI integration [2].
- Added utimensat testcases [1].

Linux support::
- Fixed Linux support to pass on later supported versions of
  Fedora/Ubuntu [2].
- Conditionally enable posix_fallocate(2) support [2].

OSX support::
- Fixed compilation on OSX [2].
- Added partial OSX support (the test run isn't fully green yet)
  [2].

MFC after:	2 months
Obtained from:	https://github.com/pjd/pjdfstest/tree/0.1
Relnotes:	yes
Submitted by:	asomers [1], ngie [2]
Tested with:	UFS, ZFS
2017-06-28 09:22:45 +00:00

61 lines
1.3 KiB
Bash

# $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
Darwin)
GREP=grep
#fs=`df -T . | tail -1 | awk '{print $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
pattern=`df -Pk . | tail -1 | awk '{printf("%s on %s \n", $1, $6)}'`
fs=`mount -v | ${GREP} -E "^${pattern}" | awk '{print $5}' | \
tr -s '[:lower:]' '[:upper:]'`
;;
Linux)
GREP=grep
fs=`df -PT . | tail -1 | awk '{print toupper($2)}'`
;;
*)
unsupported_os
;;
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