]> git.saurik.com Git - apt.git/blame_incremental - test/integration/test-apt-cache
reenable gcc warnings for deprecated functions
[apt.git] / test / integration / test-apt-cache
... / ...
CommitLineData
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"
19insertpackage 'unstable' 'specific' 'all' '1' 'Depends: bar:i386, specific:amd64
20Breaks: foo:amd64 (<< 1)
21Replaces: foo:i386 (<< 1)' "$DESCR"
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
37testfailureequal 'E: apt-cache stats does not take any arguments' aptcache stats foo
38testsuccess aptcache xvcg foo
39cp rootdir/tmp/testsuccess.output xvcg.output
40testsuccess test -s xvcg.output
41testsuccess aptcache dotty foo
42cp rootdir/tmp/testsuccess.output dotty.output
43testsuccess test -s dotty.output
44# for this, even the sourcecode says it is useless (expect debugging)
45testsuccess aptcache dump
46cp rootdir/tmp/testsuccess.output dump.output
47testsuccess test -s dump.output
48
49testsuccessequal 'dpkg
50bar
51specific
52fancy
53foo' aptcache pkgnames
54testsuccessequal 'bar' aptcache pkgnames bar
55testsuccessequal 'fancy
56foo' aptcache pkgnames f
57
58testsuccessequal " foo | 1 | file:$(readlink -f .)/aptarchive unstable/main amd64 Packages
59 foo | 1 | file:$(readlink -f .)/aptarchive unstable/main i386 Packages" aptcache madison foo
60
61### depends
62
63testsuccessequal 'foo
64 Depends: bar
65 Conflicts: <foobar>
66 |Recommends: <cool>
67 Recommends: <cooler>' aptcache depends foo
68testsuccessequal 'foo
69 Depends: bar
70 Conflicts: <foobar>
71 |Recommends: <cool>
72 Recommends: <cooler>' aptcache depends foo --implicit
73testsuccessequal 'foo
74 Depends: bar
75 Conflicts: <foobar>
76 Recommends: <cool>' aptcache depends foo -o APT::Cache::ShowOnlyFirstOr=1
77testsuccessequal 'foo
78 Depends: bar
79 Conflicts: <foobar>
80 Recommends: <cool>' aptcache depends foo -o APT::Cache::ShowOnlyFirstOr=1 --implicit
81testsuccessequal 'foo
82 Depends: bar
83 Conflicts: <foobar>
84 |Recommends: <cool> (>= 2)
85 Recommends: <cooler> (<< 5)' aptcache depends foo -o APT::Cache::ShowVersion=1
86testsuccessequal 'foo
87 Depends: bar
88 Conflicts: <foobar>
89 |Recommends: <cool> (>= 2)
90 Recommends: <cooler> (<< 5)' aptcache depends foo -o APT::Cache::ShowVersion=1 --implicit
91testsuccessequal 'foo
92 Depends: bar
93 Conflicts: <foobar>' aptcache depends foo --no-recommends
94testsuccessequal 'foo
95 Depends: bar
96 Conflicts: <foobar>' aptcache depends foo --no-recommends --implicit
97testsuccessequal 'foo
98 Depends: bar' aptcache depends foo --important --implicit
99testsuccessequal 'foo
100 Conflicts: <foobar>' aptcache depends foo --important --no-depends --conflicts
101testsuccessequal 'foo
102 Conflicts: <foobar>' aptcache depends foo --important --no-depends --conflicts --implicit
103testsuccessequal 'foo
104 Depends: bar
105 Conflicts: <foobar>
106 |Recommends: <cool>
107 Recommends: <cooler>
108bar
109 Depends: bar
110 Breaks: foo
111 Replaces: foo
112<foobar>
113<cool>
114<cooler>' aptcache depends foo --recurse
115testsuccessequal 'foo
116 Depends: bar
117 Conflicts: <foobar>
118 |Recommends: <cool>
119 Recommends: <cooler>
120bar
121 Depends: bar
122 Breaks: foo
123 Replaces: foo
124<foobar>
125<cool>
126<cooler>' aptcache depends foo --recurse --implicit
127testsuccessequal 'foo
128 Depends: bar
129bar
130 Depends: bar
131 Replaces: foo' aptcache depends foo --recurse --important --replaces
132testsuccessequal 'foo
133 Depends: bar
134bar
135 Depends: bar
136 Replaces: foo' aptcache depends foo --recurse --important --replaces --implicit
137testsuccessequal 'bar
138 Depends: bar
139 Breaks: foo
140 Replaces: foo' aptcache depends bar
141testsuccessequal 'bar
142 Depends: bar
143 Breaks: foo
144 Replaces: foo' aptcache depends bar --implicit
145
146testsuccessequal 'specific
147 Depends: <bar:i386>
148 Depends: <specific:amd64>
149 specific
150 Breaks: <foo:amd64>
151 Replaces: <foo:i386>' aptcache depends specific
152testsuccessequal 'specific
153 Depends: <bar:i386>
154 Depends: <specific:amd64>
155 specific
156 Breaks: <foo:amd64>
157 Replaces: <foo:i386>' aptcache depends specific --implicit
158
159## rdepends
160
161# Note that specific does not appear in this list as it doesn't depend on foo,
162# but on an arch-specific foo!
163testsuccessequal 'foo
164Reverse Depends:
165 bar
166 bar' aptcache rdepends foo
167testsuccessequal 'foo
168Reverse Depends:
169 Breaks: bar
170 Replaces: bar' aptcache rdepends foo -o APT::Cache::ShowDependencyType=1
171testsuccessequal 'foo
172Reverse Depends:
173 Breaks: bar (<< 1)
174 Replaces: bar (<< 1)' aptcache rdepends foo -o APT::Cache::ShowDependencyType=1 -o APT::Cache::ShowVersion=1
175testsuccessequal 'foo
176Reverse Depends:
177 Breaks: bar (<< 1)' aptcache rdepends foo -o APT::Cache::ShowDependencyType=1 -o APT::Cache::ShowVersion=1 --important --breaks