test-bug-732746-preferences 611 B

123456789101112131415161718192021222324252627282930313233
  1. #!/bin/sh
  2. set -e
  3. TESTDIR="$(readlink -f "$(dirname "$0")")"
  4. . "$TESTDIR/framework"
  5. setupenvironment
  6. configarchitecture 'i386'
  7. insertinstalledpackage 'bar' 'i386' '1.0'
  8. cat > rootdir/etc/apt/preferences << EOF
  9. # random test comment header
  10. # commented out by puppy^Wpuppet
  11. #Package: foo
  12. #Pin: origin "ftp.debian.org"
  13. #Pin: 800
  14. Package: bar
  15. Pin: version 1.0
  16. Pin-Priority: 700
  17. #Package: bar
  18. #Pin: version 1.0
  19. #Pin: 800
  20. EOF
  21. testsuccessequal "Reading package lists...
  22. Building dependency tree..." aptget check
  23. msgtest "Ensure policy is applied"
  24. aptcache policy bar|grep -q "*** 1.0 700" && msgpass || msgfail