diff options
Diffstat (limited to 'tools/regression/usr.sbin/etcupdate/ignore.sh')
-rwxr-xr-x | tools/regression/usr.sbin/etcupdate/ignore.sh | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/tools/regression/usr.sbin/etcupdate/ignore.sh b/tools/regression/usr.sbin/etcupdate/ignore.sh index d6bd2ffa038b..2d3d2f5f7687 100755 --- a/tools/regression/usr.sbin/etcupdate/ignore.sh +++ b/tools/regression/usr.sbin/etcupdate/ignore.sh @@ -29,6 +29,7 @@ # Various regression tests to test the -I flag to the 'update' command. +FAILED=no WORKDIR=work usage() @@ -99,6 +100,7 @@ missing() { if [ -e $TEST/$1 -o -L $TEST/$1 ]; then echo "File $1 should be missing" + FAILED=yes fi } @@ -107,6 +109,7 @@ present() { if ! [ -e $TEST/$1 -o -L $TEST/$1 ]; then echo "File $1 should be present" + FAILED=yes fi } @@ -115,6 +118,7 @@ dir() { if ! [ -d $TEST/$1 ]; then echo "File $1 should be a directory" + FAILED=yes fi } @@ -127,15 +131,18 @@ file() if ! [ -f $TEST/$1 ]; then echo "File $1 should be a regular file" + FAILED=yes elif [ $# -eq 2 ]; then contents=`cat $TEST/$1` if [ "$contents" != "$2" ]; then echo "File $1 has wrong contents" + FAILED=yes fi elif [ $# -eq 3 ]; then sum=`md5 -q $TEST/$1` if [ "$sum" != "$3" ]; then echo "File $1 has wrong contents" + FAILED=yes fi fi } @@ -148,10 +155,12 @@ conflict() if ! [ -f $CONFLICTS/$1 ]; then echo "File $1 missing conflict" + FAILED=yes elif [ $# -gt 1 ]; then sum=`md5 -q $CONFLICTS/$1` if [ "$sum" != "$2" ]; then echo "Conflict $1 has wrong contents" + FAILED=yes fi fi } @@ -161,11 +170,13 @@ noconflict() { if [ -f $CONFLICTS/$1 ]; then echo "File $1 should not have a conflict" + FAILED=yes fi } if [ `id -u` -ne 0 ]; then echo "must be root" + exit 0 fi if [ -r /etc/etcupdate.conf ]; then @@ -187,7 +198,8 @@ cat > $WORKDIR/correct.out <<EOF EOF echo "Differences for regular:" -diff -u -L "correct" $WORKDIR/correct.out -L "test" $WORKDIR/test.out +diff -u -L "correct" $WORKDIR/correct.out -L "test" $WORKDIR/test.out \ + || FAILED=yes missing /tree/remove file /tree/modify "new" @@ -207,7 +219,8 @@ cat > $WORKDIR/correct1.out <<EOF EOF echo "Differences for -I '/tree/*':" -diff -u -L "correct" $WORKDIR/correct1.out -L "test" $WORKDIR/test1.out +diff -u -L "correct" $WORKDIR/correct1.out -L "test" $WORKDIR/test1.out \ + || FAILED=yes file /tree/remove "old" file /tree/modify "old" @@ -227,7 +240,8 @@ EOF echo "Differences for -I '/tree/*' -I '/rmdir*':" -diff -u -L "correct" $WORKDIR/correct2.out -L "test" $WORKDIR/test2.out +diff -u -L "correct" $WORKDIR/correct2.out -L "test" $WORKDIR/test2.out \ + || FAILED=yes file /tree/remove "old" file /tree/modify "old" @@ -250,10 +264,13 @@ EOF echo "Differences for -I '/tree/* /rmdir/*':" -diff -u -L "correct" $WORKDIR/correct3.out -L "test" $WORKDIR/test3.out +diff -u -L "correct" $WORKDIR/correct3.out -L "test" $WORKDIR/test3.out \ + || FAILED=yes file /tree/remove "old" file /tree/modify "old" missing /tree/add file /rmdir/file "foo" dir /rmdir + +[ "${FAILED}" = no ] |