From e66aab1c9f327875f94339f18a662a51745f0128 Mon Sep 17 00:00:00 2001 From: Rob Browning Date: Tue, 31 Dec 2013 12:48:14 -0600 Subject: [PATCH] Move test.sh exclude tests to renamed test-save-restore-excludes.sh. Rename test-save-restore-exclude-rx.sh to test-save-restore-excludes.sh, and move test.sh exclude tests there. Signed-off-by: Rob Browning --- Makefile | 2 +- ...de-rx.sh => test-save-restore-excludes.sh} | 63 ++++++++++++++++- t/test.sh | 68 ------------------- 3 files changed, 63 insertions(+), 70 deletions(-) rename t/{test-save-restore-exclude-rx.sh => test-save-restore-excludes.sh} (80%) diff --git a/Makefile b/Makefile index 1935d74..a3ae49e 100644 --- a/Makefile +++ b/Makefile @@ -97,7 +97,7 @@ runtests-cmdline: all TMPDIR="$(test_tmp)" t/test-rm-between-index-and-save.sh TMPDIR="$(test_tmp)" t/test-command-without-init-fails.sh TMPDIR="$(test_tmp)" t/test-redundant-saves.sh - TMPDIR="$(test_tmp)" t/test-save-restore-exclude-rx.sh + TMPDIR="$(test_tmp)" t/test-save-restore-excludes.sh TMPDIR="$(test_tmp)" t/test-save-strip-graft.sh TMPDIR="$(test_tmp)" t/test-import-rdiff-backup.sh TMPDIR="$(test_tmp)" t/test.sh diff --git a/t/test-save-restore-exclude-rx.sh b/t/test-save-restore-excludes.sh similarity index 80% rename from t/test-save-restore-exclude-rx.sh rename to t/test-save-restore-excludes.sh index e0f13e6..97f4c72 100755 --- a/t/test-save-restore-exclude-rx.sh +++ b/t/test-save-restore-excludes.sh @@ -1,5 +1,6 @@ #!/usr/bin/env bash . ./wvtest-bup.sh +. t/lib.sh set -o pipefail @@ -11,10 +12,70 @@ export GIT_DIR="$tmpdir/bup" bup() { "$top/bup" "$@"; } -WVPASS bup init WVPASS cd "$tmpdir" +WVSTART "index excludes bupdir" +WVPASS force-delete src "$BUP_DIR" +WVPASS bup init +WVPASS mkdir src +WVPASS touch src/a +WVPASS bup random 128k >src/b +WVPASS mkdir src/d src/d/e +WVPASS bup random 512 >src/f +WVPASS bup index -ux src +WVPASS bup save -n exclude-bupdir src +WVPASSEQ "$(bup ls -AF "exclude-bupdir/latest/$tmpdir/src/")" "a +b +d/ +f" + + +WVSTART "index --exclude" +WVPASS force-delete src "$BUP_DIR" +WVPASS bup init +WVPASS mkdir src +WVPASS touch src/a +WVPASS bup random 128k >src/b +WVPASS mkdir src/d src/d/e +WVPASS bup random 512 >src/f +WVPASS bup random 512 >src/j +WVPASS bup index -ux --exclude src/d --exclude src/j src +WVPASS bup save -n exclude src +WVPASSEQ "$(bup ls "exclude/latest/$tmpdir/src/")" "a +b +f" +WVPASS mkdir src/g src/h +WVPASS bup index -ux --exclude src/d --exclude $tmpdir/src/g --exclude src/h \ + --exclude "$tmpdir/src/j" src +WVPASS bup save -n exclude src +WVPASSEQ "$(bup ls "exclude/latest/$tmpdir/src/")" "a +b +f" + + +WVSTART "index --exclude-from" +WVPASS force-delete src "$BUP_DIR" +WVPASS bup init +WVPASS mkdir src +WVPASS echo "src/d + $tmpdir/src/g +src/h +src/i" > exclude-list +WVPASS touch src/a +WVPASS bup random 128k >src/b +WVPASS mkdir src/d src/d/e +WVPASS bup random 512 >src/f +WVPASS mkdir src/g src/h +WVPASS bup random 128k > src/i +WVPASS bup index -ux --exclude-from exclude-list src +WVPASS bup save -n exclude-from src +WVPASSEQ "$(bup ls "exclude-from/latest/$tmpdir/src/")" "a +b +f" +WVPASS rm exclude-list + + # bup index --exclude-rx ... # ========================== diff --git a/t/test.sh b/t/test.sh index 3483a3f..32b57d4 100755 --- a/t/test.sh +++ b/t/test.sh @@ -333,74 +333,6 @@ else WVFAIL bup fsck --quick -r # still fails because par2 was missing fi -WVSTART "exclude-bupdir" -D=exclude-bupdir.tmp -WVPASS force-delete $D -WVPASS mkdir $D -export BUP_DIR="$D/.bup" -WVPASS bup init -WVPASS touch $D/a -WVPASS bup random 128k >$D/b -WVPASS mkdir $D/d $D/d/e -WVPASS bup random 512 >$D/f -WVPASS bup index -ux $D -WVPASS bup save -n exclude-bupdir $D -WVPASSEQ "$(bup ls -AF exclude-bupdir/latest/$TOP/$D/)" "a -b -d/ -f" - -WVSTART "exclude" -( - D=exclude.tmp - WVPASS force-delete $D - WVPASS mkdir $D - export BUP_DIR="$D/.bup" - WVPASS bup init - WVPASS touch $D/a - WVPASS bup random 128k >$D/b - WVPASS 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 - WVPASS 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 - WVPASS bup save -n exclude $D - WVPASSEQ "$(bup ls exclude/latest/$TOP/$D/)" "a -b -f" -) || exit $? - -WVSTART "exclude-from" -( - D=exclude-fromdir.tmp - EXCLUDE_FILE=exclude-from.tmp - WVPASS echo "$D/d - $TOP/$D/g -$D/h -$D/i" > $EXCLUDE_FILE - WVPASS force-delete $D - WVPASS mkdir $D - export BUP_DIR="$D/.bup" - WVPASS bup init - WVPASS touch $D/a - WVPASS bup random 128k >$D/b - WVPASS mkdir $D/d $D/d/e - WVPASS bup random 512 >$D/f - WVPASS mkdir $D/g $D/h - WVPASS bup random 128k > $D/i - WVPASS bup index -ux --exclude-from $EXCLUDE_FILE $D - WVPASS bup save -n exclude-from $D - WVPASSEQ "$(bup ls exclude-from/latest/$TOP/$D/)" "a -b -f" - WVPASS rm $EXCLUDE_FILE -) || exit $? WVSTART "save (no index)" ( -- 2.39.2