FileStore checksumming will always fail on resumed download
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
simplestreams |
Fix Released
|
Undecided
|
Unassigned | ||
simplestreams (Ubuntu) |
Fix Released
|
Medium
|
Unassigned |
Bug Description
The resuming code in the Filestore seems like it will always fail.
Thats because we don't ever read the contents of the existing and run it through the checksum update.
we just update what we've read from the other end, and if that was only part of the file, then clearly the checksum wont match.
ProblemType: Bug
DistroRelease: Ubuntu 13.10
Package: simplestreams 0.1.0~bzr313-
ProcVersionSign
Uname: Linux 3.11.0-9-generic x86_64
ApportVersion: 2.12.5-0ubuntu1
Architecture: amd64
Date: Thu Oct 10 08:39:38 2013
EcryptfsInUse: Yes
InstallationDate: Installed on 2011-10-19 (721 days ago)
InstallationMedia: Ubuntu 11.10 "Oneiric Ocelot" - Release amd64 (20111012)
MarkForUpload: True
PackageArchitec
ProcEnviron:
TERM=screen-bce
PATH=(custom, no user)
XDG_RUNTIME_
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: simplestreams
UpgradeStatus: Upgraded to saucy on 2013-05-20 (143 days ago)
The fix I committed included a test case, but here is a similar one that uses the sstream-mirror:
#!/bin/sh -e "examples/ foocloud/ streams/ v1/com. example. foovendor: released: download. json" mirror --max=1 "$dlfile" out.d
dlfile=
rm -Rf out.d
./tools/tenv ./bin/sstream-
# now truncate some of the files and rename to .part
files=$(find out.d -type f -name "*.tar.gz")
for f in $files; do truncate --size 10 "$f" && mv "$f" "$f.part"; done
# remove the state, so the mirror doesn't think its already done.
rm -Rf out.d/.data out.d/streams mirror -vv --max=1 "$dlfile" out.d
./tools/tenv ./bin/sstream-
# the parts need to hvae been deleted now
parts=""
for f in $files; do
if [ -e "$f.part" ]; then
echo "FAILED: $f.part existed";
parts="${parts} $f.part"
fi
done
[ -z "$parts" ] || exit 1