test-multiarch-foreign 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  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' 'foo' 'amd64,i386,armel' '1.0' 'Multi-Arch: foreign'
  11. insertpackage 'unstable' 'cool-bar' 'amd64,i386' '1.0' 'Depends: bar-provider'
  12. insertpackage 'unstable' 'cool-bar-x64' 'amd64' '1.0' 'Depends: bar-provider:amd64'
  13. insertpackage 'unstable' 'cool-bar-x32' 'amd64' '1.0' 'Depends: bar-provider:i386'
  14. insertpackage 'unstable' 'bar' 'amd64,i386,armel' '1.0' 'Provides: bar-provider
  15. Multi-Arch: foreign'
  16. setupaptarchive
  17. testequal 'Reading package lists...
  18. Building dependency tree...
  19. The following extra packages will be installed:
  20. foo
  21. The following NEW packages will be installed:
  22. cool-foo:i386 foo
  23. 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
  24. Inst foo (1.0 unstable [amd64])
  25. Inst cool-foo:i386 (1.0 unstable [i386])
  26. Conf foo (1.0 unstable [amd64])
  27. Conf cool-foo:i386 (1.0 unstable [i386])' aptget install cool-foo:i386 -s
  28. testequal 'Reading package lists...
  29. Building dependency tree...
  30. The following NEW packages will be installed:
  31. cool-foo foo:i386
  32. 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
  33. Inst foo:i386 (1.0 unstable [i386])
  34. Inst cool-foo (1.0 unstable [amd64])
  35. Conf foo:i386 (1.0 unstable [i386])
  36. Conf cool-foo (1.0 unstable [amd64])' aptget install cool-foo:amd64 foo:i386 -s
  37. testequal 'Reading package lists...
  38. Building dependency tree...
  39. The following NEW packages will be installed:
  40. cool-foo foo:armel
  41. 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
  42. Inst foo:armel (1.0 unstable [armel])
  43. Inst cool-foo (1.0 unstable [amd64])
  44. Conf foo:armel (1.0 unstable [armel])
  45. Conf cool-foo (1.0 unstable [amd64])' aptget install cool-foo:amd64 foo:armel -s
  46. testequal 'Reading package lists...
  47. Building dependency tree...
  48. The following extra packages will be installed:
  49. bar
  50. The following NEW packages will be installed:
  51. bar cool-bar:i386
  52. 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
  53. Inst bar (1.0 unstable [amd64])
  54. Inst cool-bar:i386 (1.0 unstable [i386])
  55. Conf bar (1.0 unstable [amd64])
  56. Conf cool-bar:i386 (1.0 unstable [i386])' aptget install cool-bar:i386 -s
  57. testequal 'Reading package lists...
  58. Building dependency tree...
  59. The following NEW packages will be installed:
  60. bar:i386 cool-bar
  61. 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
  62. Inst bar:i386 (1.0 unstable [i386])
  63. Inst cool-bar (1.0 unstable [amd64])
  64. Conf bar:i386 (1.0 unstable [i386])
  65. Conf cool-bar (1.0 unstable [amd64])' aptget install cool-bar:amd64 bar:i386 -s
  66. testequal 'Reading package lists...
  67. Building dependency tree...
  68. The following NEW packages will be installed:
  69. bar:armel cool-bar
  70. 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
  71. Inst bar:armel (1.0 unstable [armel])
  72. Inst cool-bar (1.0 unstable [amd64])
  73. Conf bar:armel (1.0 unstable [armel])
  74. Conf cool-bar (1.0 unstable [amd64])' aptget install cool-bar:amd64 bar:armel -s
  75. testequal "Reading package lists...
  76. Building dependency tree...
  77. Note, selecting 'bar:i386' instead of 'bar-provider:i386'
  78. The following NEW packages will be installed:
  79. bar:i386 cool-bar
  80. 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
  81. Inst bar:i386 (1.0 unstable [i386])
  82. Inst cool-bar (1.0 unstable [amd64])
  83. Conf bar:i386 (1.0 unstable [i386])
  84. Conf cool-bar (1.0 unstable [amd64])" aptget install cool-bar bar-provider:i386 -s -q=0
  85. satisfiable_in_singlearch() {
  86. testequal 'Reading package lists...
  87. Building dependency tree...
  88. The following extra packages will be installed:
  89. foo
  90. The following NEW packages will be installed:
  91. cool-foo foo
  92. 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
  93. Inst foo (1.0 unstable [amd64])
  94. Inst cool-foo (1.0 unstable [amd64])
  95. Conf foo (1.0 unstable [amd64])
  96. Conf cool-foo (1.0 unstable [amd64])' aptget install cool-foo:amd64 -s
  97. testequal 'Reading package lists...
  98. Building dependency tree...
  99. The following NEW packages will be installed:
  100. cool-foo foo
  101. 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
  102. Inst foo (1.0 unstable [amd64])
  103. Inst cool-foo (1.0 unstable [amd64])
  104. Conf foo (1.0 unstable [amd64])
  105. Conf cool-foo (1.0 unstable [amd64])' aptget install cool-foo:amd64 foo:amd64 -s
  106. testequal 'Reading package lists...
  107. Building dependency tree...
  108. The following extra packages will be installed:
  109. bar
  110. The following NEW packages will be installed:
  111. bar cool-bar
  112. 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
  113. Inst bar (1.0 unstable [amd64])
  114. Inst cool-bar (1.0 unstable [amd64])
  115. Conf bar (1.0 unstable [amd64])
  116. Conf cool-bar (1.0 unstable [amd64])' aptget install cool-bar:amd64 -s
  117. testequal 'Reading package lists...
  118. Building dependency tree...
  119. The following NEW packages will be installed:
  120. bar cool-bar
  121. 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
  122. Inst bar (1.0 unstable [amd64])
  123. Inst cool-bar (1.0 unstable [amd64])
  124. Conf bar (1.0 unstable [amd64])
  125. Conf cool-bar (1.0 unstable [amd64])' aptget install cool-bar:amd64 bar:amd64 -s
  126. testequal "Reading package lists...
  127. Building dependency tree...
  128. Note, selecting 'bar' instead of 'bar-provider'
  129. The following NEW packages will be installed:
  130. bar cool-bar
  131. 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
  132. Inst bar (1.0 unstable [amd64])
  133. Inst cool-bar (1.0 unstable [amd64])
  134. Conf bar (1.0 unstable [amd64])
  135. Conf cool-bar (1.0 unstable [amd64])" aptget install cool-bar bar-provider -s -q=0
  136. testequal 'Reading package lists...
  137. Building dependency tree...
  138. The following extra packages will be installed:
  139. foo
  140. The following NEW packages will be installed:
  141. cool-foo-x64 foo
  142. 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
  143. Inst foo (1.0 unstable [amd64])
  144. Inst cool-foo-x64 (1.0 unstable [amd64])
  145. Conf foo (1.0 unstable [amd64])
  146. Conf cool-foo-x64 (1.0 unstable [amd64])' aptget install cool-foo-x64 -s
  147. }
  148. #FIXME: do not work in single-arch as i386 isn't known at cache generation time
  149. testequal 'Reading package lists...
  150. Building dependency tree...
  151. The following extra packages will be installed:
  152. foo
  153. The following NEW packages will be installed:
  154. cool-foo-x32 foo
  155. 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
  156. Inst foo (1.0 unstable [amd64])
  157. Inst cool-foo-x32 (1.0 unstable [amd64])
  158. Conf foo (1.0 unstable [amd64])
  159. Conf cool-foo-x32 (1.0 unstable [amd64])' aptget install cool-foo-x32 -s
  160. testequal 'Reading package lists...
  161. Building dependency tree...
  162. The following extra packages will be installed:
  163. bar
  164. The following NEW packages will be installed:
  165. bar cool-bar-x32
  166. 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
  167. Inst bar (1.0 unstable [amd64])
  168. Inst cool-bar-x32 (1.0 unstable [amd64])
  169. Conf bar (1.0 unstable [amd64])
  170. Conf cool-bar-x32 (1.0 unstable [amd64])' aptget install cool-bar-x32 -s -q=0
  171. testequal 'Reading package lists...
  172. Building dependency tree...
  173. The following extra packages will be installed:
  174. bar
  175. The following NEW packages will be installed:
  176. bar cool-bar-x64
  177. 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
  178. Inst bar (1.0 unstable [amd64])
  179. Inst cool-bar-x64 (1.0 unstable [amd64])
  180. Conf bar (1.0 unstable [amd64])
  181. Conf cool-bar-x64 (1.0 unstable [amd64])' aptget install cool-bar-x64 -s -q=0
  182. satisfiable_in_singlearch
  183. msgmsg 'switch to single architecture'
  184. configarchitecture 'amd64'
  185. satisfiable_in_singlearch