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.
 
 
 
 
 
 

68 lines
2.4 KiB

  1. #!/bin/sh
  2. set -e
  3. TESTDIR="$(readlink -f "$(dirname "$0")")"
  4. . "$TESTDIR/framework"
  5. setupenvironment
  6. configarchitecture "i386"
  7. setupaptarchive
  8. test ! -e rootdir/etc/apt/apt.conf || mv rootdir/etc/apt/apt.conf rootdir/etc/apt/apt.conf.d/000move-away-apt.conf
  9. msgtest "Directory instead of a file as apt.conf ignored"
  10. mkdir -p rootdir/etc/apt/apt.conf
  11. testsuccess --nomsg aptconfig dump
  12. rmdir rootdir/etc/apt/apt.conf
  13. msgtest "Good link instead of a file as apt.conf ignored"
  14. echo 'Test::APT::Link "good";' > rootdir/etc/apt/good-link.conf
  15. ln -s rootdir/etc/apt/good-link.conf rootdir/etc/apt/apt.conf
  16. testempty aptconfig shell TestLink 'Test::APT::Link'
  17. rm rootdir/etc/apt/apt.conf
  18. msgtest "Broken link instead of a file as apt.conf ignored"
  19. ln -s /tmp/doesnt-exist rootdir/etc/apt/apt.conf
  20. testsuccess --nomsg aptconfig dump
  21. rm rootdir/etc/apt/apt.conf
  22. test ! -e rootdir/etc/apt/sources.list || mv rootdir/etc/apt/sources.list rootdir/etc/apt/sources.list.d/000move-away-sources.list
  23. msgtest "Directory instead of a file as sources.list ignored"
  24. mkdir -p rootdir/etc/apt/sources.list
  25. testsuccess --nomsg aptget update --print-uris
  26. rmdir rootdir/etc/apt/sources.list
  27. msgtest "Good link instead of a file as sources.list ignored"
  28. echo 'deb file:///tmp/debian sid main' > rootdir/etc/apt/good-link.list
  29. ln -s rootdir/etc/apt/good-link.list rootdir/etc/apt/sources.list
  30. testempty aptget update --print-uris
  31. rm rootdir/etc/apt/sources.list
  32. msgtest "Broken link instead of a file as sources.list ignored"
  33. ln -s /tmp/doesnt-exist rootdir/etc/apt/sources.list
  34. testempty aptget update --print-uris
  35. rm rootdir/etc/apt/sources.list
  36. test ! -e rootdir/etc/apt/preferences || mv rootdir/etc/apt/preferences rootdir/etc/apt/preferences.d/000move-away-preferences
  37. msgtest "Directory instead of a file as preferences ignored"
  38. mkdir -p rootdir/etc/apt/preferences
  39. testsuccess --nomsg aptcache policy
  40. rmdir rootdir/etc/apt/preferences
  41. msgtest "Good link instead of a file as preferences ignored"
  42. echo 'Package: apt
  43. Pin: release a=now
  44. Pin-Value: 1000' > rootdir/etc/apt/good-link.pref
  45. ln -s rootdir/etc/apt/good-link.pref rootdir/etc/apt/preferences
  46. testsuccess aptcache policy
  47. testfailure grep '1000 ' rootdir/tmp/testsucess.output
  48. rm rootdir/etc/apt/preferences
  49. msgtest "Broken link instead of a file as preferences ignored"
  50. ln -s /tmp/doesnt-exist rootdir/etc/apt/preferences
  51. testsuccess --nomsg aptcache policy
  52. rm rootdir/etc/apt/preferences