You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

87 lines
4.6 KiB

  1. #!/bin/sh
  2. set -e
  3. TESTDIR="$(readlink -f "$(dirname "$0")")"
  4. . "$TESTDIR/framework"
  5. setupenvironment
  6. configarchitecture 'amd64'
  7. configcompression '.' 'gz'
  8. buildsimplenativepackage 'unrelated' 'all' '0.5~squeeze1' 'unstable'
  9. export APT_DONT_SIGN=''
  10. setupaptarchive --no-update
  11. changetowebserver
  12. webserverconfig 'aptwebserver::redirect::replace::/redirectme/' "http://0.0.0.0:${APTHTTPPORT}/"
  13. rewritesourceslist "http://localhost:${APTHTTPPORT}/redirectme"
  14. testsuccessequal "Get:1 http://0.0.0.0:${APTHTTPPORT} unstable InRelease [$(stat -c %s aptarchive/dists/unstable/InRelease) B]
  15. Get:2 http://0.0.0.0:${APTHTTPPORT} unstable/main Sources [$(stat -c %s aptarchive/dists/unstable/main/source/Sources.gz) B]
  16. Get:3 http://0.0.0.0:${APTHTTPPORT} unstable/main all Packages [$(stat -c %s aptarchive/dists/unstable/main/binary-all/Packages.gz) B]
  17. Get:4 http://0.0.0.0:${APTHTTPPORT} unstable/main Translation-en [$(stat -c %s aptarchive/dists/unstable/main/i18n/Translation-en.gz) B]
  18. Reading package lists..." aptget update
  19. # ensure we asked the redirector only once
  20. testsuccessequal "Location: http://0.0.0.0:${APTHTTPPORT}/dists/unstable/InRelease" grep '^Location:' aptarchive/webserver.log
  21. testsuccessequal "Hit:1 http://0.0.0.0:${APTHTTPPORT} unstable InRelease
  22. Reading package lists..." aptget update
  23. testsuccessequal "Location: http://0.0.0.0:${APTHTTPPORT}/dists/unstable/InRelease
  24. Location: http://0.0.0.0:${APTHTTPPORT}/dists/unstable/InRelease" grep '^Location:' aptarchive/webserver.log
  25. rm -rf rootdir/var/lib/apt/lists
  26. testsuccess apt update -o Debug::Acquire::http=1 -o Acquire::SameMirrorForAllIndexes=0
  27. testsuccessequal "Location: http://0.0.0.0:${APTHTTPPORT}/dists/unstable/InRelease
  28. Location: http://0.0.0.0:${APTHTTPPORT}/dists/unstable/InRelease
  29. Location: http://0.0.0.0:${APTHTTPPORT}/dists/unstable/InRelease
  30. Location: http://0.0.0.0:${APTHTTPPORT}/dists/unstable/main/source/Sources.gz
  31. Location: http://0.0.0.0:${APTHTTPPORT}/dists/unstable/main/binary-all/Packages.gz
  32. Location: http://0.0.0.0:${APTHTTPPORT}/dists/unstable/main/i18n/Translation-en.gz" grep '^Location:' aptarchive/webserver.log
  33. cd downloaded
  34. testsuccess apthelper download-file "http://localhost:${APTHTTPPORT}/redirectme/dists/unstable/InRelease" inrelease
  35. testsuccess test -s inrelease
  36. cd - >/dev/null
  37. webserverconfig "aptwebserver::redirect::replace::http://0.0.0.0:${APTHTTPPORT}/dists/unstable/InRelease" "http://0.0.0.0:${APTHTTPPORT}/storage/dists/unstable/InRelease"
  38. mkdir -p aptarchive/storage/dists/unstable
  39. mv aptarchive/dists/unstable/InRelease aptarchive/storage/dists/unstable
  40. rm -rf rootdir/var/lib/apt/lists
  41. testsuccessequal "Get:1 http://0.0.0.0:${APTHTTPPORT}/storage unstable InRelease [$(stat -c %s aptarchive/storage/dists/unstable/InRelease) B]
  42. Ign:2 http://0.0.0.0:${APTHTTPPORT}/storage unstable/main Sources
  43. 404 Not Found
  44. Ign:3 http://0.0.0.0:${APTHTTPPORT}/storage unstable/main all Packages
  45. 404 Not Found
  46. Ign:4 http://0.0.0.0:${APTHTTPPORT}/storage unstable/main Translation-en
  47. 404 Not Found
  48. Get:2 http://0.0.0.0:${APTHTTPPORT} unstable/main Sources [$(stat -c %s aptarchive/dists/unstable/main/source/Sources.gz) B]
  49. Get:3 http://0.0.0.0:${APTHTTPPORT} unstable/main all Packages [$(stat -c %s aptarchive/dists/unstable/main/binary-all/Packages.gz) B]
  50. Get:4 http://0.0.0.0:${APTHTTPPORT} unstable/main Translation-en [$(stat -c %s aptarchive/dists/unstable/main/i18n/Translation-en.gz) B]
  51. Reading package lists...
  52. Building dependency tree...
  53. All packages are up to date." apt update
  54. find aptarchive -name 'InRelease' -delete
  55. rm -rf rootdir/var/lib/apt/lists
  56. testsuccessequal "Ign:1 http://0.0.0.0:${APTHTTPPORT}/storage unstable InRelease
  57. 404 Not Found
  58. Get:2 http://0.0.0.0:${APTHTTPPORT} unstable Release [$(stat -c %s aptarchive/dists/unstable/Release) B]
  59. Get:3 http://0.0.0.0:${APTHTTPPORT} unstable Release.gpg [$(stat -c %s aptarchive/dists/unstable/Release.gpg) B]
  60. Get:4 http://0.0.0.0:${APTHTTPPORT} unstable/main Sources [$(stat -c %s aptarchive/dists/unstable/main/source/Sources.gz) B]
  61. Get:5 http://0.0.0.0:${APTHTTPPORT} unstable/main all Packages [$(stat -c %s aptarchive/dists/unstable/main/binary-all/Packages.gz) B]
  62. Get:6 http://0.0.0.0:${APTHTTPPORT} unstable/main Translation-en [$(stat -c %s aptarchive/dists/unstable/main/i18n/Translation-en.gz) B]
  63. Reading package lists..." aptget update
  64. testsuccessequal "Ign:1 http://0.0.0.0:${APTHTTPPORT}/storage unstable InRelease
  65. 404 Not Found
  66. Hit:2 http://0.0.0.0:${APTHTTPPORT} unstable Release
  67. Reading package lists..." aptget update
  68. rm -rf rootdir/var/lib/apt/lists
  69. find aptarchive -name 'Release.gpg' -delete
  70. find aptarchive -name 'Release' -delete
  71. testwarning aptget update
  72. testsuccess grep 'does not have a Release file' rootdir/tmp/testwarning.output