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. Err file: unstable Release
  18. W: The data from 'file: unstable Release' is not signed. Packages from that repository can not be authenticated.
  19. W: Use --allow-insecure-repositories to force the update
  20. W: Failed to fetch file:$APTARCHIVE/dists/unstable/Release
  21. E: Some index files failed to download. They have been ignored, or old ones used instead." aptget update
  22. # no package foo
  23. testequal "Listing..." apt list foo
  24. testequal "partial" ls rootdir/var/lib/apt/lists
  25. # allow override
  26. testequal "Ign file: unstable InRelease
  27. Ign file: unstable Release
  28. Reading package lists...
  29. W: The data from 'file: unstable Release' is not signed. Packages from that repository can not be authenticated." aptget update --allow-insecure-repositories
  30. # ensure we can not install the package
  31. testequal "WARNING: The following packages cannot be authenticated!
  32. foo
  33. E: There are problems and -y was used without --force-yes" aptget install -qq -y foo