test-bug-lp1445239-download-loop 658 B

1234567891011121314151617181920212223242526272829
  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. TESTFILE='aptarchive/testfile'
  13. dd if=/dev/zero of=$TESTFILE bs=100k count=1 2>/dev/null
  14. DOWNLOADLOG='rootdir/tmp/testdownloadfile.log'
  15. TARGET=./downloaded/testfile-downloaded
  16. dd if=/dev/zero of=$TARGET bs=99k count=1 2>/dev/null
  17. if ! downloadfile http://localhost:${APTHTTPPORT}/testfile "$TARGET" > "$DOWNLOADLOG"; then
  18. cat >&2 "$DOWNLOADLOG"
  19. msgfail
  20. else
  21. msgpass
  22. fi