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. 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 "partial" ls rootdir/var/lib/apt/lists
  25. # allow override
  26. testequal "Ign file: unstable InRelease
  27. File not found
  28. Ign file: unstable Release
  29. File not found
  30. Reading package lists...
  31. 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
  32. # ensure we can not install the package
  33. testequal "WARNING: The following packages cannot be authenticated!
  34. foo
  35. E: There are problems and -y was used without --force-yes" aptget install -qq -y foo