test00.sh revision 121730
1#!/bin/sh 2# 3# Copyright (c) 2003 Poul-Henning Kamp 4# All rights reserved. 5# 6# Please see src/share/examples/etc/bsd-style-copyright. 7# 8# $FreeBSD: head/usr.sbin/mtree/test/test00.sh 121730 2003-10-30 10:46:23Z phk $ 9# 10 11set -e 12 13TMP=/tmp/mtree.$$ 14 15rm -rf ${TMP} 16mkdir -p ${TMP} ${TMP}/mr ${TMP}/mt 17 18 19mkdir ${TMP}/mt/foo 20mkdir ${TMP}/mr/\* 21mtree -c -p ${TMP}/mr | mtree -U -r -p ${TMP}/mt > /dev/null 2>&1 22if [ -d ${TMP}/mt/foo ] ; then 23 echo "ERROR Mtree create fell for filename with '*' char" 1>&2 24 rm -rf ${TMP} 25 exit 1 26fi 27rmdir ${TMP}/mr/\* 28 29mkdir -p ${TMP}/mt/foo 30mkdir ${TMP}/mr/\[f\]oo 31mtree -c -p ${TMP}/mr | mtree -U -r -p ${TMP}/mt > /dev/null 2>&1 32if [ -d ${TMP}/mt/foo ] ; then 33 echo "ERROR Mtree create fell for filename with '[' char" 1>&2 34 rm -rf ${TMP} 35 exit 1 36fi 37rmdir ${TMP}/mr/\[f\]oo 38 39mkdir -p ${TMP}/mt/foo 40mkdir ${TMP}/mr/\?oo 41mtree -c -p ${TMP}/mr | mtree -U -r -p ${TMP}/mt > /dev/null 2>&1 42if [ -d ${TMP}/mt/foo ] ; then 43 echo "ERROR Mtree create fell for filename with '?' char" 1>&2 44 rm -rf ${TMP} 45 exit 1 46fi 47rmdir ${TMP}/mr/\?oo 48 49echo Passed test 1>&2 50rm -rf ${TMP} 51exit 0 52