Comment 2 for bug 1237990

Revision history for this message
Scott Moser (smoser) wrote :

The fix I committed included a test case, but here is a similar one that uses the sstream-mirror:

#!/bin/sh -e
dlfile="examples/foocloud/streams/v1/com.example.foovendor:released:download.json"
rm -Rf out.d
./tools/tenv ./bin/sstream-mirror --max=1 "$dlfile" out.d

# 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
./tools/tenv ./bin/sstream-mirror -vv --max=1 "$dlfile" out.d

# 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