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

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. Ign file: unstable Release
  18. Reading package lists...
  19. W: The data from 'file: unstable Release' is not signed. Packages from that repository can not be authenticated.
  20. W: Use --allow-unauthenticated to force the update" aptget update
  21. # no package foo
  22. testequal "Listing..." apt list foo
  23. # allow override
  24. testequal "Ign file: unstable InRelease
  25. Ign file: unstable Release
  26. Reading package lists...
  27. W: The data from 'file: unstable Release' is not signed. Packages from that repository can not be authenticated." aptget update --allow-unauthenticated
  28. # ensure we can not install the package
  29. testequal "WARNING: The following packages cannot be authenticated!
  30. foo
  31. E: There are problems and -y was used without --force-yes" aptget install -qq -y foo