]> arthur.barton.de Git - bup.git/blobdiff - t/test-sparse-files.sh
Rework write_sparsely() to fix in-buffer zero runs
[bup.git] / t / test-sparse-files.sh
index 884c6b9c0f3948497c6146987299ea2ecafdb165..c4f7d8acdba37626bda06467a5b3e635f91166f7 100755 (executable)
@@ -1,5 +1,5 @@
 #!/usr/bin/env bash
-. ./wvtest-bup.sh
+. ./wvtest-bup.sh || exit $?
 
 set -o pipefail
 
@@ -69,6 +69,16 @@ restore_size=$(WVPASS du -k -s restore | WVPASS cut -f1) || exit $?
 WVPASS [ "$restore_size" -lt 100 ]
 WVPASS "$top/t/compare-trees" -c src/ restore/src/
 
+WVSTART "sparse file restore --sparse (bracketed zero run in buf)"
+WVPASS echo 'x' > src/foo
+WVPASS dd if=/dev/zero bs=1 count=512 >> src/foo
+WVPASS echo 'y' >> src/foo
+WVPASS bup index src
+WVPASS bup save -n src src
+WVPASS rm -r restore
+WVPASS bup restore --sparse -C restore "src/latest/$(pwd)/"
+WVPASS "$top/t/compare-trees" -c src/ restore/src/
+
 WVSTART "sparse file restore --sparse (sparse start)"
 WVPASS dd if=/dev/zero of=src/foo seek=$mb bs=1 count=1
 WVPASS echo "end" >> src/foo
@@ -93,7 +103,7 @@ WVPASS [ "$restore_size" -lt 100 ]
 WVPASS "$top/t/compare-trees" -c src/ restore/src/
 
 WVSTART "sparse file restore --sparse (random)"
-WVPASS bup random 512k > src/foo
+WVPASS bup random 1M > src/foo
 WVPASS bup index src
 WVPASS bup save -n src src
 WVPASS rm -r restore