]>
Commit | Line | Data |
---|---|---|
081c9d44 DK |
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" | |
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 | ||
25b86db1 | 49 | testsuccessequal 'dpkg |
081c9d44 | 50 | bar |
8c7af4d4 | 51 | specific |
081c9d44 DK |
52 | fancy |
53 | foo' aptcache pkgnames | |
25b86db1 DK |
54 | testsuccessequal 'bar' aptcache pkgnames bar |
55 | testsuccessequal 'fancy | |
081c9d44 DK |
56 | foo' aptcache pkgnames f |
57 | ||
7f8c0eed DK |
58 | testsuccessequal " foo | 1 | file:$(readlink -f .)/aptarchive unstable/main amd64 Packages |
59 | foo | 1 | file:$(readlink -f .)/aptarchive unstable/main i386 Packages" aptcache madison foo | |
081c9d44 DK |
60 | |
61 | ### depends | |
62 | ||
25b86db1 | 63 | testsuccessequal 'foo |
081c9d44 | 64 | Depends: bar |
081c9d44 | 65 | Conflicts: <foobar> |
fd23676e DK |
66 | |Recommends: <cool> |
67 | Recommends: <cooler>' aptcache depends foo | |
25b86db1 | 68 | testsuccessequal 'foo |
081c9d44 | 69 | Depends: bar |
081c9d44 | 70 | Conflicts: <foobar> |
8c7af4d4 DK |
71 | |Recommends: <cool> |
72 | Recommends: <cooler>' aptcache depends foo --implicit | |
73 | testsuccessequal 'foo | |
74 | Depends: bar | |
75 | Conflicts: <foobar> | |
fd23676e | 76 | Recommends: <cool>' aptcache depends foo -o APT::Cache::ShowOnlyFirstOr=1 |
25b86db1 | 77 | testsuccessequal 'foo |
081c9d44 | 78 | Depends: bar |
081c9d44 | 79 | Conflicts: <foobar> |
8c7af4d4 DK |
80 | Recommends: <cool>' aptcache depends foo -o APT::Cache::ShowOnlyFirstOr=1 --implicit |
81 | testsuccessequal '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 | 86 | testsuccessequal 'foo |
081c9d44 DK |
87 | Depends: bar |
88 | Conflicts: <foobar> | |
8c7af4d4 DK |
89 | |Recommends: <cool> (>= 2) |
90 | Recommends: <cooler> (<< 5)' aptcache depends foo -o APT::Cache::ShowVersion=1 --implicit | |
25b86db1 | 91 | testsuccessequal 'foo |
8c7af4d4 DK |
92 | Depends: bar |
93 | Conflicts: <foobar>' aptcache depends foo --no-recommends | |
94 | testsuccessequal 'foo | |
95 | Depends: bar | |
bb0f6a34 | 96 | Conflicts: <foobar>' aptcache depends foo --no-recommends --implicit |
8c7af4d4 DK |
97 | testsuccessequal 'foo |
98 | Depends: bar' aptcache depends foo --important --implicit | |
25b86db1 | 99 | testsuccessequal 'foo |
8c7af4d4 DK |
100 | Conflicts: <foobar>' aptcache depends foo --important --no-depends --conflicts |
101 | testsuccessequal 'foo | |
bb0f6a34 | 102 | Conflicts: <foobar>' aptcache depends foo --important --no-depends --conflicts --implicit |
8c7af4d4 DK |
103 | testsuccessequal 'foo |
104 | Depends: bar | |
081c9d44 | 105 | Conflicts: <foobar> |
8c7af4d4 DK |
106 | |Recommends: <cool> |
107 | Recommends: <cooler> | |
108 | bar | |
109 | Depends: bar | |
110 | Breaks: foo | |
111 | Replaces: foo | |
112 | <foobar> | |
113 | <cool> | |
114 | <cooler>' aptcache depends foo --recurse | |
25b86db1 | 115 | testsuccessequal 'foo |
081c9d44 | 116 | Depends: bar |
081c9d44 | 117 | Conflicts: <foobar> |
fd23676e DK |
118 | |Recommends: <cool> |
119 | Recommends: <cooler> | |
081c9d44 DK |
120 | bar |
121 | Depends: bar | |
122 | Breaks: foo | |
081c9d44 | 123 | Replaces: foo |
081c9d44 | 124 | <foobar> |
fd23676e | 125 | <cool> |
3addaba1 | 126 | <cooler>' aptcache depends foo --recurse --implicit |
8c7af4d4 DK |
127 | testsuccessequal 'foo |
128 | Depends: bar | |
129 | bar | |
130 | Depends: bar | |
131 | Replaces: foo' aptcache depends foo --recurse --important --replaces | |
25b86db1 | 132 | testsuccessequal 'foo |
081c9d44 DK |
133 | Depends: bar |
134 | bar | |
135 | Depends: bar | |
3addaba1 | 136 | Replaces: foo' aptcache depends foo --recurse --important --replaces --implicit |
8c7af4d4 DK |
137 | testsuccessequal 'bar |
138 | Depends: bar | |
139 | Breaks: foo | |
140 | Replaces: foo' aptcache depends bar | |
141 | testsuccessequal 'bar | |
142 | Depends: bar | |
143 | Breaks: foo | |
3addaba1 DK |
144 | Replaces: foo' aptcache depends bar --implicit |
145 | ||
8c7af4d4 DK |
146 | testsuccessequal 'specific |
147 | Depends: <bar:i386> | |
3addaba1 DK |
148 | Depends: <specific:amd64> |
149 | specific | |
150 | Breaks: <foo:amd64> | |
8c7af4d4 DK |
151 | Replaces: <foo:i386>' aptcache depends specific |
152 | testsuccessequal 'specific | |
153 | Depends: <bar:i386> | |
3addaba1 DK |
154 | Depends: <specific:amd64> |
155 | specific | |
156 | Breaks: <foo:amd64> | |
8c7af4d4 | 157 | Replaces: <foo:i386>' aptcache depends specific --implicit |
081c9d44 | 158 | |
3addaba1 | 159 | ## rdepends |
081c9d44 | 160 | |
3addaba1 DK |
161 | # Note that specific does not appear in this list as it doesn't depend on foo, |
162 | # but on an arch-specific foo! | |
25b86db1 | 163 | testsuccessequal 'foo |
081c9d44 DK |
164 | Reverse Depends: |
165 | bar | |
166 | bar' aptcache rdepends foo | |
25b86db1 | 167 | testsuccessequal 'foo |
081c9d44 | 168 | Reverse Depends: |
b291aa59 DK |
169 | Breaks: bar |
170 | Replaces: bar' aptcache rdepends foo -o APT::Cache::ShowDependencyType=1 | |
25b86db1 | 171 | testsuccessequal 'foo |
081c9d44 | 172 | Reverse Depends: |
b291aa59 DK |
173 | Breaks: bar (<< 1) |
174 | Replaces: bar (<< 1)' aptcache rdepends foo -o APT::Cache::ShowDependencyType=1 -o APT::Cache::ShowVersion=1 | |
25b86db1 | 175 | testsuccessequal 'foo |
081c9d44 | 176 | Reverse Depends: |
3addaba1 | 177 | Breaks: bar (<< 1)' aptcache rdepends foo -o APT::Cache::ShowDependencyType=1 -o APT::Cache::ShowVersion=1 --important --breaks |