test-apt-get-upgrade 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #!/bin/sh
  2. set -e
  3. TESTDIR=$(readlink -f $(dirname $0))
  4. . $TESTDIR/framework
  5. setupenvironment
  6. configarchitecture "i386"
  7. # FIXME: use simulated packages instead
  8. buildsimplenativepackage 'foo' 'all' '1.0'
  9. buildsimplenativepackage 'bar' 'all' '1.0'
  10. buildsimplenativepackage 'apx' 'all' '1.0' 'stable'
  11. buildsimplenativepackage 'apx' 'all' '2.0' 'unstable' 'Conflicts: foo'
  12. buildsimplenativepackage 'apc' 'all' '1.0' 'stable'
  13. buildsimplenativepackage 'apc' 'all' '2.0' 'unstable' 'Depends: bar'
  14. insertinstalledpackage 'apx' 'all' '1.0'
  15. insertinstalledpackage 'apc' 'all' '1.0'
  16. insertinstalledpackage 'foo' 'all' '1.0'
  17. setupaptarchive
  18. msgtest "Test normal upgrade works"
  19. testequal 'Reading package lists...
  20. Building dependency tree...
  21. The following packages have been kept back:
  22. apc apx
  23. The following packages will be upgraded:
  24. foo
  25. 1 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
  26. Inst foo [1.0] (1.0 unstable [all])
  27. Conf foo (1.0 unstable [all])' aptget -s upgrade && msgpass || msgfail
  28. msgtest "Test if upgrade --with-new-pkgs works"
  29. testequal 'Reading package lists...
  30. Building dependency tree...
  31. The following NEW packages will be installed:
  32. bar
  33. The following packages have been kept back:
  34. apx foo
  35. The following packages will be upgraded:
  36. apc
  37. 1 upgraded, 1 newly installed, 0 to remove and 2 not upgraded.
  38. Inst bar (1.0 unstable [all])
  39. Inst apc [1.0] (2.0 unstable [all])
  40. Conf bar (1.0 unstable [all])
  41. Conf apc (2.0 unstable [all])' aptget -s upgrade --with-new-pkgs && msgpass || msgfail
  42. msgtest "Test dist-upgrade works"
  43. testequal 'Reading package lists...
  44. Building dependency tree...
  45. The following NEW packages will be installed:
  46. bar
  47. The following packages have been kept back:
  48. apx
  49. The following packages will be upgraded:
  50. apc foo
  51. 2 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
  52. Inst bar (1.0 unstable [all])
  53. Inst apc [1.0] (2.0 unstable [all])
  54. Inst foo [1.0] (1.0 unstable [all])
  55. Conf bar (1.0 unstable [all])
  56. Conf apc (2.0 unstable [all])
  57. Conf foo (1.0 unstable [all])' aptget -s dist-upgrade && msgpass || msgfail