test-bug-596498-trusted-unsigned-repo 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #!/bin/sh
  2. set -e
  3. TESTDIR=$(readlink -f $(dirname $0))
  4. . $TESTDIR/framework
  5. setupenvironment
  6. configarchitecture 'i386'
  7. buildsimplenativepackage 'cool' 'i386' '1.0' 'unstable'
  8. setupaptarchive
  9. aptgetupdate() {
  10. rm -rf rootdir/var/lib/apt/ rootdir/var/cache/apt/*.bin
  11. aptget update -qq
  12. }
  13. PKGTEXT="$(aptget install cool --assume-no -d | head -n 7)"
  14. DEBFILE='rootdir/etc/apt/sources.list.d/apt-test-unstable-deb.list'
  15. testequal "$PKGTEXT
  16. Download complete and in download only mode" aptget install cool --assume-no -d
  17. testequal "$PKGTEXT
  18. Download complete and in download only mode" aptget install cool --assume-no -d --allow-unauthenticated
  19. sed -i -e 's#deb#deb [trusted=no]#' $DEBFILE
  20. aptgetupdate
  21. testequal "$PKGTEXT
  22. WARNING: The following packages cannot be authenticated!
  23. cool
  24. Install these packages without verification? [y/N] N
  25. E: Some packages could not be authenticated" aptget install cool --assume-no -d
  26. find aptarchive/ \( -name 'Release.gpg' -o -name 'InRelease' \) -delete
  27. sed -i -e 's#deb \[trusted=no\]#deb#' $DEBFILE
  28. aptgetupdate
  29. testequal "$PKGTEXT
  30. WARNING: The following packages cannot be authenticated!
  31. cool
  32. Install these packages without verification? [y/N] N
  33. E: Some packages could not be authenticated" aptget install cool --assume-no -d
  34. testequal "$PKGTEXT
  35. WARNING: The following packages cannot be authenticated!
  36. cool
  37. Authentication warning overridden.
  38. Download complete and in download only mode" aptget install cool --assume-no -d --allow-unauthenticated
  39. sed -i -e 's#deb#deb [trusted=yes]#' $DEBFILE
  40. aptgetupdate
  41. testequal "$PKGTEXT
  42. Download complete and in download only mode" aptget install cool --assume-no -d