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

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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 repository 'file: unstable Release' does not have a Release file. This is deprecated, please contact the owner of the repository.
  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 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
  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