summaryrefslogtreecommitdiffstats
path: root/test/integration/test-apt-cache-showsrc
blob: 88de077fc62a37d137d282ddd1ddaf95e4142b2a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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