test-apt-get-changelog 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #!/bin/sh
  2. set -e
  3. TESTDIR=$(readlink -f $(dirname $0))
  4. . $TESTDIR/framework
  5. setupenvironment
  6. configarchitecture "i386"
  7. buildsimplenativepackage 'apt' 'all' '1.0' 'stable'
  8. setupaptarchive --no-update
  9. changetowebserver
  10. testsuccess aptget update
  11. # simulate normal user with non-existent root-owned directories
  12. rm -rf rootdir/var/cache/apt/archives/
  13. mkdir rootdir/var/cache/apt/archives/
  14. addtrap 'prefix' "chmod -f -R +w $PWD/rootdir/var/cache/apt/archives || true;"
  15. chmod -R -w rootdir/var/cache/apt/archives
  16. echo 'Apt::Changelogs::Server "http://localhost:8080/";' > rootdir/etc/apt/apt.conf.d/changelog.conf
  17. testequal "'http://localhost:8080//pool/apt_1.0/changelog'" aptget changelog apt --print-uris
  18. testequal "'http://localhost:8080//pool/apt_1.0/changelog'
  19. 'http://localhost:8080//pool/apt_1.0/changelog'" aptget changelog apt apt --print-uris
  20. testsuccess aptget changelog apt -qq
  21. testfileequal 'rootdir/tmp/testsuccess.output' "$(cat aptarchive/pool/apt_1.0/changelog)"
  22. testsuccess aptget changelog apt -d
  23. testfileequal 'apt.changelog' "$(cat aptarchive/pool/apt_1.0/changelog)"
  24. rm -f apt.changelog aptarchive/pool/apt_1.0/changelog
  25. testequal "$(cat aptarchive/pool/apt_1.0.changelog)" aptget changelog apt \
  26. -qq -o APT::Changelogs::Server='http://not-on-the-main-server:8080/'
  27. testsuccess aptget changelog apt -d
  28. testfileequal 'apt.changelog' "$(cat aptarchive/pool/apt_1.0.changelog)"
  29. rm -f apt.changelog aptarchive/pool/apt_1.0.changelog
  30. testequal 'E: changelog download failed' aptget changelog apt -qq -o APT::Changelogs::Server='http://not-on-the-main-server:8080/'