#!/bin/bash # $HeadURL$ $LastChangedRevision$ PROGNAME=${0##*/} SANDPIT=$(pwd) . $(ade-config ade_share_prefix)/include/adetestsupport.sh ############################################################################## # # Purpose of test: to verify that adeinst functions correctly in 'mode three' # which is: # # -D ... # ############################################################################## # Without this some of the comparisons below can fail. umask 022 echo "creating base directories ..." mkdir $SANDPIT/src $SANDPIT/dst $SANDPIT/dst/mode_3 echo "creating some source files ..." for i in 1 2 3 4 5; do # since we can't use 'mkfad' to verify the output, we'll use 'ls'. # since 'ls' will only tell us the size, then lets make the 'ls -l' # info good enough to verify that the files are correctly named by # making ... err ... "their contents proportional to their names." j=0 while [ $j -lt $i ]; do echo j=$(expr $j + 1) done > $SANDPIT/src/src$i done echo "testing ' ...' mode, with 1 non-existent target, without '-D' ..." adeinst $SANDPIT/dst/mode_3/subdir_1 echo "testing ' ...' mode, with 2 non-existent targets, without '-D' ..." adeinst $SANDPIT/dst/mode_3/subdir_2 $SANDPIT/dst/mode_3/subdir_3 2>&1 | sed 's/: .*:/: VARIABLE_PATH_NAME:/' echo "testing ' ...' mode, with 1 existent target, without '-D' ..." adeinst $SANDPIT/dst/mode_3/subdir_2 echo "doing some checks ..." # 'ls -l's date format is dependent on locale. export LC_ALL=C # Previously awk also selected $5 (size) but for directories this outputs # 4096 on ext3 and ext3 over NFS, but outputs a very different number on # ZFS over NFS, so we can no longer safely select that column. ( cd $SANDPIT/dst/mode_3 && find . \! -name . | xargs ls -ld | awk '{ print $1 " " $9 }' ) echo "testing ' ...' mode, with 1 non-existent target ..." adeinst -D $SANDPIT/dst/mode_3/subdir_1 echo "testing ' ...' mode, with 2 non-existent targets ..." adeinst -D $SANDPIT/dst/mode_3/subdir_2 $SANDPIT/dst/mode_3/subdir_3 echo "testing ' ...' mode, with 1 existent target ..." adeinst -D $SANDPIT/dst/mode_3/subdir_2/subsubdir/subsubdir echo "doing some checks ..." # 'ls -l's date format is dependent on locale. export LC_ALL=C # Previously awk also selected $5 (size) but for directories this outputs # 4096 on ext3 and ext3 over NFS, but outputs a very different number on # ZFS over NFS, so we can no longer safely select that column. ( cd $SANDPIT/dst/mode_3 && find . \! -name . | xargs ls -ld | awk '{ print $1 " " $9 }' ) echo "all done"