]> 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>
Fri, 20 May 2016 02:35:32 +0000 (21:35 -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 54ecb8268b5602947e6fc5d7bfb87d5919aa645c..f9e10eadf109a845434de7aeabbd8106afa1e714 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/
 
+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"