test-ubuntu-bug-761175-remove-purge 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #!/bin/sh
  2. set -e
  3. TESTDIR="$(readlink -f "$(dirname "$0")")"
  4. . "$TESTDIR/framework"
  5. setupenvironment
  6. configarchitecture 'amd64' 'i386'
  7. buildcompizpkg() {
  8. setupsimplenativepackage "compiz-core-$1" "$2" "$3" "$4"
  9. BUILDDIR="incoming/compiz-core-$1-$3"
  10. mkdir -p ${BUILDDIR}/debian/compiz-core/etc
  11. echo 'foo=bar;' > ${BUILDDIR}/compiz.conf
  12. echo 'compiz.conf /etc/compiz.conf' >> ${BUILDDIR}/debian/install
  13. buildpackage "$BUILDDIR" "$4" 'main' "$2"
  14. rm -rf "$BUILDDIR"
  15. }
  16. buildcompizpkg 'native' 'all' '1.0' 'stable'
  17. buildcompizpkg 'all' 'native' '1.0' 'stable'
  18. buildcompizpkg 'native' 'native' '2.0' 'unstable'
  19. buildcompizpkg 'all' 'all' '2.0' 'unstable'
  20. setupaptarchive
  21. runtests() {
  22. testdpkgnotinstalled compiz-core-$1
  23. testsuccess aptget install compiz-core-$1 -t "${2:-unstable}"
  24. testdpkginstalled compiz-core-$1
  25. testsuccess aptget remove compiz-core-$1 -y
  26. testdpkgnotinstalled compiz-core-$1
  27. testdpkgstatus 'rc' '1' "compiz-core-$1"
  28. testsuccessequal "Reading package lists...
  29. Building dependency tree...
  30. Reading state information...
  31. The following packages will be REMOVED:
  32. compiz-core-$1*
  33. 0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
  34. Purg compiz-core-$1" aptget purge compiz-core-$1 -s
  35. testsuccess aptget purge compiz-core-$1 -y
  36. echo -n '' > rootdir/var/lib/dpkg/available # dpkg -l < 1.16.2 reads the available file by default, where the package can be found
  37. testequalor2 "dpkg-query: no packages found matching compiz-core-$1" "No packages found matching compiz-core-$1." dpkg -l compiz-core-$1
  38. }
  39. msgmsg 'Test in multi arch environment'
  40. runtests 'native'
  41. runtests 'all'
  42. runtests 'native' 'stable'
  43. runtests 'all' 'stable'
  44. msgmsg 'Test in single arch environment'
  45. configarchitecture 'amd64'
  46. runtests 'native'
  47. runtests 'all'
  48. runtests 'native' 'stable'
  49. runtests 'all' 'stable'