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.
 
 
 
 
 
 

45 lines
1.6 KiB

  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. aptget changelog apt -qq > apt.changelog
  21. testfileequal 'apt.changelog' "$(cat aptarchive/pool/apt_1.0/changelog)"
  22. rm apt.changelog
  23. testsuccess aptget changelog apt -d
  24. testfileequal 'apt.changelog' "$(cat aptarchive/pool/apt_1.0/changelog)"
  25. rm apt.changelog aptarchive/pool/apt_1.0/changelog
  26. testequal "$(cat aptarchive/pool/apt_1.0.changelog)" aptget changelog apt \
  27. -qq -o APT::Changelogs::Server='http://not-on-the-main-server:8080/'
  28. testsuccess aptget changelog apt -d
  29. testfileequal 'apt.changelog' "$(cat aptarchive/pool/apt_1.0.changelog)"
  30. rm apt.changelog aptarchive/pool/apt_1.0.changelog
  31. testequal 'E: changelog download failed' aptget changelog apt -qq -o APT::Changelogs::Server='http://not-on-the-main-server:8080/'