test-apt-get-upgrade 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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' 'upgrade-simple' 'all' '1.0'
  9. insertpackage 'unstable' 'upgrade-simple' 'all' '2.0'
  10. insertinstalledpackage 'upgrade-simple' 'all' '1.0'
  11. # upgrade with a new dependency
  12. insertpackage 'stable' 'upgrade-with-new-dep' 'all' '1.0'
  13. insertpackage 'unstable' 'upgrade-with-new-dep' 'all' '2.0' 'Depends: new-dep'
  14. insertpackage 'stable' 'new-dep' 'all' '1.0'
  15. insertinstalledpackage 'upgrade-with-new-dep' 'all' '1.0'
  16. # upgrade with conflict and a new pkg with higher priority than conflict
  17. insertpackage 'stable' 'upgrade-with-conflict' 'all' '1.0'
  18. insertpackage 'unstable' 'upgrade-with-conflict' 'all' '2.0' 'Conflicts: conflicting-dep' 'standard'
  19. insertpackage 'stable' 'conflicting-dep' 'all' '1.0'
  20. insertinstalledpackage 'upgrade-with-conflict' 'all' '1.0'
  21. insertinstalledpackage 'conflicting-dep' 'all' '1.0'
  22. setupaptarchive
  23. # Test if normal upgrade works as expected
  24. testequal 'Reading package lists...
  25. Building dependency tree...
  26. Calculating upgrade...
  27. The following packages have been kept back:
  28. upgrade-with-conflict upgrade-with-new-dep
  29. The following packages will be upgraded:
  30. upgrade-simple
  31. 1 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
  32. Inst upgrade-simple [1.0] (2.0 unstable [all])
  33. Conf upgrade-simple (2.0 unstable [all])' aptget -s upgrade
  34. # Test if apt-get upgrade --with-new-pkgs works
  35. testequal 'Reading package lists...
  36. Building dependency tree...
  37. Calculating upgrade...
  38. The following NEW packages will be installed:
  39. new-dep
  40. The following packages have been kept back:
  41. upgrade-with-conflict
  42. The following packages will be upgraded:
  43. upgrade-simple upgrade-with-new-dep
  44. 2 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
  45. Inst new-dep (1.0 stable [all])
  46. Inst upgrade-simple [1.0] (2.0 unstable [all])
  47. Inst upgrade-with-new-dep [1.0] (2.0 unstable [all])
  48. Conf new-dep (1.0 stable [all])
  49. Conf upgrade-simple (2.0 unstable [all])
  50. Conf upgrade-with-new-dep (2.0 unstable [all])' aptget -s upgrade --with-new-pkgs
  51. # Test if apt-get dist-upgrade works
  52. testequal 'Reading package lists...
  53. Building dependency tree...
  54. Calculating upgrade...
  55. The following packages will be REMOVED:
  56. conflicting-dep
  57. The following NEW packages will be installed:
  58. new-dep
  59. The following packages will be upgraded:
  60. upgrade-simple upgrade-with-conflict upgrade-with-new-dep
  61. 3 upgraded, 1 newly installed, 1 to remove and 0 not upgraded.
  62. Remv conflicting-dep [1.0]
  63. Inst upgrade-with-conflict [1.0] (2.0 unstable [all])
  64. Inst new-dep (1.0 stable [all])
  65. Inst upgrade-simple [1.0] (2.0 unstable [all])
  66. Inst upgrade-with-new-dep [1.0] (2.0 unstable [all])
  67. Conf upgrade-with-conflict (2.0 unstable [all])
  68. Conf new-dep (1.0 stable [all])
  69. Conf upgrade-simple (2.0 unstable [all])
  70. Conf upgrade-with-new-dep (2.0 unstable [all])' aptget -s dist-upgrade