From owner-svn-src-stable@FreeBSD.ORG Fri May 21 16:25:17 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 33BD21065672; Fri, 21 May 2010 16:25:17 +0000 (UTC) (envelope-from stefanf@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 080A98FC14; Fri, 21 May 2010 16:25:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4LGPGAq068037; Fri, 21 May 2010 16:25:16 GMT (envelope-from stefanf@svn.freebsd.org) Received: (from stefanf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4LGPGlJ068034; Fri, 21 May 2010 16:25:16 GMT (envelope-from stefanf@svn.freebsd.org) Message-Id: <201005211625.o4LGPGlJ068034@svn.freebsd.org> From: Stefan Farfeleder Date: Fri, 21 May 2010 16:25:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208386 - stable/7/tools/regression/bin/sh/builtins X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 May 2010 16:25:17 -0000 Author: stefanf Date: Fri May 21 16:25:16 2010 New Revision: 208386 URL: http://svn.freebsd.org/changeset/base/208386 Log: Merge r199628 and r199632: Tests for the cd command. Added: stable/7/tools/regression/bin/sh/builtins/cd1.0 - copied, changed from r176522, head/tools/regression/bin/sh/builtins/cd1.0 stable/7/tools/regression/bin/sh/builtins/cd2.0 - copied unchanged from r199632, head/tools/regression/bin/sh/builtins/cd2.0 Modified: Directory Properties: stable/7/tools/regression/bin/sh/ (props changed) Copied and modified: stable/7/tools/regression/bin/sh/builtins/cd1.0 (from r176522, head/tools/regression/bin/sh/builtins/cd1.0) ============================================================================== --- head/tools/regression/bin/sh/builtins/cd1.0 Sun Feb 24 16:52:02 2008 (r176522, copy source) +++ stable/7/tools/regression/bin/sh/builtins/cd1.0 Fri May 21 16:25:16 2010 (r208386) @@ -1,17 +1,27 @@ # $FreeBSD$ set -e -PDIR=${TMPDIR:-/tmp} -cd ${PDIR} -TMPDIR=$(mktemp -d sh-test.XXXXXX) -chmod 0 ${TMPDIR} +P=${TMPDIR:-/tmp} +cd $P +T=$(mktemp -d sh-test.XXXXXX) -cd -L ${TMPDIR} 2>/dev/null && exit 1 -[ "${PWD}" = "${PDIR}" ] -[ "$(pwd)" = "${PDIR}" ] -cd -P ${TMPDIR} 2>/dev/null && exit 1 -[ "${PWD}" = "${PDIR}" ] -[ "$(pwd)" = "${PDIR}" ] +chmod 0 $T +cd -L $T 2>/dev/null && exit 1 +[ "$PWD" = "$P" ] +[ "$(pwd)" = "$P" ] +cd -P $T 2>/dev/null && exit 1 +[ "$PWD" = "$P" ] +[ "$(pwd)" = "$P" ] -chmod 755 ${TMPDIR} -rmdir ${TMPDIR} +chmod 755 $T +cd $T +mkdir -p 1/2/3 +ln -s 1/2 link1 +ln -s 2/3 1/link2 +(cd -L 1/../1 && [ "$(pwd -L)" = "$P/$T/1" ]) +(cd -L link1 && [ "$(pwd -L)" = "$P/$T/link1" ]) +(cd -L link1 && [ "$(pwd -P)" = "$P/$T/1/2" ]) +(cd -P link1 && [ "$(pwd -L)" = "$P/$T/1/2" ]) +(cd -P link1 && [ "$(pwd -P)" = "$P/$T/1/2" ]) + +rm -rf ${P}/${T} Copied: stable/7/tools/regression/bin/sh/builtins/cd2.0 (from r199632, head/tools/regression/bin/sh/builtins/cd2.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/tools/regression/bin/sh/builtins/cd2.0 Fri May 21 16:25:16 2010 (r208386, copy of r199632, head/tools/regression/bin/sh/builtins/cd2.0) @@ -0,0 +1,15 @@ +# $FreeBSD$ +set -e + +T=$(mktemp -d ${TMPDIR:-/tmp}/sh-test.XXXXXX) +cd $T +D=$T +for i in 0 1 2 3 4 5 6 7 8 9; do + for j in 0 1 2 3 4 5 6 7 8 9; do + mkdir veryverylongdirectoryname + cd veryverylongdirectoryname + D=$D/veryverylongdirectoryname + done +done +[ $(pwd | wc -c) -eq $((${#D} + 1)) ] # +\n +rm -rf ${T}