diff options
author | phk <phk@FreeBSD.org> | 2003-10-30 10:46:23 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2003-10-30 10:46:23 +0000 |
commit | 69589e7dad671b33a698a42f11511835e1d39e5a (patch) | |
tree | 6f6c4e402eeea16d52f43c16ed6a56abe9b1511f /usr.sbin/mtree/test | |
parent | 58d62949d472bd6a380995d114281f52f5936d58 (diff) | |
download | FreeBSD-src-69589e7dad671b33a698a42f11511835e1d39e5a.zip FreeBSD-src-69589e7dad671b33a698a42f11511835e1d39e5a.tar.gz |
Add a test script which Mtree fails.
Diffstat (limited to 'usr.sbin/mtree/test')
-rw-r--r-- | usr.sbin/mtree/test/test00.sh | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/usr.sbin/mtree/test/test00.sh b/usr.sbin/mtree/test/test00.sh new file mode 100644 index 0000000..d9cc5c1 --- /dev/null +++ b/usr.sbin/mtree/test/test00.sh @@ -0,0 +1,51 @@ +#!/bin/sh +# +# Copyright (c) 2003 Poul-Henning Kamp +# All rights reserved. +# +# Please see src/share/examples/etc/bsd-style-copyright. +# +# $FreeBSD$ +# + +set -e + +TMP=/tmp/mtree.$$ + +rm -rf ${TMP} +mkdir -p ${TMP} ${TMP}/mr ${TMP}/mt + + +mkdir ${TMP}/mt/foo +mkdir ${TMP}/mr/\* +mtree -c -p ${TMP}/mr | mtree -U -r -p ${TMP}/mt > /dev/null 2>&1 +if [ -d ${TMP}/mt/foo ] ; then + echo "ERROR Mtree create fell for filename with '*' char" 1>&2 + rm -rf ${TMP} + exit 1 +fi +rmdir ${TMP}/mr/\* + +mkdir -p ${TMP}/mt/foo +mkdir ${TMP}/mr/\[f\]oo +mtree -c -p ${TMP}/mr | mtree -U -r -p ${TMP}/mt > /dev/null 2>&1 +if [ -d ${TMP}/mt/foo ] ; then + echo "ERROR Mtree create fell for filename with '[' char" 1>&2 + rm -rf ${TMP} + exit 1 +fi +rmdir ${TMP}/mr/\[f\]oo + +mkdir -p ${TMP}/mt/foo +mkdir ${TMP}/mr/\?oo +mtree -c -p ${TMP}/mr | mtree -U -r -p ${TMP}/mt > /dev/null 2>&1 +if [ -d ${TMP}/mt/foo ] ; then + echo "ERROR Mtree create fell for filename with '?' char" 1>&2 + rm -rf ${TMP} + exit 1 +fi +rmdir ${TMP}/mr/\?oo + +echo Passed test 1>&2 +rm -rf ${TMP} +exit 0 |