2002-c-s-versionchecks 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. #! /bin/bash
  2. #
  3. # © 2019 Niels Thykier <niels@thykier.net>
  4. # © 2019 Ivo De Decker <ivodd@debian.org>
  5. # License: GPL-2+
  6. #
  7. # This program is free software; you can redistribute it and/or modify
  8. # it under the terms of the GNU General Public License as published by
  9. # the Free Software Foundation; either version 2 of the License, or
  10. # (at your option) any later version.
  11. #
  12. # This program is distributed in the hope that it will be useful,
  13. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. # GNU General Public License for more details.
  16. #
  17. # You should have received a copy of the GNU General Public License
  18. # along with this program. If not, see <https://www.gnu.org/licenses/>.
  19. set -e
  20. set -u
  21. . ${DAK_ROOT:?}/integration-tests/common
  22. . ${DAK_ROOT:?}/integration-tests/setup
  23. . ${DAK_ROOT:?}/integration-tests/dinstall
  24. echo "Dinstall::AllowSourceOnlyUploads true;" >> ${DAKBASE}/etc/dak.conf
  25. setup_debian_like_archive
  26. import-fixture-signing-key
  27. # Verify that our dinstall works with an empty archive
  28. dinstall
  29. (
  30. packages=$(fixture-package-dir)
  31. upload_changes ${packages:?}/binnmupkg_0.1-1_amd64.changes
  32. process_uploads
  33. echo a | dak process-new binnmupkg_0.1-1_amd64.changes
  34. dak process-new --automatic
  35. dak process-policy new
  36. )
  37. to_testing="$(cat <<EOF
  38. binnmupkg 0.1-1 amd64
  39. binnmupkg 0.1-1 source
  40. EOF
  41. )"
  42. echo "$to_testing" | dak control-suite -s testing
  43. dinstall
  44. (
  45. upload_changes ${packages:?}/binnmupkg_0.1-2_source.changes
  46. process_uploads
  47. upload_changes ${packages:?}/binnmupkg_0.1-2_amd64.changes
  48. process_uploads
  49. upload_changes ${packages:?}/binnmupkg_0.1-1+b1_amd64.changes
  50. process_uploads
  51. )
  52. dinstall
  53. (
  54. to_testing2="$(cat <<EOF
  55. binnmupkg 0.1-2 amd64
  56. binnmupkg 0.1-2 source
  57. EOF
  58. )"
  59. # allow newer binnmupkg (from unstable) into testing
  60. echo "$to_testing2" | dak control-suite -s testing
  61. # remove everything from tpu
  62. dak control-suite -s testing-proposed-updates < /dev/null
  63. # remove from build queue as well
  64. dak manage-build-queue buildd-buster-proposed-updates
  65. to_tpu="$(cat <<EOF
  66. binnmupkg 0.1-1+b1 amd64
  67. binnmupkg 0.1-1 source
  68. EOF
  69. )"
  70. echo "setting testing-proposed-updates with control-suite: this should fail"
  71. # put binnmupkg (back) into tpu - the version check should fail
  72. if echo "$to_tpu" | dak control-suite -s testing-proposed-updates
  73. then
  74. echo "E: control-suite should not allow package into testing-proposed-updates older than testing"
  75. echo testing
  76. dak control-suite -l testing | sort
  77. printf "\n\ntesting-proposed-updates\n"
  78. dak control-suite -l testing-proposed-updates | sort
  79. exit 1
  80. else
  81. # OK
  82. true
  83. fi
  84. # reset testing to what it was before (with force)
  85. echo "$to_testing" | dak control-suite -f -s testing
  86. # put binnmupkg into tpu - this should succeed now
  87. echo "$to_tpu" | dak control-suite -s testing-proposed-updates
  88. )
  89. check_all_suites end