]>
Commit | Line | Data |
---|---|---|
081c9d44 DK |
1 | #!/bin/sh |
2 | set -e | |
3 | ||
3abb6a6a DK |
4 | TESTDIR="$(readlink -f "$(dirname "$0")")" |
5 | . "$TESTDIR/framework" | |
081c9d44 DK |
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" | |
8c7af4d4 DK |
19 | insertpackage 'unstable' 'specific' 'all' '1' 'Depends: bar:i386, specific:amd64 |
20 | Breaks: foo:amd64 (<< 1) | |
21 | Replaces: foo:i386 (<< 1)' "$DESCR" | |
081c9d44 DK |
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 | |
7414af7f | 37 | testfailureequal 'E: apt-cache stats does not take any arguments' aptcache stats foo |
081c9d44 DK |
38 | testsuccess aptcache xvcg foo |
39 | cp rootdir/tmp/testsuccess.output xvcg.output | |
40 | testsuccess test -s xvcg.output | |
41 | testsuccess aptcache dotty foo | |
42 | cp rootdir/tmp/testsuccess.output dotty.output | |
43 | testsuccess test -s dotty.output | |
44 | # for this, even the sourcecode says it is useless (expect debugging) | |
45 | testsuccess aptcache dump | |
46 | cp rootdir/tmp/testsuccess.output dump.output | |
47 | testsuccess test -s dump.output | |
48 | ||
550d53ec JAK |
49 | testsuccessequal 'bar |
50 | foo | |
202555ac | 51 | dpkg |
67550609 | 52 | specific |
550d53ec | 53 | fancy' aptcache pkgnames |
25b86db1 | 54 | testsuccessequal 'bar' aptcache pkgnames bar |
202555ac JAK |
55 | testsuccessequal 'foo |
56 | fancy' aptcache pkgnames f | |
081c9d44 | 57 | |
1dd20368 | 58 | testsuccessequal " foo | 1 | file:$(readlink -f .)/aptarchive unstable/main all Packages" aptcache madison foo |
081c9d44 DK |
59 | |
60 | ### depends | |
61 | ||
25b86db1 | 62 | testsuccessequal 'foo |
081c9d44 | 63 | Depends: bar |
081c9d44 | 64 | Conflicts: <foobar> |
fd23676e DK |
65 | |Recommends: <cool> |
66 | Recommends: <cooler>' aptcache depends foo | |
25b86db1 | 67 | testsuccessequal 'foo |
081c9d44 | 68 | Depends: bar |
081c9d44 | 69 | Conflicts: <foobar> |
8c7af4d4 DK |
70 | |Recommends: <cool> |
71 | Recommends: <cooler>' aptcache depends foo --implicit | |
72 | testsuccessequal 'foo | |
73 | Depends: bar | |
74 | Conflicts: <foobar> | |
fd23676e | 75 | Recommends: <cool>' aptcache depends foo -o APT::Cache::ShowOnlyFirstOr=1 |
25b86db1 | 76 | testsuccessequal 'foo |
081c9d44 | 77 | Depends: bar |
081c9d44 | 78 | Conflicts: <foobar> |
8c7af4d4 DK |
79 | Recommends: <cool>' aptcache depends foo -o APT::Cache::ShowOnlyFirstOr=1 --implicit |
80 | testsuccessequal '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 | 85 | testsuccessequal '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 | 90 | testsuccessequal 'foo |
8c7af4d4 DK |
91 | Depends: bar |
92 | Conflicts: <foobar>' aptcache depends foo --no-recommends | |
93 | testsuccessequal 'foo | |
94 | Depends: bar | |
bb0f6a34 | 95 | Conflicts: <foobar>' aptcache depends foo --no-recommends --implicit |
8c7af4d4 DK |
96 | testsuccessequal 'foo |
97 | Depends: bar' aptcache depends foo --important --implicit | |
25b86db1 | 98 | testsuccessequal 'foo |
8c7af4d4 DK |
99 | Conflicts: <foobar>' aptcache depends foo --important --no-depends --conflicts |
100 | testsuccessequal 'foo | |
bb0f6a34 | 101 | Conflicts: <foobar>' aptcache depends foo --important --no-depends --conflicts --implicit |
8c7af4d4 DK |
102 | testsuccessequal 'foo |
103 | Depends: bar | |
081c9d44 | 104 | Conflicts: <foobar> |
8c7af4d4 DK |
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 | |
25b86db1 | 114 | testsuccessequal 'foo |
081c9d44 | 115 | Depends: bar |
081c9d44 | 116 | Conflicts: <foobar> |
fd23676e DK |
117 | |Recommends: <cool> |
118 | Recommends: <cooler> | |
081c9d44 DK |
119 | bar |
120 | Depends: bar | |
121 | Breaks: foo | |
081c9d44 | 122 | Replaces: foo |
530302ef DK |
123 | Breaks: <foo:i386> |
124 | Replaces: <foo:i386> | |
081c9d44 | 125 | <foobar> |
fd23676e | 126 | <cool> |
530302ef DK |
127 | <cooler> |
128 | <foo:i386>' aptcache depends foo --recurse --implicit | |
8c7af4d4 DK |
129 | testsuccessequal 'foo |
130 | Depends: bar | |
131 | bar | |
132 | Depends: bar | |
133 | Replaces: foo' aptcache depends foo --recurse --important --replaces | |
25b86db1 | 134 | testsuccessequal 'foo |
081c9d44 DK |
135 | Depends: bar |
136 | bar | |
137 | Depends: bar | |
530302ef DK |
138 | Replaces: foo |
139 | Replaces: <foo:i386> | |
140 | <foo:i386>' aptcache depends foo --recurse --important --replaces --implicit | |
8c7af4d4 DK |
141 | testsuccessequal 'bar |
142 | Depends: bar | |
143 | Breaks: foo | |
144 | Replaces: foo' aptcache depends bar | |
145 | testsuccessequal 'bar | |
146 | Depends: bar | |
147 | Breaks: foo | |
530302ef DK |
148 | Replaces: foo |
149 | Breaks: <foo:i386> | |
150 | Replaces: <foo:i386>' aptcache depends bar --implicit | |
3addaba1 | 151 | |
8c7af4d4 DK |
152 | testsuccessequal 'specific |
153 | Depends: <bar:i386> | |
3addaba1 DK |
154 | Depends: <specific:amd64> |
155 | specific | |
156 | Breaks: <foo:amd64> | |
8c7af4d4 DK |
157 | Replaces: <foo:i386>' aptcache depends specific |
158 | testsuccessequal 'specific | |
159 | Depends: <bar:i386> | |
3addaba1 DK |
160 | Depends: <specific:amd64> |
161 | specific | |
162 | Breaks: <foo:amd64> | |
8c7af4d4 | 163 | Replaces: <foo:i386>' aptcache depends specific --implicit |
081c9d44 | 164 | |
3addaba1 | 165 | ## rdepends |
081c9d44 | 166 | |
3addaba1 DK |
167 | # Note that specific does not appear in this list as it doesn't depend on foo, |
168 | # but on an arch-specific foo! | |
25b86db1 | 169 | testsuccessequal 'foo |
081c9d44 DK |
170 | Reverse Depends: |
171 | bar | |
172 | bar' aptcache rdepends foo | |
25b86db1 | 173 | testsuccessequal 'foo |
081c9d44 | 174 | Reverse Depends: |
b291aa59 DK |
175 | Breaks: bar |
176 | Replaces: bar' aptcache rdepends foo -o APT::Cache::ShowDependencyType=1 | |
25b86db1 | 177 | testsuccessequal 'foo |
081c9d44 | 178 | Reverse Depends: |
b291aa59 DK |
179 | Breaks: bar (<< 1) |
180 | Replaces: bar (<< 1)' aptcache rdepends foo -o APT::Cache::ShowDependencyType=1 -o APT::Cache::ShowVersion=1 | |
25b86db1 | 181 | testsuccessequal 'foo |
081c9d44 | 182 | Reverse Depends: |
3addaba1 | 183 | Breaks: bar (<< 1)' aptcache rdepends foo -o APT::Cache::ShowDependencyType=1 -o APT::Cache::ShowVersion=1 --important --breaks |