]>
Commit | Line | Data |
---|---|---|
14109555 MV |
1 | #!/bin/sh |
2 | set -e | |
3 | ||
3abb6a6a DK |
4 | TESTDIR="$(readlink -f "$(dirname "$0")")" |
5 | . "$TESTDIR/framework" | |
14109555 MV |
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 | ||
d6570f85 MV |
16 | insertinstalledpackage 'baz' 'all' '0.1' |
17 | insertpackage 'testing' 'baz' 'all' '1.0' | |
18 | insertpackage 'unstable' 'baz' 'all' '2.0' | |
19 | ||
14109555 MV |
20 | setupaptarchive |
21 | ||
25b86db1 | 22 | testsuccessequal "Listing... |
4afa7d18 | 23 | bar/now 1.0 i386 [installed,local] |
d6570f85 | 24 | baz/unstable 2.0 all [upgradable from: 0.1] |
561a3557 | 25 | dpkg/now 1.16.2+fake all [installed,local] |
14109555 | 26 | foo/unstable 1.0 all |
4afa7d18 | 27 | foobar/unstable 2.0 i386 [upgradable from: 1.0]" apt list |
14109555 | 28 | |
25b86db1 | 29 | testsuccessequal "Listing... |
14109555 | 30 | foo/unstable 1.0 all |
4afa7d18 | 31 | foobar/unstable 2.0 i386 [upgradable from: 1.0]" apt list "foo*" |
14109555 | 32 | |
25b86db1 | 33 | testsuccessequal "Listing... |
d6570f85 | 34 | baz/unstable 2.0 all [upgradable from: 0.1] |
4afa7d18 | 35 | foobar/unstable 2.0 i386 [upgradable from: 1.0]" apt list --upgradable |
14109555 MV |
36 | |
37 | # FIXME: hm, hm - does it make sense to have this different? shouldn't | |
38 | # we use "installed,upgradable" consitently? | |
25b86db1 | 39 | testsuccessequal "Listing... |
4afa7d18 | 40 | bar/now 1.0 i386 [installed,local] |
d6570f85 | 41 | baz/now 0.1 all [installed,upgradable to: 2.0] |
561a3557 | 42 | dpkg/now 1.16.2+fake all [installed,local] |
4afa7d18 | 43 | foobar/now 1.0 i386 [installed,upgradable to: 2.0]" apt list --installed |
14109555 | 44 | |
25b86db1 | 45 | testsuccessequal "Listing... |
16576001 MV |
46 | bar/now 1.0 i386 [installed,local] |
47 | ||
4afa7d18 MV |
48 | foobar/unstable 2.0 i386 [upgradable from: 1.0] |
49 | foobar/now 1.0 i386 [installed,upgradable to: 2.0] | |
16576001 | 50 | " apt list bar foobar --all-versions |
14109555 | 51 | |
25b86db1 | 52 | testsuccessequal "Listing... |
4afa7d18 | 53 | bar/now 1.0 i386 [installed,local] |
14109555 MV |
54 | an autogenerated dummy bar=1.0/installed |
55 | " apt list bar --verbose | |
56 | ||
c8259fcd MV |
57 | # test for dpkg ^rc state |
58 | insertinstalledpackage 'conf-only' 'i386' '1.0' '' '' 'deinstall ok config-files' | |
25b86db1 | 59 | testsuccessequal "Listing... |
c8259fcd MV |
60 | conf-only/now 1.0 i386 [residual-config]" apt list conf-only |
61 | ||
d6570f85 | 62 | # ensure that the users learns about multiple versions too |
25b86db1 | 63 | testsuccessequal "Listing... |
d6570f85 MV |
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 | |
631800b1 DK |
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 | |
d6570f85 | 71 | |
6763aaec | 72 | # test format strings for machine parseable output |
25b86db1 DK |
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}" |