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

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