]> git.saurik.com Git - apt.git/blame - test/integration/test-apt-cache
sync TFRewrite*Order arrays with dpkg and dak
[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"
19
20setupaptarchive
21
22# dpkg is installed by our framework
23testdpkginstalled 'dpkg'
24testempty aptcache unmet dpkg
25
26# FIXME: Find some usecase for unmet as it seems kinda useless/broken
27#testsuccess aptcache unmet
28#testsuccess aptcache unmet foo
29
30# not too useful to test, but makes coverage green…
31testsuccess aptcache stats
32cp rootdir/tmp/testsuccess.output stats.output
33testsuccess test -s stats.output
34testsuccess aptcache xvcg foo
35cp rootdir/tmp/testsuccess.output xvcg.output
36testsuccess test -s xvcg.output
37testsuccess aptcache dotty foo
38cp rootdir/tmp/testsuccess.output dotty.output
39testsuccess test -s dotty.output
40# for this, even the sourcecode says it is useless (expect debugging)
41testsuccess aptcache dump
42cp rootdir/tmp/testsuccess.output dump.output
43testsuccess test -s dump.output
44
25b86db1 45testsuccessequal 'dpkg
081c9d44
DK
46bar
47fancy
48foo' aptcache pkgnames
25b86db1
DK
49testsuccessequal 'bar' aptcache pkgnames bar
50testsuccessequal 'fancy
081c9d44
DK
51foo' aptcache pkgnames f
52
25b86db1 53testsuccessequal " foo | 1 | file:$(readlink -f .)/aptarchive/ unstable/main amd64 Packages" aptcache madison foo
081c9d44
DK
54
55### depends
56
25b86db1 57testsuccessequal 'foo
081c9d44
DK
58 Depends: bar
59 |Recommends: <cool>
60 Recommends: <cooler>
61 Conflicts: <foobar>
62 Conflicts: <foobar:i386>' aptcache depends foo
25b86db1 63testsuccessequal 'foo
081c9d44
DK
64 Depends: bar
65 Recommends: <cool>
66 Conflicts: <foobar>
67 Conflicts: <foobar:i386>' aptcache depends foo -o APT::Cache::ShowOnlyFirstOr=1
25b86db1 68testsuccessequal 'foo
081c9d44
DK
69 Depends: bar
70 |Recommends: <cool> (>= 2)
71 Recommends: <cooler> (<< 5)
72 Conflicts: <foobar>
73 Conflicts: <foobar:i386>' aptcache depends foo -o APT::Cache::ShowVersion=1
25b86db1 74testsuccessequal 'foo
081c9d44
DK
75 Depends: bar
76 Conflicts: <foobar>
77 Conflicts: <foobar:i386>' aptcache depends foo --no-recommends
25b86db1 78testsuccessequal 'foo
081c9d44 79 Depends: bar' aptcache depends foo --important
25b86db1 80testsuccessequal 'foo
081c9d44
DK
81 Conflicts: <foobar>
82 Conflicts: <foobar:i386>' aptcache depends foo --important --no-depends --conflicts
25b86db1 83testsuccessequal 'foo
081c9d44
DK
84 Depends: bar
85 |Recommends: <cool>
86 Recommends: <cooler>
87 Conflicts: <foobar>
88 Conflicts: <foobar:i386>
89bar
90 Depends: bar
91 Breaks: foo
92 Breaks: <foo:i386>
93 Replaces: foo
94 Replaces: <foo:i386>
95<cool>
96<cooler>
97<foobar>
98<foobar:i386>
99<foo:i386>' aptcache depends foo --recurse
25b86db1 100testsuccessequal 'foo
081c9d44
DK
101 Depends: bar
102bar
103 Depends: bar
104 Replaces: foo
105 Replaces: <foo:i386>
106<foo:i386>' aptcache depends foo --recurse --important --replaces
107
108## rdpends
109
25b86db1 110testsuccessequal 'foo
081c9d44
DK
111Reverse Depends:
112 bar
113 bar' aptcache rdepends foo
25b86db1 114testsuccessequal 'foo
081c9d44
DK
115Reverse Depends:
116 Replaces: bar
117 Breaks: bar' aptcache rdepends foo -o APT::Cache::ShowDependencyType=1
25b86db1 118testsuccessequal 'foo
081c9d44
DK
119Reverse Depends:
120 Replaces: bar (<< 1)
121 Breaks: bar (<< 1)' aptcache rdepends foo -o APT::Cache::ShowDependencyType=1 -o APT::Cache::ShowVersion=1
25b86db1 122testsuccessequal 'foo
081c9d44
DK
123Reverse Depends:
124 Breaks: bar (<< 1)' aptcache rdepends foo -o APT::Cache::ShowDependencyType=1 -o APT::Cache::ShowVersion=1 --important --breaks