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.

test-apt-update-releaseinfo-changes 5.2 KiB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. #!/bin/sh
  2. set -e
  3. TESTDIR="$(readlink -f "$(dirname "$0")")"
  4. . "$TESTDIR/framework"
  5. setupenvironment
  6. configarchitecture 'amd64'
  7. insertpackage 'earth' 'human' 'all' '1'
  8. getoriginfromsuite() { echo -n 'Earth'; }
  9. getlabelfromsuite() { echo -n 'Blue Planet'; }
  10. getcodenamefromsuite() { echo -n 'home'; }
  11. getreleaseversionfromsuite() { echo -n '1.0'; }
  12. getnotautomaticfromsuite() { echo -n 'yes'; }
  13. getbutautomaticupgradesfromsuite() { echo -n 'yes'; }
  14. setupaptarchive --no-update
  15. testsuccess aptget update
  16. cp -a aptarchive/dists aptarchive/dists.bak
  17. cp -a rootdir/var/lib/apt/lists rootdir/var/lib/apt/lists.bak
  18. APTARCHIVE="$(readlink -f './aptarchive')"
  19. sed -i -e 's#^Origin: Earth#Origin: Mars#' $(find ./aptarchive -name 'Release')
  20. signreleasefiles
  21. testfailuremsg "E: Repository 'file:$APTARCHIVE earth InRelease' changed its 'Origin' value from 'Earth' to 'Mars'
  22. N: This must be accepted explicitly before updates for this repository can be applied. See apt-secure(8) manpage for details." apt update
  23. testfailure apt update --allow-releaseinfo-change-label
  24. testsuccesswithnotice apt update --allow-releaseinfo-change
  25. testequal "All packages are up to date.
  26. N: Repository 'file:$APTARCHIVE earth InRelease' changed its 'Origin' value from 'Earth' to 'Mars'" tail -n 2 rootdir/tmp/testsuccesswithnotice.output
  27. rm -rf rootdir/var/lib/apt/lists
  28. cp -a rootdir/var/lib/apt/lists.bak rootdir/var/lib/apt/lists
  29. sed -i -e 's#^Label: Blue#Label: Red#' $(find ./aptarchive -name 'Release')
  30. signreleasefiles
  31. testfailuremsg "E: Repository 'file:$APTARCHIVE earth InRelease' changed its 'Origin' value from 'Earth' to 'Mars'
  32. E: Repository 'file:$APTARCHIVE earth InRelease' changed its 'Label' value from 'Blue Planet' to 'Red Planet'
  33. N: This must be accepted explicitly before updates for this repository can be applied. See apt-secure(8) manpage for details." apt update
  34. testfailure apt update --allow-releaseinfo-change-label
  35. testfailuremsg "N: Repository 'file:$APTARCHIVE earth InRelease' changed its 'Origin' value from 'Earth' to 'Mars'
  36. E: Repository 'file:$APTARCHIVE earth InRelease' changed its 'Label' value from 'Blue Planet' to 'Red Planet'
  37. N: This must be accepted explicitly before updates for this repository can be applied. See apt-secure(8) manpage for details." apt update --allow-releaseinfo-change-origin
  38. testsuccess apt update --allow-releaseinfo-change-origin --allow-releaseinfo-change-label -o quiet::ReleaseInfoChange=true
  39. # version changes are allowed by default
  40. sed -i -e 's#^Version: 1#Version: 2#' $(find ./aptarchive -name 'Release')
  41. signreleasefiles
  42. testfailuremsg "E: Repository 'file:$APTARCHIVE earth InRelease' changed its 'Version' value from '1.0' to '2.0'
  43. N: This must be accepted explicitly before updates for this repository can be applied. See apt-secure(8) manpage for details." apt update --no-allow-releaseinfo-change-version
  44. testsuccesswithnotice apt update
  45. testequal "All packages are up to date.
  46. N: Repository 'file:$APTARCHIVE earth InRelease' changed its 'Version' value from '1.0' to '2.0'" tail -n 2 rootdir/tmp/testsuccesswithnotice.output
  47. sed -i -e 's#^Codename: home#Codename: colony#' $(find ./aptarchive -name 'Release')
  48. signreleasefiles
  49. testfailuremsg "E: Repository 'file:$APTARCHIVE earth InRelease' changed its 'Codename' value from 'home' to 'colony'
  50. N: This must be accepted explicitly before updates for this repository can be applied. See apt-secure(8) manpage for details." apt update --no-allow-releaseinfo-change-codename
  51. testsuccesswithnotice apt update --allow-releaseinfo-change-codename
  52. testequal "All packages are up to date.
  53. N: Repository 'file:$APTARCHIVE earth InRelease' changed its 'Codename' value from 'home' to 'colony'" tail -n 2 rootdir/tmp/testsuccesswithnotice.output
  54. sed -i -e '/^ButAutomaticUpgrades: / d' $(find ./aptarchive -name 'Release')
  55. signreleasefiles
  56. testfailuremsg "E: Repository 'file:$APTARCHIVE earth InRelease' changed its default priority for apt_preferences(5) from 100 to 1.
  57. N: This must be accepted explicitly before updates for this repository can be applied. See apt-secure(8) manpage for details." apt update
  58. testsuccesswithnotice apt update --allow-releaseinfo-change
  59. testequal "All packages are up to date.
  60. N: Repository 'file:$APTARCHIVE earth InRelease' changed its default priority for apt_preferences(5) from 100 to 1." tail -n 2 rootdir/tmp/testsuccesswithnotice.output
  61. sed -i -e '/^NotAutomatic: / d' -e '/^Codename: / a\
  62. Release-Notes: https://example.org/mars/release-notes' $(find ./aptarchive -name 'Release')
  63. signreleasefiles
  64. testfailuremsg "E: Repository 'file:$APTARCHIVE earth InRelease' changed its default priority for apt_preferences(5) from 1 to 500.
  65. N: More information about this can be found online in the Release notes at: https://example.org/mars/release-notes
  66. N: This must be accepted explicitly before updates for this repository can be applied. See apt-secure(8) manpage for details." apt update
  67. testsuccesswithnotice apt update --allow-releaseinfo-change-defaultpin
  68. testequal "All packages are up to date.
  69. N: Repository 'file:$APTARCHIVE earth InRelease' changed its default priority for apt_preferences(5) from 1 to 500.
  70. N: More information about this can be found online in the Release notes at: https://example.org/mars/release-notes" tail -n 3 rootdir/tmp/testsuccesswithnotice.output