test-apt-cache-showsrc 925 B

1234567891011121314151617181920212223242526272829303132
  1. #!/bin/sh
  2. set -e
  3. TESTDIR="$(readlink -f "$(dirname "$0")")"
  4. . "$TESTDIR/framework"
  5. setupenvironment
  6. configarchitecture "i386"
  7. # we have a foo source package
  8. insertsource 'unstable' 'foo' 'all' '1.0' '' 'foo-binary'
  9. # and a similar one that builds a foo binary package
  10. insertsource 'unstable' 'unreleated' 'all' '1.0' '' 'foo'
  11. # just here to workaround the need for a authenticated package
  12. insertpackage 'unstable' 'workaround' 'all' '1.0'
  13. setupaptarchive
  14. # by default apt-cache showsrc will look into "binary" and "source" names
  15. # and show all matches
  16. aptcache showsrc foo > output.txt
  17. testsuccess grep "Package: foo" output.txt
  18. testsuccess grep "Package: unreleated" output.txt
  19. # by default apt-cache showsrc will look into "binary" and "source" names
  20. # and show all matches
  21. aptcache showsrc --only-source foo > output.txt
  22. testsuccess grep "Package: foo" output.txt
  23. testfailure grep "Package: unreleated" output.txt