test-bug-lp1445239-download-loop 712 B

123456789101112131415161718192021222324252627282930
  1. #!/bin/sh
  2. #
  3. # this is a regression test for LP: #1445239 where a partial download can
  4. # trigger an endless hang of the download method
  5. #
  6. set -e
  7. TESTDIR="$(readlink -f "$(dirname "$0")")"
  8. . "$TESTDIR/framework"
  9. setupenvironment
  10. configarchitecture 'amd64'
  11. changetowebserver
  12. webserverconfig 'aptwebserver::support::range' 'true'
  13. TESTFILE='aptarchive/testfile'
  14. dd if=/dev/zero of=$TESTFILE bs=100k count=1 2>/dev/null
  15. DOWNLOADLOG='rootdir/tmp/testdownloadfile.log'
  16. TARGET=./downloaded/testfile-downloaded
  17. dd if=/dev/zero of=$TARGET bs=99k count=1 2>/dev/null
  18. if ! downloadfile http://localhost:${APTHTTPPORT}/testfile "$TARGET" > "$DOWNLOADLOG"; then
  19. cat >&2 "$DOWNLOADLOG"
  20. msgfail
  21. else
  22. msgpass
  23. fi