test-external-installation-planer-protocol 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. #!/bin/sh
  2. set -e
  3. TESTDIR="$(readlink -f "$(dirname "$0")")"
  4. . "$TESTDIR/framework"
  5. setupenvironment
  6. configarchitecture 'amd64'
  7. buildsimplenativepackage 'libfoo' 'amd64' '3' 'experimental' 'Multi-Arch: same'
  8. buildsimplenativepackage 'foo' 'all' '3' 'experimental' 'Depends: newstuff'
  9. buildsimplenativepackage 'foo' 'all' '2' 'unstable' 'Depends: libfoo:amd64, stuff
  10. Conflicts: bar, libfoo:i386
  11. Recommends: unrelated'
  12. buildsimplenativepackage 'libfoo' 'amd64' '2' 'unstable' 'Multi-Arch: same'
  13. buildsimplenativepackage 'unrelated-2' 'amd64' '2' 'unstable'
  14. insertinstalledpackage 'foo' 'all' '1'
  15. insertinstalledpackage 'bar' 'all' '1'
  16. insertinstalledpackage 'stuff' 'all' '1'
  17. insertinstalledpackage 'unrelated-1' 'all' '1'
  18. setupaptarchive --no-update
  19. EIPPLOG="${TMPWORKINGDIRECTORY}/rootdir/var/log/apt/eipp.log"
  20. echo "Dir::Log::Planer \"$EIPPLOG\";" > ./rootdir/etc/apt/apt.conf.d/eipp-logging
  21. testsuccess apt update
  22. export APT_EDSP_DUMP_FILENAME="${TMPWORKINGDIRECTORY}/eipp.dump"
  23. testfailure test -r "$EIPPLOG"
  24. testfailure aptget install foo --planer dump -y
  25. testfailure test -r "$EIPPLOG"
  26. testfailure grep 'unrelated-2' "$APT_EDSP_DUMP_FILENAME"
  27. testsuccessequal '2' grep -c '^Package: foo$' "$APT_EDSP_DUMP_FILENAME"
  28. testsuccessequal '1' grep -c '^Package: libfoo$' "$APT_EDSP_DUMP_FILENAME"
  29. testsuccessequal 'Planer: dump' grep '^Planer: ' "$APT_EDSP_DUMP_FILENAME"
  30. testsuccess aptget install foo -s
  31. testsuccess aptget install foo -y
  32. testsuccess test -r "$EIPPLOG"
  33. testsuccessequal 'Request: EIPP 0.1
  34. Architecture: amd64
  35. Architectures: amd64
  36. Remove: bar:amd64
  37. Install: libfoo:amd64 foo:amd64
  38. Planer: internal' head -n 6 "$EIPPLOG"
  39. aptinternalplaner < "$EIPPLOG" > planer.log || true
  40. testsuccessequal 'Remove: 6
  41. Unpack: 2
  42. Unpack: 4
  43. Configure: 2
  44. Configure: 4' grep -e '^Unpack:' -e '^Install:' -e '^Configure:' -e '^Remove:' planer.log
  45. rm -f "$EIPPLOG"
  46. testsuccess aptget install foo -s --reinstall
  47. testsuccess aptget install foo -y --reinstall
  48. testsuccess test -r "$EIPPLOG"
  49. testsuccessequal 'Request: EIPP 0.1
  50. Architecture: amd64
  51. Architectures: amd64
  52. ReInstall: foo:amd64
  53. Planer: internal' head -n 5 "$EIPPLOG"
  54. aptinternalplaner < "$EIPPLOG" > planer.log || true
  55. testsuccessequal 'Unpack: 4
  56. Configure: 4' grep -e '^Unpack:' -e '^Install:' -e '^Configure:' -e '^Remove:' planer.log
  57. rm -f "$EIPPLOG"
  58. testsuccess aptget purge foo -s
  59. testsuccess aptget purge foo -y
  60. testsuccess test -r "$EIPPLOG"
  61. testsuccessequal 'Request: EIPP 0.1
  62. Architecture: amd64
  63. Architectures: amd64
  64. Remove: foo:amd64
  65. Planer: internal' head -n 5 "$EIPPLOG"
  66. aptinternalplaner < "$EIPPLOG" > planer.log || true
  67. testsuccessequal 'Remove: 4' grep -e '^Unpack:' -e '^Install:' -e '^Configure:' -e '^Remove:' planer.log