summaryrefslogtreecommitdiffstats
path: root/tools/regression/fstest/tests
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2008-11-23 20:02:14 +0000
committerpjd <pjd@FreeBSD.org>2008-11-23 20:02:14 +0000
commit9b9475924e37a41f9795b32dc2d6004623b943a6 (patch)
tree8616a4f0569099d355392a0e37875f13a43928d0 /tools/regression/fstest/tests
parent6b89e95c0fc4a4efc4c5316066fb8f55062f060d (diff)
downloadFreeBSD-src-9b9475924e37a41f9795b32dc2d6004623b943a6.zip
FreeBSD-src-9b9475924e37a41f9795b32dc2d6004623b943a6.tar.gz
fstest for Linux:
Automatically detect file system type.
Diffstat (limited to 'tools/regression/fstest/tests')
-rw-r--r--tools/regression/fstest/tests/conf28
1 files changed, 26 insertions, 2 deletions
diff --git a/tools/regression/fstest/tests/conf b/tools/regression/fstest/tests/conf
index 54183e4..73496e3 100644
--- a/tools/regression/fstest/tests/conf
+++ b/tools/regression/fstest/tests/conf
@@ -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
OpenPOWER on IntegriCloud