test-multiarch-allowed 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  1. #!/bin/sh
  2. set -e
  3. TESTDIR=$(readlink -f $(dirname $0))
  4. . $TESTDIR/framework
  5. setupenvironment
  6. configarchitecture 'amd64' 'i386'
  7. insertpackage 'unstable' 'foo' 'amd64,i386' '1' 'Multi-Arch: allowed'
  8. insertpackage 'unstable' 'needsfoo' 'amd64,i386' '1' 'Depends: foo'
  9. insertpackage 'unstable' 'needsfooany' 'amd64,i386' '1' 'Depends: foo:any'
  10. insertpackage 'unstable' 'needsfoover1' 'amd64,i386' '1' 'Depends: foo:any (>= 1)'
  11. insertpackage 'unstable' 'needsfoover2' 'amd64,i386' '1' 'Depends: foo:any (>= 2)'
  12. insertpackage 'unstable' 'hatesfoo' 'amd64' '1' 'Conflicts: foo'
  13. insertpackage 'unstable' 'hatesfooany' 'amd64' '1' 'Conflicts: foo:any' # this makes no sense…
  14. insertpackage 'unstable' 'hatesfoonative' 'amd64' '1' 'Conflicts: foo:amd64'
  15. insertpackage 'unstable' 'coolfoo' 'amd64' '1' 'Multi-Arch:allowed
  16. Provides: coolbar'
  17. insertpackage 'unstable' 'coolfoover' 'amd64' '1' 'Multi-Arch:allowed
  18. Provides: coolbar (= 2)'
  19. insertpackage 'unstable' 'needscoolfoo' 'amd64' '1' 'Depends: coolfoo, coolbar'
  20. insertpackage 'unstable' 'needscoolfooany' 'amd64' '1' 'Depends: coolfoo:any, coolbar:any'
  21. insertpackage 'unstable' 'needscoolfoover0' 'amd64' '1' 'Depends: coolfoo:any (>= 1), coolbar'
  22. insertpackage 'unstable' 'needscoolfoover1' 'amd64' '1' 'Depends: coolfoo:any (>= 1), coolbar (>= 1)'
  23. insertpackage 'unstable' 'needscoolfoover2' 'amd64' '1' 'Depends: coolfoo:any (>= 2), coolbar (>= 1)'
  24. insertpackage 'unstable' 'needscoolfoover3' 'amd64' '1' 'Depends: coolfoo:any (>= 2), coolbar (>= 3)'
  25. setupaptarchive
  26. BADPREFIX='Reading package lists...
  27. Building dependency tree...
  28. Some packages could not be installed. This may mean that you have
  29. requested an impossible situation or if you are using the unstable
  30. distribution that some required packages have not yet been created
  31. or been moved out of Incoming.
  32. The following information may help to resolve the situation:
  33. '
  34. solveableinsinglearch0() {
  35. testsuccessequal 'Reading package lists...
  36. Building dependency tree...
  37. The following extra packages will be installed:
  38. foo
  39. The following NEW packages will be installed:
  40. foo needsfoo
  41. 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
  42. Inst foo (1 unstable [amd64])
  43. Inst needsfoo (1 unstable [amd64])
  44. Conf foo (1 unstable [amd64])
  45. Conf needsfoo (1 unstable [amd64])' aptget install needsfoo -s
  46. }
  47. solveableinsinglearch0
  48. testsuccessequal 'Reading package lists...
  49. Building dependency tree...
  50. The following extra packages will be installed:
  51. foo:i386
  52. The following NEW packages will be installed:
  53. foo:i386 needsfoo:i386
  54. 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
  55. Inst foo:i386 (1 unstable [i386])
  56. Inst needsfoo:i386 (1 unstable [i386])
  57. Conf foo:i386 (1 unstable [i386])
  58. Conf needsfoo:i386 (1 unstable [i386])' aptget install needsfoo:i386 -s
  59. testfailureequal "$BADPREFIX
  60. The following packages have unmet dependencies:
  61. needsfoo:i386 : Depends: foo:i386 but it is not going to be installed
  62. E: Unable to correct problems, you have held broken packages." aptget install needsfoo:i386 foo:amd64 -s
  63. testfailureequal "$BADPREFIX
  64. The following packages have unmet dependencies:
  65. needsfoo : Depends: foo but it is not going to be installed
  66. E: Unable to correct problems, you have held broken packages." aptget install needsfoo foo:i386 -s
  67. solveableinsinglearch1() {
  68. testsuccessequal "Reading package lists...
  69. Building dependency tree...
  70. The following extra packages will be installed:
  71. foo
  72. The following NEW packages will be installed:
  73. foo $1
  74. 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
  75. Inst foo (1 unstable [amd64])
  76. Inst $1 (1 unstable [amd64])
  77. Conf foo (1 unstable [amd64])
  78. Conf $1 (1 unstable [amd64])" aptget install $1 -s
  79. }
  80. testneedsfooallgood() {
  81. solveableinsinglearch1 $1
  82. testsuccessequal "Reading package lists...
  83. Building dependency tree...
  84. The following extra packages will be installed:
  85. foo
  86. The following NEW packages will be installed:
  87. foo $1:i386
  88. 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
  89. Inst foo (1 unstable [amd64])
  90. Inst $1:i386 (1 unstable [i386])
  91. Conf foo (1 unstable [amd64])
  92. Conf $1:i386 (1 unstable [i386])" aptget install $1:i386 -s
  93. testsuccessequal "Reading package lists...
  94. Building dependency tree...
  95. The following NEW packages will be installed:
  96. foo:i386 $1:i386
  97. 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
  98. Inst foo:i386 (1 unstable [i386])
  99. Inst $1:i386 (1 unstable [i386])
  100. Conf foo:i386 (1 unstable [i386])
  101. Conf $1:i386 (1 unstable [i386])" aptget install $1:i386 foo:i386 -s
  102. testsuccessequal "Reading package lists...
  103. Building dependency tree...
  104. The following NEW packages will be installed:
  105. foo:i386 $1
  106. 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
  107. Inst foo:i386 (1 unstable [i386])
  108. Inst $1 (1 unstable [amd64])
  109. Conf foo:i386 (1 unstable [i386])
  110. Conf $1 (1 unstable [amd64])" aptget install $1 foo:i386 -s
  111. }
  112. testneedsfooallgood 'needsfooany'
  113. testneedsfooallgood 'needsfoover1'
  114. NEEDSFOO2NATIVE="$BADPREFIX
  115. The following packages have unmet dependencies:
  116. needsfoover2 : Depends: foo:any (>= 2)
  117. E: Unable to correct problems, you have held broken packages."
  118. NEEDSFOO2FOREIGN="$BADPREFIX
  119. The following packages have unmet dependencies:
  120. needsfoover2:i386 : Depends: foo:any:i386 (>= 2)
  121. E: Unable to correct problems, you have held broken packages."
  122. testfailureequal "$NEEDSFOO2NATIVE" aptget install needsfoover2 -s
  123. testfailureequal "$NEEDSFOO2FOREIGN" aptget install needsfoover2:i386 -s
  124. testfailureequal "$NEEDSFOO2FOREIGN" aptget install needsfoover2:i386 foo:i386 -s
  125. testfailureequal "$NEEDSFOO2NATIVE" aptget install needsfoover2 foo:i386 -s
  126. solveableinsinglearch2() {
  127. testfailureequal "$BADPREFIX
  128. The following packages have unmet dependencies:
  129. hatesfoo : Conflicts: foo but 1 is to be installed
  130. E: Unable to correct problems, you have held broken packages." aptget install foo hatesfoo -s
  131. # the message differs slightly between single and multiarch
  132. testfailuremsg 'E: Unable to correct problems, you have held broken packages.' aptget install foo hatesfooany -s
  133. testfailureequal "$BADPREFIX
  134. The following packages have unmet dependencies:
  135. hatesfoonative : Conflicts: foo but 1 is to be installed
  136. E: Unable to correct problems, you have held broken packages." aptget install foo hatesfoonative -s
  137. }
  138. solveableinsinglearch2
  139. testfailureequal "$BADPREFIX
  140. The following packages have unmet dependencies:
  141. hatesfoo : Conflicts: foo:i386 but 1 is to be installed
  142. E: Unable to correct problems, you have held broken packages." aptget install foo:i386 hatesfoo -s
  143. testfailureequal "$BADPREFIX
  144. The following packages have unmet dependencies:
  145. hatesfooany : Conflicts: foo:any
  146. Conflicts: foo:any:i386
  147. E: Unable to correct problems, you have held broken packages." aptget install foo:i386 hatesfooany -s
  148. testsuccessequal 'Reading package lists...
  149. Building dependency tree...
  150. The following NEW packages will be installed:
  151. foo:i386 hatesfoonative
  152. 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
  153. Inst foo:i386 (1 unstable [i386])
  154. Inst hatesfoonative (1 unstable [amd64])
  155. Conf foo:i386 (1 unstable [i386])
  156. Conf hatesfoonative (1 unstable [amd64])' aptget install foo:i386 hatesfoonative -s
  157. solveableinsinglearch3() {
  158. testsuccessequal "Reading package lists...
  159. Building dependency tree...
  160. The following extra packages will be installed:
  161. coolfoo
  162. The following NEW packages will be installed:
  163. coolfoo needscoolfoo
  164. 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
  165. Inst coolfoo (1 unstable [amd64])
  166. Inst needscoolfoo (1 unstable [amd64])
  167. Conf coolfoo (1 unstable [amd64])
  168. Conf needscoolfoo (1 unstable [amd64])" aptget install needscoolfoo -s
  169. testsuccessequal "Reading package lists...
  170. Building dependency tree...
  171. The following extra packages will be installed:
  172. coolfoo
  173. The following NEW packages will be installed:
  174. coolfoo coolfoover needscoolfoo
  175. 0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
  176. Inst coolfoo (1 unstable [amd64])
  177. Inst coolfoover (1 unstable [amd64])
  178. Inst needscoolfoo (1 unstable [amd64])
  179. Conf coolfoo (1 unstable [amd64])
  180. Conf coolfoover (1 unstable [amd64])
  181. Conf needscoolfoo (1 unstable [amd64])" aptget install needscoolfoo coolfoover -s
  182. testfailureequal "$BADPREFIX
  183. The following packages have unmet dependencies:
  184. needscoolfooany : Depends: coolbar:any but it is not installable
  185. E: Unable to correct problems, you have held broken packages." aptget install needscoolfooany -s
  186. testsuccessequal 'Reading package lists...
  187. Building dependency tree...
  188. The following extra packages will be installed:
  189. coolfoo
  190. The following NEW packages will be installed:
  191. coolfoo needscoolfoover0
  192. 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
  193. Inst coolfoo (1 unstable [amd64])
  194. Inst needscoolfoover0 (1 unstable [amd64])
  195. Conf coolfoo (1 unstable [amd64])
  196. Conf needscoolfoover0 (1 unstable [amd64])' aptget install needscoolfoover0 -s
  197. testsuccessequal 'Reading package lists...
  198. Building dependency tree...
  199. The following extra packages will be installed:
  200. coolfoo coolfoover
  201. The following NEW packages will be installed:
  202. coolfoo coolfoover needscoolfoover1
  203. 0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
  204. Inst coolfoo (1 unstable [amd64])
  205. Inst coolfoover (1 unstable [amd64])
  206. Inst needscoolfoover1 (1 unstable [amd64])
  207. Conf coolfoo (1 unstable [amd64])
  208. Conf coolfoover (1 unstable [amd64])
  209. Conf needscoolfoover1 (1 unstable [amd64])' aptget install needscoolfoover1 -s
  210. testfailureequal "$BADPREFIX
  211. The following packages have unmet dependencies:
  212. needscoolfoover2 : Depends: coolfoo:any (>= 2)
  213. E: Unable to correct problems, you have held broken packages." aptget install needscoolfoover2 -s
  214. testfailureequal "$BADPREFIX
  215. The following packages have unmet dependencies:
  216. needscoolfoover3 : Depends: coolfoo:any (>= 2)
  217. Depends: coolbar (>= 3)
  218. E: Unable to correct problems, you have held broken packages." aptget install needscoolfoover3 -s
  219. }
  220. solveableinsinglearch3
  221. msgmsg 'switch to single architecture'
  222. configarchitecture 'amd64'
  223. solveableinsinglearch0
  224. testfailureequal 'Reading package lists...
  225. Building dependency tree...
  226. E: Unable to locate package needsfoo' aptget install needsfoo:i386 -s
  227. solveableinsinglearch1 'needsfooany'
  228. solveableinsinglearch1 'needsfoover1'
  229. testfailureequal "$NEEDSFOO2NATIVE" aptget install needsfoover2 -s
  230. solveableinsinglearch2
  231. solveableinsinglearch3