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.
 
 
 
 
 
 

62 lines
1.5 KiB

  1. #!/bin/sh
  2. set -e
  3. TESTDIR="$(readlink -f "$(dirname "$0")")"
  4. . "$TESTDIR/framework"
  5. setupenvironment
  6. configarchitecture 'amd64'
  7. insertpackage 'unstable' 'cool' 'amd64' '1.0'
  8. export APT_DONT_SIGN='InRelease'
  9. setupaptarchive --no-update
  10. changetowebserver
  11. echo 'Packages-Require-Authorization: yes' >> aptarchive/dists/unstable/Release
  12. signreleasefiles
  13. testsuccess aptget update
  14. testsuccessequal "Package files:
  15. 100 ${TMPWORKINGDIRECTORY}/rootdir/var/lib/dpkg/status
  16. release a=now
  17. -32768 http://localhost:${APTHTTPPORT} unstable/main amd64 Packages
  18. release a=unstable,n=sid,c=main,b=amd64
  19. origin localhost
  20. Pinned packages:" aptcache policy
  21. mkdir rootdir/etc/apt/auth.conf.d
  22. cat > rootdir/etc/apt/auth.conf.d/myauth.conf << EOF
  23. machine localhost
  24. login username
  25. password usersPassword
  26. EOF
  27. testsuccessequal "Package files:
  28. 100 ${TMPWORKINGDIRECTORY}/rootdir/var/lib/dpkg/status
  29. release a=now
  30. 500 http://localhost:${APTHTTPPORT} unstable/main amd64 Packages
  31. release a=unstable,n=sid,c=main,b=amd64
  32. origin localhost
  33. Pinned packages:" aptcache policy
  34. cat > rootdir/etc/apt/preferences.d/myauth.pref << EOF
  35. Package: *
  36. Pin: origin localhost
  37. Pin-Priority: 990
  38. Package: cool
  39. Pin: origin localhost
  40. Pin-Priority: 990
  41. EOF
  42. testsuccessequal "Package files:
  43. 100 ${TMPWORKINGDIRECTORY}/rootdir/var/lib/dpkg/status
  44. release a=now
  45. 990 http://localhost:${APTHTTPPORT} unstable/main amd64 Packages
  46. release a=unstable,n=sid,c=main,b=amd64
  47. origin localhost
  48. Pinned packages:
  49. cool -> 1.0 with priority 990" aptcache policy