2009-05-26 20:13:06 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# $FreeBSD$
|
|
|
|
#
|
|
|
|
# Tests vfs_lookup()'s handling of trailing slashes for symlinks that
|
2014-04-26 12:16:40 +00:00
|
|
|
# point to files. See kern/21768 for details. Fixed in r193028.
|
2009-05-26 20:13:06 +00:00
|
|
|
#
|
|
|
|
|
2017-06-28 08:28:07 +00:00
|
|
|
: ${TMPDIR=/tmp}
|
|
|
|
testfile="$TMPDIR/testfile-$$"
|
|
|
|
testlink="$TMPDIR/testlink-$$"
|
2009-05-26 20:13:06 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
)
|
2009-05-27 15:15:58 +00:00
|
|
|
n=$((n+1))
|
2009-05-26 20:13:06 +00:00
|
|
|
done
|