]>
Commit | Line | Data |
---|---|---|
1 | #!/bin/sh | |
2 | set -e | |
3 | ||
4 | TESTDIR="$(readlink -f "$(dirname "$0")")" | |
5 | . "$TESTDIR/framework" | |
6 | ||
7 | setupenvironment | |
8 | configarchitecture "i386" | |
9 | ||
10 | insertpackage 'unstable' 'foo' 'all' '1.0' | |
11 | insertinstalledpackage 'bar' 'i386' '1.0' | |
12 | ||
13 | insertinstalledpackage 'foobar' 'i386' '1.0' | |
14 | insertpackage 'unstable' 'foobar' 'i386' '2.0' | |
15 | ||
16 | insertinstalledpackage 'baz' 'all' '0.1' | |
17 | insertpackage 'testing' 'baz' 'all' '1.0' | |
18 | insertpackage 'unstable' 'baz' 'all' '2.0' | |
19 | ||
20 | setupaptarchive | |
21 | ||
22 | testsuccessequal "Listing... | |
23 | bar/now 1.0 i386 [installed,local] | |
24 | baz/unstable 2.0 all [upgradable from: 0.1] | |
25 | dpkg/now 1.16.2+fake all [installed,local] | |
26 | foo/unstable 1.0 all | |
27 | foobar/unstable 2.0 i386 [upgradable from: 1.0]" apt list | |
28 | ||
29 | testsuccessequal "Listing... | |
30 | foo/unstable 1.0 all | |
31 | foobar/unstable 2.0 i386 [upgradable from: 1.0]" apt list "foo*" | |
32 | ||
33 | testsuccessequal "Listing... | |
34 | baz/unstable 2.0 all [upgradable from: 0.1] | |
35 | foobar/unstable 2.0 i386 [upgradable from: 1.0]" apt list --upgradable | |
36 | ||
37 | # FIXME: hm, hm - does it make sense to have this different? shouldn't | |
38 | # we use "installed,upgradable" consitently? | |
39 | testsuccessequal "Listing... | |
40 | bar/now 1.0 i386 [installed,local] | |
41 | baz/now 0.1 all [installed,upgradable to: 2.0] | |
42 | dpkg/now 1.16.2+fake all [installed,local] | |
43 | foobar/now 1.0 i386 [installed,upgradable to: 2.0]" apt list --installed | |
44 | ||
45 | testsuccessequal "Listing... | |
46 | bar/now 1.0 i386 [installed,local] | |
47 | ||
48 | foobar/unstable 2.0 i386 [upgradable from: 1.0] | |
49 | foobar/now 1.0 i386 [installed,upgradable to: 2.0] | |
50 | " apt list bar foobar --all-versions | |
51 | ||
52 | testsuccessequal "Listing... | |
53 | bar/now 1.0 i386 [installed,local] | |
54 | an autogenerated dummy bar=1.0/installed | |
55 | " apt list bar --verbose | |
56 | ||
57 | # test for dpkg ^rc state | |
58 | insertinstalledpackage 'conf-only' 'i386' '1.0' '' '' 'deinstall ok config-files' | |
59 | testsuccessequal "Listing... | |
60 | conf-only/now 1.0 i386 [residual-config]" apt list conf-only | |
61 | ||
62 | # ensure that the users learns about multiple versions too | |
63 | testsuccessequal "Listing... | |
64 | baz/unstable 2.0 all [upgradable from: 0.1] | |
65 | N: There are 2 additional versions. Please use the '-a' switch to see them." apt list baz -o quiet=0 | |
66 | testsuccessequal 'Listing... | |
67 | baz/unstable 2.0 all [upgradable from: 0.1] | |
68 | baz/testing 1.0 all | |
69 | baz/now 0.1 all [installed,upgradable to: 2.0] | |
70 | ' apt list baz -o quiet=0 -a | |
71 | ||
72 | # test format strings for machine parseable output | |
73 | testsuccessequal 'bar - 1.0 - 1.0 | |
74 | baz - 0.1 - 2.0' apt list -qq bar baz -o APT::Cmd::use-format=true -o APT::Cmd::format="\${Package} - \${installed:Version} - \${candidate:Version}" |