test-multiarch-allowed 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303
  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:any'
  22. insertpackage 'unstable' 'needscoolfoover1' 'amd64' '1' 'Depends: coolfoo:any (>= 1), coolbar:any (>= 1)'
  23. insertpackage 'unstable' 'needscoolfoover2' 'amd64' '1' 'Depends: coolfoo:any (>= 2), coolbar:any (>= 1)'
  24. insertpackage 'unstable' 'needscoolfoover3' 'amd64' '1' 'Depends: coolfoo:any (>= 2), coolbar:any (>= 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 additional 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 additional 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 additional 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 additional 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 (>= 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:amd64
  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. E: Unable to correct problems, you have held broken packages." aptget install foo:i386 hatesfooany -s
  147. testsuccessequal 'Reading package lists...
  148. Building dependency tree...
  149. The following NEW packages will be installed:
  150. foo:i386 hatesfoonative
  151. 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
  152. Inst foo:i386 (1 unstable [i386])
  153. Inst hatesfoonative (1 unstable [amd64])
  154. Conf foo:i386 (1 unstable [i386])
  155. Conf hatesfoonative (1 unstable [amd64])' aptget install foo:i386 hatesfoonative -s
  156. solveableinsinglearch3() {
  157. testsuccessequal "Reading package lists...
  158. Building dependency tree...
  159. The following additional packages will be installed:
  160. coolfoo
  161. The following NEW packages will be installed:
  162. coolfoo needscoolfoo
  163. 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
  164. Inst coolfoo (1 unstable [amd64])
  165. Inst needscoolfoo (1 unstable [amd64])
  166. Conf coolfoo (1 unstable [amd64])
  167. Conf needscoolfoo (1 unstable [amd64])" aptget install needscoolfoo -s
  168. testsuccessequal "Reading package lists...
  169. Building dependency tree...
  170. The following additional packages will be installed:
  171. coolfoo
  172. The following NEW packages will be installed:
  173. coolfoo coolfoover needscoolfoo
  174. 0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
  175. Inst coolfoo (1 unstable [amd64])
  176. Inst coolfoover (1 unstable [amd64])
  177. Inst needscoolfoo (1 unstable [amd64])
  178. Conf coolfoo (1 unstable [amd64])
  179. Conf coolfoover (1 unstable [amd64])
  180. Conf needscoolfoo (1 unstable [amd64])" aptget install needscoolfoo coolfoover -s
  181. testsuccessequal "Reading package lists...
  182. Building dependency tree...
  183. The following additional packages will be installed:
  184. coolfoo
  185. The following NEW packages will be installed:
  186. coolfoo needscoolfooany
  187. 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
  188. Inst coolfoo (1 unstable [amd64])
  189. Inst needscoolfooany (1 unstable [amd64])
  190. Conf coolfoo (1 unstable [amd64])
  191. Conf needscoolfooany (1 unstable [amd64])" aptget install needscoolfooany -s
  192. testsuccessequal 'Reading package lists...
  193. Building dependency tree...
  194. The following additional packages will be installed:
  195. coolfoo
  196. The following NEW packages will be installed:
  197. coolfoo needscoolfoover0
  198. 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
  199. Inst coolfoo (1 unstable [amd64])
  200. Inst needscoolfoover0 (1 unstable [amd64])
  201. Conf coolfoo (1 unstable [amd64])
  202. Conf needscoolfoover0 (1 unstable [amd64])' aptget install needscoolfoover0 -s
  203. testsuccessequal 'Reading package lists...
  204. Building dependency tree...
  205. The following additional packages will be installed:
  206. coolfoo coolfoover
  207. The following NEW packages will be installed:
  208. coolfoo coolfoover needscoolfoover1
  209. 0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
  210. Inst coolfoo (1 unstable [amd64])
  211. Inst coolfoover (1 unstable [amd64])
  212. Inst needscoolfoover1 (1 unstable [amd64])
  213. Conf coolfoo (1 unstable [amd64])
  214. Conf coolfoover (1 unstable [amd64])
  215. Conf needscoolfoover1 (1 unstable [amd64])' aptget install needscoolfoover1 -s
  216. testfailureequal "$BADPREFIX
  217. The following packages have unmet dependencies:
  218. needscoolfoover2 : Depends: coolfoo:any (>= 2)
  219. E: Unable to correct problems, you have held broken packages." aptget install needscoolfoover2 -s
  220. testfailureequal "$BADPREFIX
  221. The following packages have unmet dependencies:
  222. needscoolfoover3 : Depends: coolfoo:any (>= 2)
  223. Depends: coolbar:any (>= 3)
  224. E: Unable to correct problems, you have held broken packages." aptget install needscoolfoover3 -s
  225. }
  226. solveableinsinglearch3
  227. msgmsg 'switch to single architecture'
  228. configarchitecture 'amd64'
  229. solveableinsinglearch0
  230. testfailureequal 'Reading package lists...
  231. Building dependency tree...
  232. E: Unable to locate package needsfoo:i386' aptget install needsfoo:i386 -s
  233. solveableinsinglearch1 'needsfooany'
  234. solveableinsinglearch1 'needsfoover1'
  235. testfailureequal "$NEEDSFOO2NATIVE" aptget install needsfoover2 -s
  236. solveableinsinglearch2
  237. solveableinsinglearch3
  238. msgmsg 'multi-arch with barbarian archs'
  239. configarchitecture 'amd64' 'i386'
  240. insertinstalledpackage 'foo' 'armel' '1' 'Multi-Arch: allowed'
  241. insertinstalledpackage 'coolfoo' 'armel' '1' 'Multi-Arch:allowed
  242. Provides: coolbar'
  243. insertinstalledpackage 'bar-needer' 'armel' '1.0' 'Depends: coolbar:any'
  244. testsuccess aptget check
  245. testsuccessequal 'Reading package lists...
  246. Building dependency tree...
  247. The following additional packages will be installed:
  248. foo
  249. The following packages will be REMOVED:
  250. foo:armel
  251. The following NEW packages will be installed:
  252. foo needsfooany
  253. 0 upgraded, 2 newly installed, 1 to remove and 0 not upgraded.
  254. Remv foo:armel [1]
  255. Inst foo (1 unstable [amd64])
  256. Inst needsfooany (1 unstable [amd64])
  257. Conf foo (1 unstable [amd64])
  258. Conf needsfooany (1 unstable [amd64])' aptget install needsfooany -s
  259. testsuccessequal 'Reading package lists...
  260. Building dependency tree...
  261. The following additional packages will be installed:
  262. foo
  263. The following packages will be REMOVED:
  264. foo:armel
  265. The following NEW packages will be installed:
  266. foo needsfooany:i386
  267. 0 upgraded, 2 newly installed, 1 to remove and 0 not upgraded.
  268. Remv foo:armel [1]
  269. Inst foo (1 unstable [amd64])
  270. Inst needsfooany:i386 (1 unstable [i386])
  271. Conf foo (1 unstable [amd64])
  272. Conf needsfooany:i386 (1 unstable [i386])' aptget install needsfooany:i386 -s
  273. testsuccessequal 'Reading package lists...
  274. Building dependency tree...
  275. The following additional packages will be installed:
  276. coolfoo
  277. The following packages will be REMOVED:
  278. coolfoo:armel
  279. The following NEW packages will be installed:
  280. coolfoo needscoolfoover0
  281. 0 upgraded, 2 newly installed, 1 to remove and 0 not upgraded.
  282. Remv coolfoo:armel [1] [bar-needer:armel ]
  283. Inst coolfoo (1 unstable [amd64])
  284. Inst needscoolfoover0 (1 unstable [amd64])
  285. Conf coolfoo (1 unstable [amd64])
  286. Conf needscoolfoover0 (1 unstable [amd64])' aptget install needscoolfoover0 -s