svn commit: r192849 - head/tools/regression/vfs
Dag-Erling Smorgrav
des at FreeBSD.org
Tue May 26 20:13:08 UTC 2009
Author: des
Date: Tue May 26 20:13:06 2009
New Revision: 192849
URL: http://svn.freebsd.org/changeset/base/192849
Log:
Add a regression test for kern/21768.
MFC after: 1 week
Added:
head/tools/regression/vfs/
head/tools/regression/vfs/trailing_slash.t (contents, props changed)
Added: head/tools/regression/vfs/trailing_slash.t
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/tools/regression/vfs/trailing_slash.t Tue May 26 20:13:06 2009 (r192849)
@@ -0,0 +1,42 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+# Tests vfs_lookup()'s handling of trailing slashes for symlinks that
+# point to files. See kern/21768
+#
+
+testfile="/tmp/testfile-$$"
+testlink="/tmp/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
+"
+
+touch $testfile || exit 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
More information about the svn-src-head
mailing list