You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

85 lines
3.1 KiB

  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. configcompression '.' 'gz'
  11. # a "normal" package with source and binary
  12. buildsimplenativepackage 'foo' 'all' '2.0'
  13. setupaptarchive --no-update
  14. APTARCHIVE=$(readlink -f ./aptarchive)
  15. rm -f $APTARCHIVE/dists/unstable/*Release*
  16. # update without authenticated files leads to warning
  17. testfailureequal "Get:1 file:$APTARCHIVE unstable InRelease
  18. Ign:1 file:$APTARCHIVE unstable InRelease
  19. File not found
  20. Get:2 file:$APTARCHIVE unstable Release
  21. Err:2 file:$APTARCHIVE unstable Release
  22. File not found
  23. W: The repository 'file:$APTARCHIVE unstable Release' does not have a Release file. This is deprecated, please contact the owner of the repository.
  24. E: Use --allow-insecure-repositories to force the update" aptget update --no-allow-insecure-repositories
  25. # no package foo
  26. testsuccessequal 'Listing...' apt list foo
  27. testequal 'lock
  28. partial' ls rootdir/var/lib/apt/lists
  29. filesize() {
  30. stat -c%s "$(aptget files --no-release-info --format '$(URI)' "Created-By: $1" | cut -d'/' -f 3- ).gz"
  31. }
  32. # allow override
  33. #aptget update --allow-insecure-repositories -o Debug::pkgAcquire::worker=1
  34. #exit
  35. testwarningequal "Get:1 file:$APTARCHIVE unstable InRelease
  36. Ign:1 file:$APTARCHIVE unstable InRelease
  37. File not found
  38. Get:2 file:$APTARCHIVE unstable Release
  39. Ign:2 file:$APTARCHIVE unstable Release
  40. File not found
  41. Get:3 file:$APTARCHIVE unstable/main Sources
  42. Ign:3 file:$APTARCHIVE unstable/main Sources
  43. File not found
  44. Get:4 file:$APTARCHIVE unstable/main i386 Packages
  45. Ign:4 file:$APTARCHIVE unstable/main i386 Packages
  46. File not found
  47. Get:5 file:$APTARCHIVE unstable/main Translation-en
  48. Ign:5 file:$APTARCHIVE unstable/main Translation-en
  49. File not found
  50. Get:3 file:$APTARCHIVE unstable/main Sources
  51. Ign:3 file:$APTARCHIVE unstable/main Sources
  52. File not found
  53. Get:4 file:$APTARCHIVE unstable/main i386 Packages
  54. Ign:4 file:$APTARCHIVE unstable/main i386 Packages
  55. File not found
  56. Get:5 file:$APTARCHIVE unstable/main Translation-en
  57. Ign:5 file:$APTARCHIVE unstable/main Translation-en
  58. File not found
  59. Get:3 file:$APTARCHIVE unstable/main Sources
  60. Ign:3 file:$APTARCHIVE unstable/main Sources
  61. File not found
  62. Get:4 file:$APTARCHIVE unstable/main i386 Packages
  63. Ign:4 file:$APTARCHIVE unstable/main i386 Packages
  64. File not found
  65. Get:5 file:$APTARCHIVE unstable/main Translation-en
  66. Ign:5 file:$APTARCHIVE unstable/main Translation-en
  67. File not found
  68. Get:3 file:$APTARCHIVE unstable/main Sources [$(filesize 'Sources') B]
  69. Get:4 file:$APTARCHIVE unstable/main i386 Packages [$(filesize 'Packages') B]
  70. Get:5 file:$APTARCHIVE unstable/main Translation-en [$(filesize 'Translations') B]
  71. Reading package lists...
  72. W: The repository 'file:$APTARCHIVE unstable Release' does not have a Release file. This is deprecated, please contact the owner of the repository." aptget update --allow-insecure-repositories
  73. # ensure we can not install the package
  74. testfailureequal "WARNING: The following packages cannot be authenticated!
  75. foo
  76. E: There are problems and -y was used without --force-yes" aptget install -qq -y foo