[Midnightbsd-cvs] src [11947] trunk/tests/sys/vfs: add vfs
laffer1 at midnightbsd.org
laffer1 at midnightbsd.org
Sat Jul 21 16:14:30 EDT 2018
Revision: 11947
http://svnweb.midnightbsd.org/src/?rev=11947
Author: laffer1
Date: 2018-07-21 16:14:29 -0400 (Sat, 21 Jul 2018)
Log Message:
-----------
add vfs
Added Paths:
-----------
trunk/tests/sys/vfs/
trunk/tests/sys/vfs/Makefile
trunk/tests/sys/vfs/trailing_slash.sh
Added: trunk/tests/sys/vfs/Makefile
===================================================================
--- trunk/tests/sys/vfs/Makefile (rev 0)
+++ trunk/tests/sys/vfs/Makefile 2018-07-21 20:14:29 UTC (rev 11947)
@@ -0,0 +1,8 @@
+# $MidnightBSD$
+# $FreeBSD: stable/10/tests/sys/vfs/Makefile 321644 2017-07-28 03:26:05Z ngie $
+
+TESTSDIR= ${TESTSBASE}/sys/vfs
+
+TAP_TESTS_SH+= trailing_slash
+
+.include <bsd.test.mk>
Property changes on: trunk/tests/sys/vfs/Makefile
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/tests/sys/vfs/trailing_slash.sh
===================================================================
--- trunk/tests/sys/vfs/trailing_slash.sh (rev 0)
+++ trunk/tests/sys/vfs/trailing_slash.sh 2018-07-21 20:14:29 UTC (rev 11947)
@@ -0,0 +1,43 @@
+#!/bin/sh
+#
+# $MidnightBSD$
+#
+# Tests vfs_lookup()'s handling of trailing slashes for symlinks that
+# point to files. See kern/21768 for details. Fixed in r193028.
+#
+
+: ${TMPDIR=/tmp}
+testfile="$TMPDIR/testfile-$$"
+testlink="$TMPDIR/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
Property changes on: trunk/tests/sys/vfs/trailing_slash.sh
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
More information about the Midnightbsd-cvs
mailing list