diff options
author | ngie <ngie@FreeBSD.org> | 2015-10-13 16:51:12 +0000 |
---|---|---|
committer | ngie <ngie@FreeBSD.org> | 2015-10-13 16:51:12 +0000 |
commit | d3814e98fdfad8518b88ea31bcdec25c7d98e113 (patch) | |
tree | be312f89f375893a87e8d59f983ac9afa1b70644 /tests | |
parent | 2c46ba7a42c08be87ceaa99985a950cd19b140e0 (diff) | |
download | FreeBSD-src-d3814e98fdfad8518b88ea31bcdec25c7d98e113.zip FreeBSD-src-d3814e98fdfad8518b88ea31bcdec25c7d98e113.tar.gz |
Integrate tools/regression/vfs into the FreeBSD test suite as tests/sys/vfs
Diffstat (limited to 'tests')
-rw-r--r-- | tests/sys/Makefile | 1 | ||||
-rwxr-xr-x | tests/sys/vfs/trailing_slash.sh | 42 |
2 files changed, 43 insertions, 0 deletions
diff --git a/tests/sys/Makefile b/tests/sys/Makefile index 3ed85be..a22214a 100644 --- a/tests/sys/Makefile +++ b/tests/sys/Makefile @@ -13,6 +13,7 @@ TESTS_SUBDIRS+= mqueue TESTS_SUBDIRS+= netinet TESTS_SUBDIRS+= opencrypto TESTS_SUBDIRS+= posixshm +TESTS_SUBDIRS+= vfs TESTS_SUBDIRS+= vm # Items not integrated into kyua runs by default diff --git a/tests/sys/vfs/trailing_slash.sh b/tests/sys/vfs/trailing_slash.sh new file mode 100755 index 0000000..b1b8523 --- /dev/null +++ b/tests/sys/vfs/trailing_slash.sh @@ -0,0 +1,42 @@ +#!/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="/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 |