test04.sh revision 122612
1122612Sphk#!/bin/sh 2122612Sphk# 3122612Sphk# Copyright (c) 2003 Dan Nelson 4122612Sphk# All rights reserved. 5122612Sphk# 6122612Sphk# Please see src/share/examples/etc/bsd-style-copyright. 7122612Sphk# 8122612Sphk# $FreeBSD: head/usr.sbin/mtree/test/test04.sh 122612 2003-11-13 11:02:57Z phk $ 9122612Sphk# 10122612Sphk 11122612Sphkset -e 12122612Sphk 13122612SphkTMP=/tmp/mtree.$$ 14122612Sphk 15122612Sphkrm -rf ${TMP} 16122612Sphkmkdir -p ${TMP} ${TMP}/mr ${TMP}/mt 17122612Sphk 18122612Sphkmkdir ${TMP}/mr/a 19122612Sphkmkdir ${TMP}/mr/b 20122612Sphkmkdir ${TMP}/mt/a 21122612Sphkmkdir ${TMP}/mt/b 22122612Sphktouch ${TMP}/mt/z 23122612Sphk 24122612Sphkmtree -c -p ${TMP}/mr > ${TMP}/_r 25122612Sphkmtree -c -p ${TMP}/mt > ${TMP}/_t 26122612Sphk 27122612Sphkif mtree -f ${TMP}/_r -f ${TMP}/_t > ${TMP}/_ ; then 28122612Sphk echo "ERROR wrong exit on difference" 1>&2 29122612Sphk exit 1 30122612Sphkfi 31122612Sphk 32122612Sphkif [ `wc -l < ${TMP}/_` -ne 1 ] ; then 33122612Sphk echo "ERROR spec/spec compare generated wrong output" 1>&2 34122612Sphk rm -rf ${TMP} 35122612Sphk exit 1 36122612Sphkfi 37122612Sphk 38122612Sphkif mtree -f ${TMP}/_t -f ${TMP}/_r > ${TMP}/_ ; then 39122612Sphk echo "ERROR wrong exit on difference" 1>&2 40122612Sphk exit 1 41122612Sphkfi 42122612Sphk 43122612Sphkif [ `wc -l < ${TMP}/_` -ne 1 ] ; then 44122612Sphk echo "ERROR spec/spec compare generated wrong output" 1>&2 45122612Sphk rm -rf ${TMP} 46122612Sphk exit 1 47122612Sphkfi 48122612Sphk 49122612Sphkrm -rf ${TMP} 50122612Sphkexit 0 51122612Sphk 52