test-apt-get-clean 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. #!/bin/sh
  2. set -e
  3. TESTDIR=$(readlink -f $(dirname $0))
  4. . $TESTDIR/framework
  5. setupenvironment
  6. configarchitecture 'amd64'
  7. insertpackage 'testing' 'foo' 'all' '1'
  8. insertpackage 'unstable' 'foo' 'all' '2'
  9. insertinstalledpackage 'foo' 'all' '3'
  10. setupaptarchive
  11. # nothing to do always works
  12. testsuccess aptget clean
  13. # generate some dirt and clean it up
  14. touch rootdir/var/lib/apt/lists/partial/http.debian.net_debian_dists_sid_main_i18n_Translation-en
  15. touch rootdir/var/cache/apt/archives/foo_1_all.deb
  16. touch rootdir/var/cache/apt/archives/foo_2_all.deb
  17. touch rootdir/var/cache/apt/archives/foo_3_all.deb
  18. touch rootdir/var/cache/apt/archives/foo_4_all.deb
  19. testsuccess aptget clean
  20. testsuccess test ! -e rootdir/var/lib/apt/lists/partial/http.debian.net_debian_dists_sid_main_i18n_Translation-en
  21. testsuccess test ! -e rootdir/var/cache/apt/archives/foo_1_all.deb
  22. testsuccess test ! -e rootdir/var/cache/apt/archives/foo_2_all.deb
  23. testsuccess test ! -e rootdir/var/cache/apt/archives/foo_3_all.deb
  24. testsuccess test ! -e rootdir/var/cache/apt/archives/foo_4_all.deb