test-apt-get-update-unauth-warning 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #!/bin/sh
  2. #
  3. # ensure we print warnings for unauthenticated repositories
  4. #
  5. set -e
  6. TESTDIR=$(readlink -f $(dirname $0))
  7. . $TESTDIR/framework
  8. setupenvironment
  9. configarchitecture "i386"
  10. # a "normal" package with source and binary
  11. buildsimplenativepackage 'foo' 'all' '2.0'
  12. setupaptarchive --no-update
  13. APTARCHIVE=$(readlink -f ./aptarchive)
  14. rm -f $APTARCHIVE/dists/unstable/*Release*
  15. # update without authenticated files leads to warning
  16. testequal "Ign file: unstable InRelease
  17. File not found
  18. Err file: unstable Release
  19. File not found
  20. W: The repository 'file: unstable Release' does not have a Release file. This is deprecated, please contact the owner of the repository.
  21. E: Use --allow-insecure-repositories to force the update" aptget update --no-allow-insecure-repositories
  22. # no package foo
  23. testequal 'Listing...' apt list foo
  24. testequal 'lock
  25. partial' ls rootdir/var/lib/apt/lists
  26. # allow override
  27. testequal "Ign file: unstable InRelease
  28. File not found
  29. Ign file: unstable Release
  30. File not found
  31. Reading package lists...
  32. W: The repository 'file: unstable Release' does not have a Release file. This is deprecated, please contact the owner of the repository." aptget update --allow-insecure-repositories
  33. # ensure we can not install the package
  34. testequal "WARNING: The following packages cannot be authenticated!
  35. foo
  36. E: There are problems and -y was used without --force-yes" aptget install -qq -y foo