]> arthur.barton.de Git - bup.git/commitdiff
restore: test --sparse with zeros at 64k boundary
authorFrank Gevaerts <frank@gevaerts.be>
Tue, 19 Apr 2016 20:02:49 +0000 (22:02 +0200)
committerRob Browning <rlb@defaultvalue.org>
Sat, 30 Apr 2016 22:56:51 +0000 (17:56 -0500)
bup restore --sparse fails with short zero runs around 64K boundaries.
The new testcase reproduces that failure

Signed-off-by: Frank Gevaerts <frank@gevaerts.be>
Reviewed-by: Rob Browning <rlb@defaultvalue.org>
[rlb@defaultvalue.org: adjust commit summary]

t/test-sparse-files.sh

index ce06d8f5d82c2f6dca33e68978a8152d48e8eb10..3b2558f72ef86259f7c509c566b0d2bf566286cc 100755 (executable)
@@ -141,5 +141,20 @@ WVPASS rm -r restore
 WVPASS bup restore --sparse -C restore "src/latest/$(pwd)/"
 WVPASS "$top/t/compare-trees" -c src/ restore/src/
 
 WVPASS bup restore --sparse -C restore "src/latest/$(pwd)/"
 WVPASS "$top/t/compare-trees" -c src/ restore/src/
 
+WVSTART "sparse file restore --sparse (short zero runs around boundary)"
+WVPASS python > src/foo <<EOF
+from sys import stdout
+stdout.write("x" * 65535 + "\0")
+stdout.write("\0" + "x" * 65535)
+stdout.write("\0" + "x" * 65534 + "\0")
+stdout.write("x" * 65536)
+stdout.write("\0")
+EOF
+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/
+
 
 WVPASS rm -rf "$tmpdir"
 
 WVPASS rm -rf "$tmpdir"