]> git.saurik.com Git - apt.git/blame - test/integration/test-apt-cache
Fix the test suite again
[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
7f8c0eed
DK
57testsuccessequal " foo | 1 | file:$(readlink -f .)/aptarchive unstable/main amd64 Packages
58 foo | 1 | file:$(readlink -f .)/aptarchive unstable/main i386 Packages" aptcache madison foo
081c9d44
DK
59
60### depends
61
25b86db1 62testsuccessequal 'foo
081c9d44 63 Depends: bar
081c9d44 64 Conflicts: <foobar>
fd23676e
DK
65 |Recommends: <cool>
66 Recommends: <cooler>' aptcache depends foo
25b86db1 67testsuccessequal 'foo
081c9d44 68 Depends: bar
081c9d44 69 Conflicts: <foobar>
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>
8c7af4d4
DK
79 Recommends: <cool>' aptcache depends foo -o APT::Cache::ShowOnlyFirstOr=1 --implicit
80testsuccessequal 'foo
81 Depends: bar
82 Conflicts: <foobar>
fd23676e
DK
83 |Recommends: <cool> (>= 2)
84 Recommends: <cooler> (<< 5)' aptcache depends foo -o APT::Cache::ShowVersion=1
25b86db1 85testsuccessequal 'foo
081c9d44
DK
86 Depends: bar
87 Conflicts: <foobar>
8c7af4d4
DK
88 |Recommends: <cool> (>= 2)
89 Recommends: <cooler> (<< 5)' aptcache depends foo -o APT::Cache::ShowVersion=1 --implicit
25b86db1 90testsuccessequal 'foo
8c7af4d4
DK
91 Depends: bar
92 Conflicts: <foobar>' aptcache depends foo --no-recommends
93testsuccessequal 'foo
94 Depends: bar
bb0f6a34 95 Conflicts: <foobar>' aptcache depends foo --no-recommends --implicit
8c7af4d4
DK
96testsuccessequal 'foo
97 Depends: bar' aptcache depends foo --important --implicit
25b86db1 98testsuccessequal 'foo
8c7af4d4
DK
99 Conflicts: <foobar>' aptcache depends foo --important --no-depends --conflicts
100testsuccessequal 'foo
bb0f6a34 101 Conflicts: <foobar>' aptcache depends foo --important --no-depends --conflicts --implicit
8c7af4d4
DK
102testsuccessequal 'foo
103 Depends: bar
081c9d44 104 Conflicts: <foobar>
8c7af4d4
DK
105 |Recommends: <cool>
106 Recommends: <cooler>
107bar
108 Depends: bar
109 Breaks: foo
110 Replaces: foo
111<foobar>
112<cool>
113<cooler>' aptcache depends foo --recurse
25b86db1 114testsuccessequal 'foo
081c9d44 115 Depends: bar
081c9d44 116 Conflicts: <foobar>
fd23676e
DK
117 |Recommends: <cool>
118 Recommends: <cooler>
081c9d44
DK
119bar
120 Depends: bar
121 Breaks: foo
081c9d44 122 Replaces: foo
bb0f6a34 123 Breaks: <foo:i386>
081c9d44 124 Replaces: <foo:i386>
081c9d44 125<foobar>
fd23676e
DK
126<cool>
127<cooler>
8c7af4d4
DK
128<foo:i386>' aptcache depends foo --recurse --implicit
129testsuccessequal 'foo
130 Depends: bar
131bar
132 Depends: bar
133 Replaces: foo' aptcache depends foo --recurse --important --replaces
25b86db1 134testsuccessequal 'foo
081c9d44
DK
135 Depends: bar
136bar
137 Depends: bar
138 Replaces: foo
139 Replaces: <foo:i386>
8c7af4d4
DK
140<foo:i386>' aptcache depends foo --recurse --important --replaces --implicit
141testsuccessequal 'bar
142 Depends: bar
143 Breaks: foo
144 Replaces: foo' aptcache depends bar
145testsuccessequal 'bar
146 Depends: bar
147 Breaks: foo
8c7af4d4 148 Replaces: foo
bb0f6a34 149 Breaks: <foo:i386>
8c7af4d4
DK
150 Replaces: <foo:i386>' aptcache depends bar --implicit
151testsuccessequal 'specific
152 Depends: <bar:i386>
153 Depends: specific:amd64
154 Breaks: foo:amd64
155 Replaces: <foo:i386>' aptcache depends specific
156testsuccessequal 'specific
157 Depends: <bar:i386>
158 Depends: specific:amd64
159 Breaks: foo:amd64
160 Replaces: <foo:i386>' aptcache depends specific --implicit
081c9d44
DK
161
162## rdpends
163
25b86db1 164testsuccessequal 'foo
081c9d44
DK
165Reverse Depends:
166 bar
8c7af4d4 167 specific
081c9d44 168 bar' aptcache rdepends foo
25b86db1 169testsuccessequal 'foo
081c9d44 170Reverse Depends:
b291aa59 171 Breaks: bar
8c7af4d4 172 Breaks: specific
b291aa59 173 Replaces: bar' aptcache rdepends foo -o APT::Cache::ShowDependencyType=1
25b86db1 174testsuccessequal 'foo
081c9d44 175Reverse Depends:
b291aa59 176 Breaks: bar (<< 1)
8c7af4d4 177 Breaks: specific (<< 1)
b291aa59 178 Replaces: bar (<< 1)' aptcache rdepends foo -o APT::Cache::ShowDependencyType=1 -o APT::Cache::ShowVersion=1
25b86db1 179testsuccessequal 'foo
081c9d44 180Reverse Depends:
8c7af4d4
DK
181 Breaks: bar (<< 1)
182 Breaks: specific (<< 1)' aptcache rdepends foo -o APT::Cache::ShowDependencyType=1 -o APT::Cache::ShowVersion=1 --important --breaks