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.
 
 
 
 
 
 

95 lines
4.2 KiB

  1. #!/bin/sh
  2. set -e
  3. TESTDIR="$(readlink -f "$(dirname "$0")")"
  4. . "$TESTDIR/framework"
  5. setupenvironment
  6. configarchitecture 'i386'
  7. insertpackage 'unstable' 'foo' 'all' '2' 'Depends: foo-common (= 2)'
  8. insertpackage 'unstable' 'foo-common' 'all' '2'
  9. insertpackage 'unstable' 'baz' 'all' '1'
  10. insertpackage 'experimental' 'foo' 'all' '5' 'Depends: foo-common (= 5)'
  11. insertpackage 'experimental' 'foo-common' 'all' '5' 'Source: foo (5)'
  12. insertpackage 'experimental' 'baz' 'all' '2'
  13. setupaptarchive
  14. insertinstalledpackage 'build-essential' 'all' '1'
  15. cat > foobar.dsc <<EOF
  16. Format: 3.0 (native)
  17. Source: foobar
  18. Binary: foobar
  19. Architecture: all
  20. Version: 1
  21. Maintainer: Joe Sixpack <joe@example.org>
  22. Build-Depends: foo (= 5), baz
  23. Standards-Version: 4.1.3
  24. EOF
  25. buildsimplenativepackage 'foobar2' 'all' '1' 'unstable' 'Depends: foo (= 5), baz'
  26. ln -s "$(readlink -f ./incoming/foobar2_1_all.deb)" foobar.deb
  27. mkdir -p foobar
  28. testfailuremsg 'E: Unable to correct problems, you have held broken packages.' apt build-dep "$(readlink -f ./foobar.dsc)" -s
  29. testfailuremsg 'E: Unable to correct problems, you have held broken packages.' apt install "$(readlink -f ./foobar.deb)" -s
  30. testfailuremsg 'E: Unable to correct problems, you have held broken packages.' apt build-dep ./foobar.dsc -s
  31. testfailuremsg 'E: Unable to correct problems, you have held broken packages.' apt install ./foobar.deb -s
  32. cd foobar
  33. testfailuremsg 'E: Unable to correct problems, you have held broken packages.' apt build-dep ../foobar.dsc -s
  34. testfailuremsg 'E: Unable to correct problems, you have held broken packages.' apt install ../foobar.deb -s
  35. cd ..
  36. SUCCESSDSC='The following NEW packages will be installed:
  37. baz foo foo-common
  38. 0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
  39. Inst baz (1 unstable [all])
  40. Inst foo-common (5 experimental [all])
  41. Inst foo (5 experimental [all])
  42. Conf baz (1 unstable [all])
  43. Conf foo-common (5 experimental [all])
  44. Conf foo (5 experimental [all])'
  45. SUCCESSDEB='The following additional packages will be installed:
  46. baz foo foo-common
  47. The following NEW packages will be installed:
  48. baz foo foo-common foobar2
  49. 0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded.
  50. Inst baz (1 unstable [all])
  51. Inst foo-common (5 experimental [all])
  52. Inst foo (5 experimental [all])
  53. Inst foobar2 (1 local-deb [all])
  54. Conf baz (1 unstable [all])
  55. Conf foo-common (5 experimental [all])
  56. Conf foo (5 experimental [all])
  57. Conf foobar2 (1 local-deb [all])'
  58. testsuccessequal "Note, using file '$(readlink -f ./foobar.dsc)' to get the build dependencies
  59. $SUCCESSDSC" apt build-dep "$(readlink -f ./foobar.dsc)/experimental" -s -q=2
  60. testsuccessequal "Reading package lists...
  61. Building dependency tree...
  62. Note, selecting 'foobar2' instead of '$(readlink -f ./foobar.deb)'
  63. $SUCCESSDEB" apt install "$(readlink -f ./foobar.deb)/experimental" -s
  64. testsuccessequal "Note, using file './foobar.dsc' to get the build dependencies
  65. $SUCCESSDSC" apt build-dep ./foobar.dsc/experimental -sq=2
  66. testsuccessequal "Reading package lists...
  67. Building dependency tree...
  68. Note, selecting 'foobar2' instead of './foobar.deb'
  69. $SUCCESSDEB" apt install "./foobar.deb/experimental" -s
  70. cd foobar
  71. testsuccessequal "Note, using file '../foobar.dsc' to get the build dependencies
  72. $SUCCESSDSC" apt build-dep ../foobar.dsc/experimental -sqq
  73. testsuccessequal "Reading package lists...
  74. Building dependency tree...
  75. Note, selecting 'foobar2' instead of '../foobar.deb'
  76. $SUCCESSDEB" apt install "../foobar.deb/experimental" -s
  77. cd ..
  78. msgmsg 'fail with' 'incorrect release'
  79. testfailuremsg 'E: Unable to correct problems, you have held broken packages.' apt build-dep "$(readlink -f ./foobar.dsc)/stable" -s
  80. testfailuremsg 'E: Unable to correct problems, you have held broken packages.' apt install "$(readlink -f ./foobar.deb)/stable" -s
  81. testfailuremsg 'E: Unable to correct problems, you have held broken packages.' apt build-dep ./foobar.dsc/stable -s
  82. testfailuremsg 'E: Unable to correct problems, you have held broken packages.' apt install ./foobar.deb/stable -s
  83. cd foobar
  84. testfailuremsg 'E: Unable to correct problems, you have held broken packages.' apt build-dep ../foobar.dsc/stable -s
  85. testfailuremsg 'E: Unable to correct problems, you have held broken packages.' apt install ../foobar.deb/stable -s
  86. cd ..