test-external-dependency-solver-protocol 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. #!/bin/sh
  2. set -e
  3. TESTDIR=$(readlink -f $(dirname $0))
  4. . $TESTDIR/framework
  5. setupenvironment
  6. configarchitecture 'amd64' 'i386'
  7. insertinstalledpackage 'cool' 'all' '1'
  8. insertinstalledpackage 'stuff' 'all' '1'
  9. insertpackage 'unstable' 'cool' 'all' '2' 'Multi-Arch: foreign'
  10. insertpackage 'unstable' 'stuff' 'all' '2' 'Multi-Arch: foreign'
  11. insertpackage 'unstable' 'coolstuff' 'i386,amd64' '2' 'Depends: cool, stuff'
  12. insertpackage 'unstable' 'awesome' 'all' '2' 'Multi-Arch: foreign
  13. Conflicts: badstuff'
  14. insertpackage 'unstable' 'badstuff' 'all' '2' 'Multi-Arch: foreign
  15. Conflicts: awesome'
  16. insertpackage 'unstable' 'awesomecoolstuff' 'i386' '2' 'Depends: coolstuff, awesome'
  17. insertpackage 'experimental' 'cool' 'all' '3' 'Multi-Arch: foreign'
  18. insertpackage 'experimental' 'stuff' 'all' '3' 'Multi-Arch: foreign'
  19. insertpackage 'experimental' 'coolstuff' 'i386,amd64' '3' 'Depends: cool, stuff'
  20. setupaptarchive
  21. rm -f /tmp/dump.edsp
  22. testfailureequal 'Reading package lists...
  23. Building dependency tree...
  24. Execute external solver...
  25. The solver encountered an error of type: ERR_JUST_DUMPING
  26. The following information might help you to understand what is wrong:
  27. I am too dumb, i can just dump!
  28. Please use one of my friends instead!
  29. E: External solver failed with: I am too dumb, i can just dump!' aptget install --solver dump coolstuff -s
  30. testsuccess test -s /tmp/dump.edsp
  31. rm -f /tmp/dump.edsp
  32. #FIXME: this should be unstable, but we don't support pinning yet
  33. testsuccessequal 'Reading package lists...
  34. Building dependency tree...
  35. Execute external solver...
  36. The following NEW packages will be installed:
  37. coolstuff
  38. 0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded.
  39. Inst coolstuff (3 experimental [amd64])
  40. Conf coolstuff (3 experimental [amd64])' aptget install --solver apt coolstuff -s
  41. testsuccessequal 'Reading package lists...
  42. Building dependency tree...
  43. Execute external solver...
  44. The following packages will be REMOVED:
  45. cool*
  46. 0 upgraded, 0 newly installed, 1 to remove and 1 not upgraded.
  47. Purg cool [1]' aptget purge --solver apt cool -s
  48. testsuccess aptget install awesomecoolstuff:i386 -s
  49. testsuccess aptget install --solver apt awesomecoolstuff:i386 -s
  50. rm -f /tmp/dump.edsp
  51. testfailure aptget install --solver dump awesomecoolstuff:i386 -s
  52. testsuccess test -s /tmp/dump.edsp
  53. testequal 'Install: awesomecoolstuff:i386' grep :i386 /tmp/dump.edsp
  54. testempty grep :amd64 /tmp/dump.edsp
  55. testsuccess aptget dist-upgrade -s
  56. testsuccess aptget dist-upgrade -s --solver apt
  57. testsuccess aptget upgrade -s
  58. testsuccess aptget upgrade -s --solver apt
  59. testfailure aptget install awesome badstuff -s
  60. testfailure aptget install awesome badstuff -s --solver apt
  61. testsuccess grep 'ERR_UNSOLVABLE' rootdir/tmp/testfailure.output
  62. configarchitecture 'armel'
  63. msgtest 'Test direct calling is okay for' 'apt-internal-solver'
  64. cat /tmp/dump.edsp | aptinternalsolver -q=0 > solver.result 2>&1 || true
  65. if [ "$(tail -n2 solver.result | head -n1 )" = "Message: Done" ]; then
  66. msgpass
  67. else
  68. cat solver.result
  69. msgfail
  70. fi
  71. rm -f /tmp/dump.edsp
  72. testfailure aptget install --solver apt awesomecoolstuff:i386 -s
  73. testsuccess aptinternalsolver scenario
  74. testsuccessequal 'Package: stuff
  75. Source: stuff
  76. Architecture: all
  77. Version: 1
  78. Installed: yes
  79. APT-ID: 2
  80. Priority: optional
  81. Section: other
  82. APT-Pin: 100
  83. APT-Candidate: yes
  84. ' aptinternalsolver scenario stuff