test-crossgrades 4.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. #!/bin/sh
  2. set -e
  3. TESTDIR="$(readlink -f "$(dirname "$0")")"
  4. . "$TESTDIR/framework"
  5. setupenvironment
  6. configarchitecture 'i386' 'amd64' 'armel'
  7. configdpkgnoopchroot
  8. buildsimplenativepackage 'unrelated' 'amd64' '1' 'stable'
  9. buildsimplenativepackage 'crosser' 'i386,armel' '1' 'stable' 'Multi-Arch: same'
  10. buildsimplenativepackage 'crosser' 'amd64' '2' 'unstable'
  11. buildsimplenativepackage 'crosser' 'i386,armel' '3' 'experimental' 'Multi-Arch: same'
  12. setupaptarchive
  13. singleinstance() {
  14. testsuccess apt install crosser:i386=1 unrelated:amd64 -y --planner $1
  15. testdpkginstalled 'crosser:i386' 'unrelated'
  16. testsuccess apt install crosser:amd64 -y -o Debug::pkgDpkgPm=1 -o Dpkg::Use-Pty=0 --purge --planner $1
  17. cp -a rootdir/tmp/testsuccess.output crosser.output
  18. testfailure grep -- '--remove.*crosser.*' crosser.output
  19. testfailure grep -- '--purge' crosser.output
  20. testsuccess apt install crosser:amd64 unrelated:amd64- -y -o Dpkg::Use-Pty=0 --purge -o Debug::pkgDPkgProgressReporting=1 --planner $1
  21. testdpkgnotinstalled 'crosser:i386' 'unrelated'
  22. testdpkginstalled 'crosser:amd64'
  23. testsuccess apt install crosser:armel=3 -y -o Debug::pkgDpkgPm=1 -o Dpkg::Use-Pty=0 --purge --planner $1
  24. cp -a rootdir/tmp/testsuccess.output crosser.output
  25. testsuccess grep -- '--remove.*crosser.*' crosser.output
  26. testsuccess grep -- '--purge' crosser.output
  27. testsuccess apt install crosser:armel=3 -y -o Debug::pkgDPkgProgressReporting=1 -o Dpkg::Use-Pty=0 --purge --planner $1
  28. testdpkgnotinstalled 'crosser:i386' 'crosser:amd64' 'unrelated'
  29. testdpkginstalled 'crosser:armel'
  30. testsuccess apt install crosser=1 -y -o Debug::pkgDpkgPm=1 -o Dpkg::Use-Pty=0 --purge --planner $1 --allow-downgrades
  31. cp -a rootdir/tmp/testsuccess.output crosser.output
  32. testsuccess grep -- '--remove.*crosser.*' crosser.output
  33. testsuccess grep -- '--purge' crosser.output
  34. testsuccess apt install crosser=1 -y -o Debug::pkgDPkgProgressReporting=1 -o Dpkg::Use-Pty=0 --purge --planner $1 --allow-downgrades
  35. testdpkgnotinstalled 'crosser:armel' 'crosser:amd64' 'unrelated'
  36. testdpkginstalled 'crosser:i386'
  37. testsuccess apt purge crosser:i386 -y --planner $1
  38. testdpkgnotinstalled 'crosser:i386'
  39. }
  40. singleinstance 'internal'
  41. singleinstance 'apt'
  42. multiinstance() {
  43. testsuccess apt install crosser:i386=1 crosser:armel=1 unrelated:amd64 -y --planner $1
  44. testdpkginstalled 'crosser:i386' 'crosser:armel' 'unrelated'
  45. testsuccess apt install crosser:amd64 -y -o Debug::pkgDpkgPm=1 -o Dpkg::Use-Pty=0 --purge --planner $1
  46. cp -a rootdir/tmp/testsuccess.output crosser.output
  47. testsuccess grep -- '--remove.*crosser.*' crosser.output
  48. testsuccess grep -- '--purge' crosser.output
  49. testsuccess apt install crosser:amd64 unrelated:amd64- -y -o Dpkg::Use-Pty=0 --purge -o Debug::pkgDPkgProgressReporting=1 --planner $1
  50. testdpkgnotinstalled 'crosser:i386' 'crosser:armel' 'unrelated'
  51. testdpkginstalled 'crosser:amd64'
  52. testsuccess apt install crosser:i386 crosser:armel -t experimental -y -o Debug::pkgDpkgPm=1 -o Dpkg::Use-Pty=0 --purge --planner $1
  53. cp -a rootdir/tmp/testsuccess.output crosser.output
  54. testsuccess grep -- '--remove.*crosser.*' crosser.output
  55. testsuccess grep -- '--purge' crosser.output
  56. testsuccess apt install crosser:i386 crosser:armel -t experimental -y -o Debug::pkgDPkgProgressReporting=1 -o Dpkg::Use-Pty=0 --purge --planner $1
  57. testdpkgnotinstalled 'crosser:amd64' 'unrelated'
  58. testdpkginstalled 'crosser:i386' 'crosser:armel'
  59. testsuccess apt install crosser:i386- crosser:armel=1 -y -o Debug::pkgDpkgPm=1 -o Dpkg::Use-Pty=0 --purge --planner $1 --allow-downgrades
  60. cp -a rootdir/tmp/testsuccess.output crosser.output
  61. testsuccess grep -- '--remove.*crosser.*' crosser.output
  62. testsuccess grep -- '--purge' crosser.output
  63. testsuccess apt install crosser:i386- crosser:armel=1 -y -o Debug::pkgDPkgProgressReporting=1 -o Dpkg::Use-Pty=0 --purge --planner $1 --allow-downgrades
  64. testdpkgnotinstalled 'crosser:amd64' 'crosser:i386' 'unrelated'
  65. testdpkginstalled 'crosser:armel'
  66. testsuccess apt purge crosser:armel -y --planner $1 -o Debug::pkgDPkgProgressReporting=1
  67. testdpkgnotinstalled 'crosser:i386' 'crosser:armel' 'crosser:amd64' 'unrelated'
  68. }
  69. multiinstance 'internal'