test-apt-get-upgrade 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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. The following packages have been kept back:
  27. upgrade-with-conflict upgrade-with-new-dep
  28. The following packages will be upgraded:
  29. upgrade-simple
  30. 1 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
  31. Inst upgrade-simple [1.0] (2.0 unstable [all])
  32. Conf upgrade-simple (2.0 unstable [all])' aptget -s upgrade
  33. # Test if apt-get upgrade --with-new-pkgs works
  34. testequal 'Reading package lists...
  35. Building dependency tree...
  36. The following NEW packages will be installed:
  37. new-dep
  38. The following packages have been kept back:
  39. upgrade-with-conflict
  40. The following packages will be upgraded:
  41. upgrade-simple upgrade-with-new-dep
  42. 2 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
  43. Inst new-dep (1.0 stable [all])
  44. Inst upgrade-simple [1.0] (2.0 unstable [all])
  45. Inst upgrade-with-new-dep [1.0] (2.0 unstable [all])
  46. Conf new-dep (1.0 stable [all])
  47. Conf upgrade-simple (2.0 unstable [all])
  48. Conf upgrade-with-new-dep (2.0 unstable [all])' aptget -s upgrade --with-new-pkgs
  49. # Test if apt-get dist-upgrade works
  50. testequal 'Reading package lists...
  51. Building dependency tree...
  52. The following packages will be REMOVED:
  53. conflicting-dep
  54. The following NEW packages will be installed:
  55. new-dep
  56. The following packages will be upgraded:
  57. upgrade-simple upgrade-with-conflict upgrade-with-new-dep
  58. 3 upgraded, 1 newly installed, 1 to remove and 0 not upgraded.
  59. Remv conflicting-dep [1.0]
  60. Inst upgrade-with-conflict [1.0] (2.0 unstable [all])
  61. Inst new-dep (1.0 stable [all])
  62. Inst upgrade-simple [1.0] (2.0 unstable [all])
  63. Inst upgrade-with-new-dep [1.0] (2.0 unstable [all])
  64. Conf upgrade-with-conflict (2.0 unstable [all])
  65. Conf new-dep (1.0 stable [all])
  66. Conf upgrade-simple (2.0 unstable [all])
  67. Conf upgrade-with-new-dep (2.0 unstable [all])' aptget -s dist-upgrade