From: Rob Browning Date: Sun, 17 Mar 2013 17:23:32 +0000 (-0500) Subject: Add "set -eo pipefail" to "exclude" and "exclude-from" tests. X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=2d3775965525d45075ec4cf95267e3df273f581b;p=packages%2Fb%2Fbup.git Add "set -eo pipefail" to "exclude" and "exclude-from" tests. Don't allow non-tests to silently fail (i.e. mkdir, touch, echo, rm, etc.). Eventually all test code should have similar behavior. Signed-off-by: Rob Browning --- diff --git a/t/test.sh b/t/test.sh index f1c4142..afa38f0 100755 --- a/t/test.sh +++ b/t/test.sh @@ -354,53 +354,58 @@ d/ f" WVSTART "exclude" -D=exclude.tmp -force-delete $D -mkdir $D -export BUP_DIR="$D/.bup" -WVPASS bup init -touch $D/a -WVPASS bup random 128k >$D/b -mkdir $D/d $D/d/e -WVPASS bup random 512 >$D/f -WVPASS bup random 512 >$D/j -WVPASS bup index -ux --exclude $D/d --exclude $D/j $D -bup save -n exclude $D -WVPASSEQ "$(bup ls exclude/latest/$TOP/$D/)" "a +( + set -e -o pipefail + D=exclude.tmp + force-delete $D + mkdir $D + export BUP_DIR="$D/.bup" + WVPASS bup init + touch $D/a + WVPASS bup random 128k >$D/b + mkdir $D/d $D/d/e + WVPASS bup random 512 >$D/f + WVPASS bup random 512 >$D/j + WVPASS bup index -ux --exclude $D/d --exclude $D/j $D + bup save -n exclude $D + WVPASSEQ "$(bup ls exclude/latest/$TOP/$D/)" "a b f" -WVPASS mkdir $D/g $D/h -WVPASS bup index -ux --exclude $D/d --exclude $TOP/$D/g --exclude $D/h \ - --exclude $TOP/$D/j $D -bup save -n exclude $D -WVPASSEQ "$(bup ls exclude/latest/$TOP/$D/)" "a + mkdir $D/g $D/h + WVPASS bup index -ux --exclude $D/d --exclude $TOP/$D/g --exclude $D/h \ + --exclude $TOP/$D/j $D + bup save -n exclude $D + WVPASSEQ "$(bup ls exclude/latest/$TOP/$D/)" "a b f" +) || WVFAIL WVSTART "exclude-from" -D=exclude-fromdir.tmp -EXCLUDE_FILE=exclude-from.tmp -echo "$D/d +( + set -e -o pipefail + D=exclude-fromdir.tmp + EXCLUDE_FILE=exclude-from.tmp + echo "$D/d $TOP/$D/g $D/h $D/i" > $EXCLUDE_FILE -force-delete $D -mkdir $D -export BUP_DIR="$D/.bup" -WVPASS bup init -touch $D/a -WVPASS bup random 128k >$D/b -mkdir $D/d $D/d/e -WVPASS bup random 512 >$D/f -mkdir $D/g $D/h -WVPASS bup random 128k > $D/i -WVPASS bup index -ux --exclude-from $EXCLUDE_FILE $D -bup save -n exclude-from $D -WVPASSEQ "$(bup ls exclude-from/latest/$TOP/$D/)" "a + force-delete $D + mkdir $D + export BUP_DIR="$D/.bup" + WVPASS bup init + touch $D/a + WVPASS bup random 128k >$D/b + mkdir $D/d $D/d/e + WVPASS bup random 512 >$D/f + mkdir $D/g $D/h + WVPASS bup random 128k > $D/i + WVPASS bup index -ux --exclude-from $EXCLUDE_FILE $D + bup save -n exclude-from $D + WVPASSEQ "$(bup ls exclude-from/latest/$TOP/$D/)" "a b f" -rm $EXCLUDE_FILE - + rm $EXCLUDE_FILE +) || WVFAIL WVSTART "save (no index)" (