Test that sparse --restore handles the case where within one call to
write_sparsely() (one buffer) we have non-zero bytes, followed by a run
of zero bytes that's longer than the minimum sparse run
length (currently 512), followed by non-zero bytes.
Currently, the initial non-zero bytes will be lost, and this test will
fail.
Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
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