summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorngie <ngie@FreeBSD.org>2015-04-11 09:05:42 +0000
committerngie <ngie@FreeBSD.org>2015-04-11 09:05:42 +0000
commit9292308b0f116e5bc3b49e00a01b19446a2ee352 (patch)
tree813b0a8aa611d04fed13533ea607ed8af141e24d /tests
parent4716abb1e97094430b15816bb9b7d23ff67d908e (diff)
downloadFreeBSD-src-9292308b0f116e5bc3b49e00a01b19446a2ee352.zip
FreeBSD-src-9292308b0f116e5bc3b49e00a01b19446a2ee352.tar.gz
Integration tools/regression/vfs into the FreeBSD test suite
Diffstat (limited to 'tests')
-rw-r--r--tests/sys/Makefile1
-rw-r--r--tests/sys/vfs/Makefile7
-rwxr-xr-xtests/sys/vfs/trailing_slash_test.sh41
3 files changed, 49 insertions, 0 deletions
diff --git a/tests/sys/Makefile b/tests/sys/Makefile
index b8e92c0..7131732 100644
--- a/tests/sys/Makefile
+++ b/tests/sys/Makefile
@@ -8,6 +8,7 @@ TESTS_SUBDIRS+= kern
TESTS_SUBDIRS+= netinet
TESTS_SUBDIRS+= opencrypto
TESTS_SUBDIRS+= sockets
+TESTS_SUBDIRS+= vfs
# Items not integrated into kyua runs by default
SUBDIR+= pjdfstest
diff --git a/tests/sys/vfs/Makefile b/tests/sys/vfs/Makefile
new file mode 100644
index 0000000..7cd908b
--- /dev/null
+++ b/tests/sys/vfs/Makefile
@@ -0,0 +1,7 @@
+# $FreeBSD$
+
+TESTSDIR= ${TESTSBASE}/sys/vfs
+
+TAP_TESTS_SH+= trailing_slash_test
+
+.include <bsd.test.mk>
diff --git a/tests/sys/vfs/trailing_slash_test.sh b/tests/sys/vfs/trailing_slash_test.sh
new file mode 100755
index 0000000..28c7f5f
--- /dev/null
+++ b/tests/sys/vfs/trailing_slash_test.sh
@@ -0,0 +1,41 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+# Tests vfs_lookup()'s handling of trailing slashes for symlinks that
+# point to files. See kern/21768 for details. Fixed in r193028.
+#
+
+testfile=$(mktemp tmp.XXXXXX) || exit
+testlink="testlink-$$"
+
+tests="
+$testfile:$testlink:$testfile:0
+$testfile:$testlink:$testfile/:1
+$testfile:$testlink:$testlink:0
+$testfile:$testlink:$testlink/:1
+$testfile/:$testlink:$testlink:1
+$testfile/:$testlink:$testlink/:1
+"
+
+trap "rm $testfile $testlink" EXIT
+
+set $tests
+echo "1..$#"
+n=1
+for testspec ; do
+ (
+ IFS=:
+ set $testspec
+ unset IFS
+ ln -fs "$1" "$2" || exit 1
+ cat "$3" >/dev/null 2>&1
+ ret=$?
+ if [ "$ret" -eq "$4" ] ; then
+ echo "ok $n"
+ else
+ echo "fail $n - expected $4, got $ret"
+ fi
+ )
+ n=$((n+1))
+done
OpenPOWER on IntegriCloud