2018-06-30 00:08:01 +10:00
|
|
|
set -ex
|
2017-12-29 13:50:26 +11:00
|
|
|
repopath=$(cd $(dirname $0)/..; pwd)
|
2018-06-30 00:08:01 +10:00
|
|
|
d=$(mktemp -d)
|
|
|
|
pushd "$d"
|
2017-08-26 13:25:27 +10:00
|
|
|
mkdir mnt torrents
|
2018-07-27 10:44:26 +10:00
|
|
|
GOPPROF=http torrentfs -mountDir=mnt -metainfoDir=torrents &
|
2018-06-30 00:08:01 +10:00
|
|
|
trap 'set +e; sudo umount -f mnt; pushd; rm -rv "$d"' EXIT
|
|
|
|
pushd torrents
|
2017-12-29 13:50:26 +11:00
|
|
|
cp "$repopath"/testdata/debian-9.1.0-amd64-netinst.iso.torrent .
|
2017-08-29 14:02:30 +10:00
|
|
|
echo 'magnet:?xt=urn:btih:6a9759bffd5c0af65319979fb7832189f4f3c35d&dn=sintel.mp4' > sintel.magnet
|
2018-06-30 00:08:01 +10:00
|
|
|
popd
|
2017-08-29 14:02:30 +10:00
|
|
|
file=debian-9.1.0-amd64-netinst.iso
|
|
|
|
# file=sintel.mp4
|
2017-08-27 14:03:10 +10:00
|
|
|
while [ ! -e "mnt/$file" ]; do sleep 1; done
|
|
|
|
pv "mnt/$file" | md5sum
|
2018-06-30 22:03:29 +10:00
|
|
|
sudo umount mnt
|
2018-06-30 00:08:01 +10:00
|
|
|
wait || echo "wait returned" $?
|