2000-dinstall 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. #! /bin/bash
  2. #
  3. # © 2019 Niels Thykier <niels@thykier.net>
  4. # License: GPL-2+
  5. #
  6. # This program is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 2 of the License, or
  9. # (at your option) any later version.
  10. #
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. # GNU General Public License for more details.
  15. #
  16. # You should have received a copy of the GNU General Public License
  17. # along with this program. If not, see <https://www.gnu.org/licenses/>.
  18. set -e
  19. set -u
  20. . ${DAK_ROOT:?}/integration-tests/common
  21. . ${DAK_ROOT:?}/integration-tests/setup
  22. . ${DAK_ROOT:?}/integration-tests/dinstall
  23. echo "Dinstall::AllowSourceOnlyUploads true;" >> ${DAKBASE}/etc/dak.conf
  24. setup_debian_like_archive
  25. import-fixture-signing-key
  26. # Verify that our dinstall works with an empty archive
  27. dinstall
  28. (
  29. packages=$(fixture-package-dir)
  30. upload_changes ${packages:?}/nonfree-package_0.1-1_amd64.changes
  31. upload_changes ${packages:?}/package_0.1-1_amd64.changes
  32. upload_changes ${packages:?}/main-contrib-with-debug_0.1-1_amd64.changes
  33. process_uploads
  34. )
  35. echo "Verifying that packages in NEW are *not* published"
  36. if ls -l ${DAKBASE}/ftp-master/pool/main/p/package/package_*.dsc 2>/dev/null ; then
  37. # We never acepted it, so it should not be published!
  38. echo "package has been publish even though it is still in NEW!?" >&2
  39. dak ls package
  40. exit 1
  41. fi
  42. echo "OK; accepting the package and running dinstall to see it become published"
  43. # Accept the package from NEW
  44. (
  45. dak control-overrides -s unstable -t deb -a << EOF
  46. package required admin
  47. EOF
  48. dak control-overrides -s unstable -t dsc -a << EOF
  49. package admin
  50. EOF
  51. echo a | dak process-new main-contrib-with-debug_0.1-1_amd64.changes
  52. dak process-new --automatic
  53. dak process-policy new
  54. )
  55. to_testing="$(cat <<EOF
  56. contrib-with-debug 0.2-1 amd64
  57. main-contrib-with-debug 0.2-1 source
  58. main-package 0.2-1 all
  59. package 0.1-1 all
  60. package 0.1-1 source
  61. EOF
  62. )"
  63. (
  64. upload_changes ${packages:?}/main-contrib-with-debug_0.2-1_amd64.changes
  65. process_uploads
  66. dak ls main-contrib-with-debug
  67. echo "$to_testing" | dak control-suite -s testing
  68. )
  69. # we put the changelogs withing the ftp-master dir, so they will be checked by check_all_suites below
  70. psql -c "update archive set changelog='$DAKBASE/ftp-master/changelogs' where name='ftp-master';"
  71. dak make-changelog -e -a ftp-master
  72. # After running dinstall, the package should now be present in the pool
  73. dinstall
  74. ls -l ${DAKBASE}/ftp-master/pool/main/p/package/package_*.dsc
  75. echo "Published successfully"
  76. check_all_suites end
  77. dak ls main-contrib-with-debug
  78. # check that these packages have actually been published
  79. ls -l ${DAKBASE}/ftp-master/pool/main/m/main-contrib-with-debug/main-package_0.2-1_all.deb
  80. ls -l ${DAKBASE}/ftp-master/pool/contrib/m/main-contrib-with-debug/contrib-with-debug_0.2-1_amd64.deb