test-apt-get-upgrade 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. #!/bin/sh
  2. set -e
  3. TESTDIR=$(readlink -f $(dirname $0))
  4. . $TESTDIR/framework
  5. setupenvironment
  6. configarchitecture "i386"
  7. # simple case
  8. insertpackage 'stable,installed' 'upgrade-simple' 'all' '1.0'
  9. insertpackage 'unstable' 'upgrade-simple' 'all' '2.0'
  10. # upgrade with a new dependency
  11. insertpackage 'stable,installed' 'upgrade-with-new-dep' 'all' '1.0'
  12. insertpackage 'unstable' 'upgrade-with-new-dep' 'all' '2.0' 'Depends: new-dep'
  13. insertpackage 'stable' 'new-dep' 'all' '1.0'
  14. # upgrade with conflict and a new pkg with higher priority than conflict
  15. insertpackage 'stable,installed' 'upgrade-with-conflict' 'all' '1.0'
  16. insertpackage 'unstable' 'upgrade-with-conflict' 'all' '2.0' 'Conflicts: conflicting-dep' 'standard'
  17. insertpackage 'stable,installed' 'conflicting-dep' 'all' '1.0'
  18. setupaptarchive
  19. # Test if normal upgrade works as expected
  20. testequal 'Reading package lists...
  21. Building dependency tree...
  22. Calculating upgrade...
  23. The following packages have been kept back:
  24. upgrade-with-conflict upgrade-with-new-dep
  25. The following packages will be upgraded:
  26. upgrade-simple
  27. 1 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
  28. Inst upgrade-simple [1.0] (2.0 unstable [all])
  29. Conf upgrade-simple (2.0 unstable [all])' aptget -s upgrade
  30. # Test if apt-get upgrade --with-new-pkgs works
  31. testequal 'Reading package lists...
  32. Building dependency tree...
  33. Calculating upgrade...
  34. The following NEW packages will be installed:
  35. new-dep
  36. The following packages have been kept back:
  37. upgrade-with-conflict
  38. The following packages will be upgraded:
  39. upgrade-simple upgrade-with-new-dep
  40. 2 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
  41. Inst new-dep (1.0 stable [all])
  42. Inst upgrade-simple [1.0] (2.0 unstable [all])
  43. Inst upgrade-with-new-dep [1.0] (2.0 unstable [all])
  44. Conf new-dep (1.0 stable [all])
  45. Conf upgrade-simple (2.0 unstable [all])
  46. Conf upgrade-with-new-dep (2.0 unstable [all])' aptget -s upgrade --with-new-pkgs
  47. # Test if apt-get dist-upgrade works
  48. testequal 'Reading package lists...
  49. Building dependency tree...
  50. Calculating upgrade...
  51. The following packages will be REMOVED:
  52. conflicting-dep
  53. The following NEW packages will be installed:
  54. new-dep
  55. The following packages will be upgraded:
  56. upgrade-simple upgrade-with-conflict upgrade-with-new-dep
  57. 3 upgraded, 1 newly installed, 1 to remove and 0 not upgraded.
  58. Remv conflicting-dep [1.0]
  59. Inst upgrade-with-conflict [1.0] (2.0 unstable [all])
  60. Inst new-dep (1.0 stable [all])
  61. Inst upgrade-simple [1.0] (2.0 unstable [all])
  62. Inst upgrade-with-new-dep [1.0] (2.0 unstable [all])
  63. Conf upgrade-with-conflict (2.0 unstable [all])
  64. Conf new-dep (1.0 stable [all])
  65. Conf upgrade-simple (2.0 unstable [all])
  66. Conf upgrade-with-new-dep (2.0 unstable [all])' aptget -s dist-upgrade