2021-02-12 16:21:28 +08:00
|
|
|
set -eux
|
|
|
|
repopath="$(cd "$(dirname "$0")/.."; pwd)"
|
|
|
|
mkdir -p mnt torrents
|
2021-06-07 10:44:51 +08:00
|
|
|
GOPPROF=http godo -v "$repopath/cmd/torrentfs" -mountDir=mnt -metainfoDir=torrents &
|
2021-02-12 16:21:28 +08:00
|
|
|
trap 'set +e; sudo umount -f mnt' EXIT
|
|
|
|
debian_file=debian-10.8.0-amd64-netinst.iso
|
2018-06-29 22:08:01 +08:00
|
|
|
pushd torrents
|
2021-02-12 16:21:28 +08:00
|
|
|
cp "$repopath/testdata/$debian_file.torrent" .
|
2017-08-29 12:02:30 +08:00
|
|
|
echo 'magnet:?xt=urn:btih:6a9759bffd5c0af65319979fb7832189f4f3c35d&dn=sintel.mp4' > sintel.magnet
|
2018-06-29 22:08:01 +08:00
|
|
|
popd
|
2021-02-12 16:21:28 +08:00
|
|
|
file="$debian_file"
|
2017-08-29 12:02:30 +08:00
|
|
|
# file=sintel.mp4
|
2017-08-27 12:03:10 +08:00
|
|
|
while [ ! -e "mnt/$file" ]; do sleep 1; done
|
2021-06-07 10:44:51 +08:00
|
|
|
pv -f "mnt/$file" | md5sum
|
2021-02-12 16:21:28 +08:00
|
|
|
# expect e221f43f4fdd409250908fc4305727d4
|
2018-06-30 20:03:29 +08:00
|
|
|
sudo umount mnt
|
2018-06-29 22:08:01 +08:00
|
|
|
wait || echo "wait returned" $?
|