2001-cruft 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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. packages=$(fixture-package-dir)
  28. (
  29. upload_changes ${packages:?}/binnmupkg_0.1-1_amd64.changes
  30. upload_changes ${packages:?}/pkgnew_0.1-1_amd64.changes
  31. process_uploads
  32. echo a | dak process-new binnmupkg_0.1-1_amd64.changes
  33. echo a | dak process-new pkgnew_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:?}/pkgnew_0.1-2~exp_amd64.changes
  46. process_uploads
  47. echo a | dak process-new pkgnew_0.1-2~exp_amd64.changes
  48. dak process-new --automatic
  49. dak process-policy new
  50. # pretend the upload to experimental happened (more than) 14 days ago to
  51. # trigger NVIU issue below
  52. echo "update override set created = created - interval '14 days' where package like 'pkg%';" | psql
  53. upload_changes ${packages:?}/pkgnew_0.1-2_source.changes
  54. process_uploads
  55. upload_changes ${packages:?}/pkgnew_0.1-2_all.changes
  56. process_uploads
  57. upload_changes ${packages:?}/binnmupkg_0.1-2_source.changes
  58. process_uploads
  59. upload_changes ${packages:?}/binnmupkg_0.1-2_amd64.changes
  60. process_uploads
  61. upload_changes ${packages:?}/binnmupkg_0.1-1+b1_amd64.changes
  62. process_uploads
  63. check_all_suites before_dinstall_nviu
  64. # trigger obsolete override issue: needs 2 dinstalls:
  65. # NVIU is done after obsolete overrides, so we needs a second dinstall to
  66. # remove the overrides for the packages removed by NVIU
  67. dinstall
  68. dinstall
  69. # pkgnew in experimental isn't cleaned up yet, the amd64 binaries are
  70. # missing in unstable
  71. check_all_suites after_dinstall_nviu
  72. upload_changes ${packages:?}/pkgnew_0.1-2_amd64.changes
  73. process_uploads
  74. # now pkgnew will be cleaned up in experimental
  75. dinstall
  76. dinstall
  77. )
  78. check_all_suites end
  79. (
  80. # doesn't have pkg-any4 and pkg-all4
  81. upload_changes ${packages:?}/pkgnew_0.1-3_amd64.changes
  82. process_uploads
  83. check_output cruft_report.txt "dak cruft-report"
  84. )