test-bug-770291-reinstall 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. #!/bin/sh
  2. set -e
  3. TESTDIR="$(readlink -f "$(dirname "$0")")"
  4. . "$TESTDIR/framework"
  5. setupenvironment
  6. configarchitecture 'i386'
  7. insertpackage 'unstable,installed' 'libc6' 'i386' '1'
  8. insertpackage 'unstable,installed' 'libselinux1' 'i386' '1'
  9. cp rootdir/var/lib/dpkg/status dpkg.status
  10. insertpackage 'unstable,installed' 'init' 'i386' '1' 'Depends: systemd-sysv
  11. Essential: yes'
  12. insertpackage 'unstable,installed' 'systemd-sysv' 'i386' '215-5+b1' 'Depends: systemd (= 215-5+b1)
  13. Pre-Depends: systemd'
  14. # fun fact: we need these two pre-depends to get systemd ordered before systemd-sysv as
  15. # many pre-depends mean: do early (as they are a pain, so get them out of the way early)
  16. insertpackage 'unstable,installed' 'systemd' 'i386' '215-5+b1' 'Pre-Depends: libc6, libselinux1'
  17. # depends loop
  18. insertpackage 'unstable,installed' 'dependsa' 'i386' '1' 'Depends: dependsb
  19. Essential: yes'
  20. insertpackage 'unstable,installed' 'dependsb' 'i386' '1' 'Depends: dependsa
  21. Essential: yes'
  22. # pre-depends loop
  23. insertpackage 'unstable,installed' 'predependsa' 'i386' '1' 'Pre-Depends: predependsb
  24. Essential: yes'
  25. insertpackage 'unstable,installed' 'predependsb' 'i386' '1' 'Pre-Depends: predependsa
  26. Essential: yes'
  27. # pre-depends-to-depends loop
  28. insertpackage 'unstable,installed' 'predependsdependsa' 'i386' '1' 'Pre-Depends: predependsdependsb
  29. Essential: yes'
  30. insertpackage 'unstable,installed' 'predependsdependsb' 'i386' '1' 'Depends: predependsdependsa
  31. Essential: yes'
  32. setupaptarchive
  33. testsuccessequal 'Reading package lists...
  34. Building dependency tree...
  35. 0 upgraded, 0 newly installed, 2 reinstalled, 0 to remove and 0 not upgraded.
  36. Inst systemd [215-5+b1] (215-5+b1 unstable [i386])
  37. Conf systemd (215-5+b1 unstable [i386])
  38. Inst systemd-sysv [215-5+b1] (215-5+b1 unstable [i386])
  39. Conf systemd-sysv (215-5+b1 unstable [i386])' aptget install --reinstall systemd systemd-sysv -s
  40. testsuccessequal 'Reading package lists...
  41. Building dependency tree...
  42. 0 upgraded, 0 newly installed, 2 reinstalled, 0 to remove and 0 not upgraded.
  43. Inst dependsa [1] (1 unstable [i386])
  44. Inst dependsb [1] (1 unstable [i386])
  45. Conf dependsb (1 unstable [i386])
  46. Conf dependsa (1 unstable [i386])' aptget install --reinstall dependsa dependsb -s
  47. # there is a chance dpkg can actually do these, BUT this depends on the maintainerscripts (not) present
  48. # which is very very risky to depend on (and apt doesn't know about that anyhow).
  49. testfailure aptget install --reinstall predependsa predependsb -s -o Debug::pkgPackageManager=1
  50. testsuccess grep "^E: Couldn't configure predependsa:i386, probably a dependency cycle.$" rootdir/tmp/testfailure.output
  51. # FIXME: the error message is a catch all here, not like the one above
  52. testfailure aptget install --reinstall predependsdependsa predependsdependsb -s -o Debug::pkgPackageManager=1
  53. testsuccess grep "^E: Could not configure 'predependsdependsb:i386'. $" rootdir/tmp/testfailure.output
  54. msgmsg 'While we are at it, lets try these loops without reinstall as well'
  55. cp dpkg.status rootdir/var/lib/dpkg/status
  56. testsuccessequal 'Reading package lists...
  57. Building dependency tree...
  58. The following NEW packages will be installed:
  59. systemd systemd-sysv
  60. 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
  61. Inst systemd (215-5+b1 unstable [i386])
  62. Conf systemd (215-5+b1 unstable [i386])
  63. Inst systemd-sysv (215-5+b1 unstable [i386])
  64. Conf systemd-sysv (215-5+b1 unstable [i386])' aptget install systemd systemd-sysv -s
  65. testsuccessequal 'Reading package lists...
  66. Building dependency tree...
  67. The following NEW packages will be installed:
  68. dependsa dependsb
  69. 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
  70. Inst dependsa (1 unstable [i386]) []
  71. Inst dependsb (1 unstable [i386])
  72. Conf dependsb (1 unstable [i386])
  73. Conf dependsa (1 unstable [i386])' aptget install dependsa dependsb -s
  74. # there is a chance dpkg can actually do these, BUT this depends on the maintainerscripts (not) present
  75. # which is very very risky to depend on (and apt doesn't know about that anyhow).
  76. testfailure aptget install predependsa predependsb -s -o Debug::pkgPackageManager=1
  77. testsuccess grep "^E: Couldn't configure predependsa:i386, probably a dependency cycle.$" rootdir/tmp/testfailure.output
  78. # FIXME: the error message is a catch all here, not like the one above
  79. testfailure aptget install predependsdependsa predependsdependsb -s -o Debug::pkgPackageManager=1
  80. testsuccess grep "^E: Could not configure 'predependsdependsb:i386'. $" rootdir/tmp/testfailure.output