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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. sed -i -e 's#deb#deb [trusted=no]#' $DEBFILE
  18. aptgetupdate
  19. testequal "$PKGTEXT
  20. WARNING: The following packages cannot be authenticated!
  21. cool
  22. Install these packages without verification [y/N]? N
  23. E: Some packages could not be authenticated" aptget install cool --assume-no -d
  24. find aptarchive/ \( -name 'Release.gpg' -o -name 'InRelease' \) -delete
  25. sed -i -e 's#deb \[trusted=no\]#deb#' $DEBFILE
  26. aptgetupdate
  27. testequal "$PKGTEXT
  28. WARNING: The following packages cannot be authenticated!
  29. cool
  30. Install these packages without verification [y/N]? N
  31. E: Some packages could not be authenticated" aptget install cool --assume-no -d
  32. sed -i -e 's#deb#deb [trusted=yes]#' $DEBFILE
  33. aptgetupdate
  34. testequal "$PKGTEXT
  35. Download complete and in download only mode" aptget install cool --assume-no -d