]> git.saurik.com Git - apt.git/blame - test/integration/test-apt-cache
hide implicit deps in apt-cache again by default
[apt.git] / test / integration / test-apt-cache
CommitLineData
081c9d44
DK
1#!/bin/sh
2set -e
3
4TESTDIR=$(readlink -f $(dirname $0))
5. $TESTDIR/framework
6
7setupenvironment
8configarchitecture 'amd64' 'i386'
9
10DESCR='Some description
11 That has multiple lines'
12insertpackage 'unstable' 'fancy' 'all' '1'
13insertpackage 'unstable,installed' 'foo' 'all' '1' 'Depends: bar
14Conflicts: foobar
15Recommends: cool (>= 2) | cooler (<< 5)' "$DESCR"
16insertpackage 'unstable' 'bar' 'all' '1' 'Depends: bar
17Breaks: foo (<< 1)
18Replaces: foo (<< 1)' "$DESCR"
8c7af4d4
DK
19insertpackage 'unstable' 'specific' 'all' '1' 'Depends: bar:i386, specific:amd64
20Breaks: foo:amd64 (<< 1)
21Replaces: foo:i386 (<< 1)' "$DESCR"
081c9d44
DK
22
23setupaptarchive
24
25# dpkg is installed by our framework
26testdpkginstalled 'dpkg'
27testempty aptcache unmet dpkg
28
29# FIXME: Find some usecase for unmet as it seems kinda useless/broken
30#testsuccess aptcache unmet
31#testsuccess aptcache unmet foo
32
33# not too useful to test, but makes coverage green…
34testsuccess aptcache stats
35cp rootdir/tmp/testsuccess.output stats.output
36testsuccess test -s stats.output
37testsuccess aptcache xvcg foo
38cp rootdir/tmp/testsuccess.output xvcg.output
39testsuccess test -s xvcg.output
40testsuccess aptcache dotty foo
41cp rootdir/tmp/testsuccess.output dotty.output
42testsuccess test -s dotty.output
43# for this, even the sourcecode says it is useless (expect debugging)
44testsuccess aptcache dump
45cp rootdir/tmp/testsuccess.output dump.output
46testsuccess test -s dump.output
47
25b86db1 48testsuccessequal 'dpkg
081c9d44 49bar
8c7af4d4 50specific
081c9d44
DK
51fancy
52foo' aptcache pkgnames
25b86db1
DK
53testsuccessequal 'bar' aptcache pkgnames bar
54testsuccessequal 'fancy
081c9d44
DK
55foo' aptcache pkgnames f
56
1da3b7b8 57testsuccessequal " foo | 1 | file:$(readlink -f .)/aptarchive unstable/main amd64 Packages" aptcache madison foo
081c9d44
DK
58
59### depends
60
25b86db1 61testsuccessequal 'foo
081c9d44 62 Depends: bar
081c9d44 63 Conflicts: <foobar>
fd23676e
DK
64 |Recommends: <cool>
65 Recommends: <cooler>' aptcache depends foo
25b86db1 66testsuccessequal 'foo
081c9d44 67 Depends: bar
081c9d44 68 Conflicts: <foobar>
fd23676e 69 Conflicts: <foobar:i386>
8c7af4d4
DK
70 |Recommends: <cool>
71 Recommends: <cooler>' aptcache depends foo --implicit
72testsuccessequal 'foo
73 Depends: bar
74 Conflicts: <foobar>
fd23676e 75 Recommends: <cool>' aptcache depends foo -o APT::Cache::ShowOnlyFirstOr=1
25b86db1 76testsuccessequal 'foo
081c9d44 77 Depends: bar
081c9d44 78 Conflicts: <foobar>
fd23676e 79 Conflicts: <foobar:i386>
8c7af4d4
DK
80 Recommends: <cool>' aptcache depends foo -o APT::Cache::ShowOnlyFirstOr=1 --implicit
81testsuccessequal 'foo
82 Depends: bar
83 Conflicts: <foobar>
fd23676e
DK
84 |Recommends: <cool> (>= 2)
85 Recommends: <cooler> (<< 5)' aptcache depends foo -o APT::Cache::ShowVersion=1
25b86db1 86testsuccessequal 'foo
081c9d44
DK
87 Depends: bar
88 Conflicts: <foobar>
8c7af4d4
DK
89 Conflicts: <foobar:i386>
90 |Recommends: <cool> (>= 2)
91 Recommends: <cooler> (<< 5)' aptcache depends foo -o APT::Cache::ShowVersion=1 --implicit
25b86db1 92testsuccessequal 'foo
8c7af4d4
DK
93 Depends: bar
94 Conflicts: <foobar>' aptcache depends foo --no-recommends
95testsuccessequal 'foo
96 Depends: bar
97 Conflicts: <foobar>
98 Conflicts: <foobar:i386>' aptcache depends foo --no-recommends --implicit
99testsuccessequal 'foo
100 Depends: bar' aptcache depends foo --important --implicit
25b86db1 101testsuccessequal 'foo
8c7af4d4
DK
102 Conflicts: <foobar>' aptcache depends foo --important --no-depends --conflicts
103testsuccessequal 'foo
104 Conflicts: <foobar>
105 Conflicts: <foobar:i386>' aptcache depends foo --important --no-depends --conflicts --implicit
106testsuccessequal 'foo
107 Depends: bar
081c9d44 108 Conflicts: <foobar>
8c7af4d4
DK
109 |Recommends: <cool>
110 Recommends: <cooler>
111bar
112 Depends: bar
113 Breaks: foo
114 Replaces: foo
115<foobar>
116<cool>
117<cooler>' aptcache depends foo --recurse
25b86db1 118testsuccessequal 'foo
081c9d44 119 Depends: bar
081c9d44
DK
120 Conflicts: <foobar>
121 Conflicts: <foobar:i386>
fd23676e
DK
122 |Recommends: <cool>
123 Recommends: <cooler>
081c9d44
DK
124bar
125 Depends: bar
126 Breaks: foo
127 Breaks: <foo:i386>
128 Replaces: foo
129 Replaces: <foo:i386>
081c9d44
DK
130<foobar>
131<foobar:i386>
fd23676e
DK
132<cool>
133<cooler>
8c7af4d4
DK
134<foo:i386>' aptcache depends foo --recurse --implicit
135testsuccessequal 'foo
136 Depends: bar
137bar
138 Depends: bar
139 Replaces: foo' aptcache depends foo --recurse --important --replaces
25b86db1 140testsuccessequal 'foo
081c9d44
DK
141 Depends: bar
142bar
143 Depends: bar
144 Replaces: foo
145 Replaces: <foo:i386>
8c7af4d4
DK
146<foo:i386>' aptcache depends foo --recurse --important --replaces --implicit
147testsuccessequal 'bar
148 Depends: bar
149 Breaks: foo
150 Replaces: foo' aptcache depends bar
151testsuccessequal 'bar
152 Depends: bar
153 Breaks: foo
154 Breaks: <foo:i386>
155 Replaces: foo
156 Replaces: <foo:i386>' aptcache depends bar --implicit
157testsuccessequal 'specific
158 Depends: <bar:i386>
159 Depends: specific:amd64
160 Breaks: foo:amd64
161 Replaces: <foo:i386>' aptcache depends specific
162testsuccessequal 'specific
163 Depends: <bar:i386>
164 Depends: specific:amd64
165 Breaks: foo:amd64
166 Replaces: <foo:i386>' aptcache depends specific --implicit
081c9d44
DK
167
168## rdpends
169
25b86db1 170testsuccessequal 'foo
081c9d44
DK
171Reverse Depends:
172 bar
8c7af4d4 173 specific
081c9d44 174 bar' aptcache rdepends foo
25b86db1 175testsuccessequal 'foo
081c9d44 176Reverse Depends:
b291aa59 177 Breaks: bar
8c7af4d4 178 Breaks: specific
b291aa59 179 Replaces: bar' aptcache rdepends foo -o APT::Cache::ShowDependencyType=1
25b86db1 180testsuccessequal 'foo
081c9d44 181Reverse Depends:
b291aa59 182 Breaks: bar (<< 1)
8c7af4d4 183 Breaks: specific (<< 1)
b291aa59 184 Replaces: bar (<< 1)' aptcache rdepends foo -o APT::Cache::ShowDependencyType=1 -o APT::Cache::ShowVersion=1
25b86db1 185testsuccessequal 'foo
081c9d44 186Reverse Depends:
8c7af4d4
DK
187 Breaks: bar (<< 1)
188 Breaks: specific (<< 1)' aptcache rdepends foo -o APT::Cache::ShowDependencyType=1 -o APT::Cache::ShowVersion=1 --important --breaks