test-multiarch-foreign 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. #!/bin/sh
  2. set -e
  3. TESTDIR=$(readlink -f $(dirname $0))
  4. . $TESTDIR/framework
  5. setupenvironment
  6. configarchitecture 'amd64' 'i386' 'armel'
  7. insertpackage 'unstable' 'cool-foo' 'amd64,i386' '1.0' 'Depends: foo'
  8. insertpackage 'unstable' 'cool-foo-x64' 'amd64' '1.0' 'Depends: foo:amd64'
  9. insertpackage 'unstable' 'cool-foo-x32' 'amd64' '1.0' 'Depends: foo:i386'
  10. insertpackage 'unstable' 'hates-foo' 'amd64,i386' '1.0' 'Conflicts: foo'
  11. insertpackage 'unstable' 'hates-foo-x64' 'amd64' '1.0' 'Conflicts: foo:amd64'
  12. insertpackage 'unstable' 'hates-foo-x32' 'amd64' '1.0' 'Conflicts: foo:i386'
  13. insertpackage 'unstable' 'foo' 'amd64,i386,armel' '1.0' 'Multi-Arch: foreign'
  14. insertpackage 'unstable' 'cool-bar' 'amd64,i386' '1.0' 'Depends: bar-provider'
  15. insertpackage 'unstable' 'cool-bar-x64' 'amd64' '1.0' 'Depends: bar-provider:amd64'
  16. insertpackage 'unstable' 'cool-bar-x32' 'amd64' '1.0' 'Depends: bar-provider:i386'
  17. insertpackage 'unstable' 'hates-bar' 'amd64,i386' '1.0' 'Conflicts: bar-provider'
  18. insertpackage 'unstable' 'hates-bar-x64' 'amd64' '1.0' 'Conflicts: bar-provider:amd64'
  19. insertpackage 'unstable' 'hates-bar-x32' 'amd64' '1.0' 'Conflicts: bar-provider:i386'
  20. insertpackage 'unstable' 'bar' 'amd64,i386,armel' '1.0' 'Provides: bar-provider
  21. Multi-Arch: foreign'
  22. setupaptarchive
  23. testsuccessequal 'Reading package lists...
  24. Building dependency tree...
  25. The following extra packages will be installed:
  26. foo
  27. The following NEW packages will be installed:
  28. cool-foo:i386 foo
  29. 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
  30. Inst foo (1.0 unstable [amd64])
  31. Inst cool-foo:i386 (1.0 unstable [i386])
  32. Conf foo (1.0 unstable [amd64])
  33. Conf cool-foo:i386 (1.0 unstable [i386])' aptget install cool-foo:i386 -s
  34. testsuccessequal 'Reading package lists...
  35. Building dependency tree...
  36. The following NEW packages will be installed:
  37. cool-foo foo:i386
  38. 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
  39. Inst foo:i386 (1.0 unstable [i386])
  40. Inst cool-foo (1.0 unstable [amd64])
  41. Conf foo:i386 (1.0 unstable [i386])
  42. Conf cool-foo (1.0 unstable [amd64])' aptget install cool-foo:amd64 foo:i386 -s
  43. testsuccessequal 'Reading package lists...
  44. Building dependency tree...
  45. The following NEW packages will be installed:
  46. cool-foo foo:armel
  47. 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
  48. Inst foo:armel (1.0 unstable [armel])
  49. Inst cool-foo (1.0 unstable [amd64])
  50. Conf foo:armel (1.0 unstable [armel])
  51. Conf cool-foo (1.0 unstable [amd64])' aptget install cool-foo:amd64 foo:armel -s
  52. testsuccessequal 'Reading package lists...
  53. Building dependency tree...
  54. The following extra packages will be installed:
  55. bar
  56. The following NEW packages will be installed:
  57. bar cool-bar:i386
  58. 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
  59. Inst bar (1.0 unstable [amd64])
  60. Inst cool-bar:i386 (1.0 unstable [i386])
  61. Conf bar (1.0 unstable [amd64])
  62. Conf cool-bar:i386 (1.0 unstable [i386])' aptget install cool-bar:i386 -s
  63. testsuccessequal 'Reading package lists...
  64. Building dependency tree...
  65. The following NEW packages will be installed:
  66. bar:i386 cool-bar
  67. 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
  68. Inst bar:i386 (1.0 unstable [i386])
  69. Inst cool-bar (1.0 unstable [amd64])
  70. Conf bar:i386 (1.0 unstable [i386])
  71. Conf cool-bar (1.0 unstable [amd64])' aptget install cool-bar:amd64 bar:i386 -s
  72. testsuccessequal 'Reading package lists...
  73. Building dependency tree...
  74. The following NEW packages will be installed:
  75. bar:armel cool-bar
  76. 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
  77. Inst bar:armel (1.0 unstable [armel])
  78. Inst cool-bar (1.0 unstable [amd64])
  79. Conf bar:armel (1.0 unstable [armel])
  80. Conf cool-bar (1.0 unstable [amd64])' aptget install cool-bar:amd64 bar:armel -s
  81. testsuccessequal "Reading package lists...
  82. Building dependency tree...
  83. Note, selecting 'bar:i386' instead of 'bar-provider:i386'
  84. The following NEW packages will be installed:
  85. bar:i386 cool-bar
  86. 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
  87. Inst bar:i386 (1.0 unstable [i386])
  88. Inst cool-bar (1.0 unstable [amd64])
  89. Conf bar:i386 (1.0 unstable [i386])
  90. Conf cool-bar (1.0 unstable [amd64])" aptget install cool-bar bar-provider:i386 -s -q=0
  91. satisfiable_in_singlearch() {
  92. testsuccessequal 'Reading package lists...
  93. Building dependency tree...
  94. The following extra packages will be installed:
  95. foo
  96. The following NEW packages will be installed:
  97. cool-foo foo
  98. 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
  99. Inst foo (1.0 unstable [amd64])
  100. Inst cool-foo (1.0 unstable [amd64])
  101. Conf foo (1.0 unstable [amd64])
  102. Conf cool-foo (1.0 unstable [amd64])' aptget install cool-foo:amd64 -s
  103. testsuccessequal 'Reading package lists...
  104. Building dependency tree...
  105. The following NEW packages will be installed:
  106. cool-foo foo
  107. 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
  108. Inst foo (1.0 unstable [amd64])
  109. Inst cool-foo (1.0 unstable [amd64])
  110. Conf foo (1.0 unstable [amd64])
  111. Conf cool-foo (1.0 unstable [amd64])' aptget install cool-foo:amd64 foo:amd64 -s
  112. testsuccessequal 'Reading package lists...
  113. Building dependency tree...
  114. The following extra packages will be installed:
  115. bar
  116. The following NEW packages will be installed:
  117. bar cool-bar
  118. 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
  119. Inst bar (1.0 unstable [amd64])
  120. Inst cool-bar (1.0 unstable [amd64])
  121. Conf bar (1.0 unstable [amd64])
  122. Conf cool-bar (1.0 unstable [amd64])' aptget install cool-bar:amd64 -s
  123. testsuccessequal 'Reading package lists...
  124. Building dependency tree...
  125. The following NEW packages will be installed:
  126. bar cool-bar
  127. 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
  128. Inst bar (1.0 unstable [amd64])
  129. Inst cool-bar (1.0 unstable [amd64])
  130. Conf bar (1.0 unstable [amd64])
  131. Conf cool-bar (1.0 unstable [amd64])' aptget install cool-bar:amd64 bar:amd64 -s
  132. testsuccessequal "Reading package lists...
  133. Building dependency tree...
  134. Note, selecting 'bar' instead of 'bar-provider'
  135. The following NEW packages will be installed:
  136. bar cool-bar
  137. 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
  138. Inst bar (1.0 unstable [amd64])
  139. Inst cool-bar (1.0 unstable [amd64])
  140. Conf bar (1.0 unstable [amd64])
  141. Conf cool-bar (1.0 unstable [amd64])" aptget install cool-bar bar-provider -s -q=0
  142. testsuccessequal 'Reading package lists...
  143. Building dependency tree...
  144. The following extra packages will be installed:
  145. foo
  146. The following NEW packages will be installed:
  147. cool-foo-x64 foo
  148. 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
  149. Inst foo (1.0 unstable [amd64])
  150. Inst cool-foo-x64 (1.0 unstable [amd64])
  151. Conf foo (1.0 unstable [amd64])
  152. Conf cool-foo-x64 (1.0 unstable [amd64])' aptget install cool-foo-x64 -s
  153. }
  154. hatersgonnahate() {
  155. BADPREFIX='Reading package lists...
  156. Building dependency tree...
  157. Some packages could not be installed. This may mean that you have
  158. requested an impossible situation or if you are using the unstable
  159. distribution that some required packages have not yet been created
  160. or been moved out of Incoming.
  161. The following information may help to resolve the situation:
  162. '
  163. testfailureequal "$BADPREFIX
  164. The following packages have unmet dependencies:
  165. hates-foo : Conflicts: foo
  166. Conflicts: foo:i386
  167. Conflicts: foo:armel
  168. E: Unable to correct problems, you have held broken packages." aptget install $1 hates-foo -s
  169. testfailureequal "$BADPREFIX
  170. The following packages have unmet dependencies:
  171. hates-foo-x64 : Conflicts: foo
  172. E: Unable to correct problems, you have held broken packages." aptget install $1 hates-foo-x64 -s
  173. testfailureequal "$BADPREFIX
  174. The following packages have unmet dependencies:
  175. hates-foo-x32 : Conflicts: foo:i386
  176. E: Unable to correct problems, you have held broken packages." aptget install $1 hates-foo-x32 -s
  177. }
  178. hatersgonnahate 'foo'
  179. hatersgonnahate 'foo:i386'
  180. #FIXME: do not work in single-arch as i386 isn't known at cache generation time
  181. testsuccessequal 'Reading package lists...
  182. Building dependency tree...
  183. The following extra packages will be installed:
  184. foo
  185. The following NEW packages will be installed:
  186. cool-foo-x32 foo
  187. 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
  188. Inst foo (1.0 unstable [amd64])
  189. Inst cool-foo-x32 (1.0 unstable [amd64])
  190. Conf foo (1.0 unstable [amd64])
  191. Conf cool-foo-x32 (1.0 unstable [amd64])' aptget install cool-foo-x32 -s
  192. testsuccessequal 'Reading package lists...
  193. Building dependency tree...
  194. The following extra packages will be installed:
  195. bar
  196. The following NEW packages will be installed:
  197. bar cool-bar-x32
  198. 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
  199. Inst bar (1.0 unstable [amd64])
  200. Inst cool-bar-x32 (1.0 unstable [amd64])
  201. Conf bar (1.0 unstable [amd64])
  202. Conf cool-bar-x32 (1.0 unstable [amd64])' aptget install cool-bar-x32 -s -q=0
  203. testsuccessequal 'Reading package lists...
  204. Building dependency tree...
  205. The following extra packages will be installed:
  206. bar
  207. The following NEW packages will be installed:
  208. bar cool-bar-x64
  209. 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
  210. Inst bar (1.0 unstable [amd64])
  211. Inst cool-bar-x64 (1.0 unstable [amd64])
  212. Conf bar (1.0 unstable [amd64])
  213. Conf cool-bar-x64 (1.0 unstable [amd64])' aptget install cool-bar-x64 -s -q=0
  214. satisfiable_in_singlearch
  215. msgmsg 'switch to single architecture'
  216. configarchitecture 'amd64'
  217. satisfiable_in_singlearch