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