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