diff options
Diffstat (limited to 'test/integration')
-rw-r--r-- | test/integration/framework | 3 | ||||
-rwxr-xr-x | test/integration/test-apt-cache-showsrc | 31 |
2 files changed, 33 insertions, 1 deletions
diff --git a/test/integration/framework b/test/integration/framework index b443f2a7b..d9282eede 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -794,6 +794,7 @@ insertsource() { local ARCH="$3" local VERSION="$4" local DEPENDENCIES="$5" + local BINARY="${6:-$NAME}" local ARCHS="" local SPATH="aptarchive/dists/${RELEASE}/main/source" mkdir -p $SPATH @@ -801,7 +802,7 @@ insertsource() { local DSCFILE="${NAME}_${VERSION}.dsc" local TARFILE="${NAME}_${VERSION}.tar.gz" echo "Package: $NAME -Binary: $NAME +Binary: $BINARY Version: $VERSION Maintainer: Joe Sixpack <joe@example.org> Architecture: $ARCH" >> $FILE diff --git a/test/integration/test-apt-cache-showsrc b/test/integration/test-apt-cache-showsrc new file mode 100755 index 000000000..319b4f2f2 --- /dev/null +++ b/test/integration/test-apt-cache-showsrc @@ -0,0 +1,31 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework + +setupenvironment +configarchitecture "i386" + +# we have a foo source package +insertsource 'unstable' 'foo' 'all' '1.0' '' 'foo-binary' + +# and a similar one that builds a foo binary package +insertsource 'unstable' 'unreleated' 'all' '1.0' '' 'foo' + +# just here to workaround the need for a authenticated package +insertpackage 'unstable' 'workaround' 'all' '1.0' + +setupaptarchive + +# by default apt-cache showsrc will look into "binary" and "source" names +# and show all matches +aptcache showsrc foo > output.txt +testsuccess grep "Package: foo" output.txt +testsuccess grep "Package: unreleated" output.txt + +# by default apt-cache showsrc will look into "binary" and "source" names +# and show all matches +aptcache showsrc --only-source foo > output.txt +testsuccess grep "Package: foo" output.txt +testfailure grep "Package: unreleated" output.txt |