test04.sh revision 285830
1#!/bin/sh 2# 3# Copyright (c) 2003 Dan Nelson 4# All rights reserved. 5# 6# Please see src/share/examples/etc/bsd-style-copyright. 7# 8# $FreeBSD: releng/10.2/usr.sbin/mtree/test/test04.sh 122612 2003-11-13 11:02:57Z phk $ 9# 10 11set -e 12 13TMP=/tmp/mtree.$$ 14 15rm -rf ${TMP} 16mkdir -p ${TMP} ${TMP}/mr ${TMP}/mt 17 18mkdir ${TMP}/mr/a 19mkdir ${TMP}/mr/b 20mkdir ${TMP}/mt/a 21mkdir ${TMP}/mt/b 22touch ${TMP}/mt/z 23 24mtree -c -p ${TMP}/mr > ${TMP}/_r 25mtree -c -p ${TMP}/mt > ${TMP}/_t 26 27if mtree -f ${TMP}/_r -f ${TMP}/_t > ${TMP}/_ ; then 28 echo "ERROR wrong exit on difference" 1>&2 29 exit 1 30fi 31 32if [ `wc -l < ${TMP}/_` -ne 1 ] ; then 33 echo "ERROR spec/spec compare generated wrong output" 1>&2 34 rm -rf ${TMP} 35 exit 1 36fi 37 38if mtree -f ${TMP}/_t -f ${TMP}/_r > ${TMP}/_ ; then 39 echo "ERROR wrong exit on difference" 1>&2 40 exit 1 41fi 42 43if [ `wc -l < ${TMP}/_` -ne 1 ] ; then 44 echo "ERROR spec/spec compare generated wrong output" 1>&2 45 rm -rf ${TMP} 46 exit 1 47fi 48 49rm -rf ${TMP} 50exit 0 51 52