]> git.saurik.com Git - apt.git/blob - test/integration/test-apt-cli-show
tests: support spaces in path and TMPDIR
[apt.git] / test / integration / test-apt-cli-show
1 #!/bin/sh
2 set -e
3
4 TESTDIR="$(readlink -f "$(dirname "$0")")"
5 . "$TESTDIR/framework"
6
7 setupenvironment
8 configarchitecture 'i386' 'amd64'
9
10 DESCR='Some description
11 That has multiple lines'
12 insertpackage 'unstable' 'foo' 'all' '1.0' '' '' "$DESCR"
13 insertpackage 'unstable' 'bar' 'i386,amd64' '1' '' '' "$DESCR"
14 insertinstalledpackage 'foo' 'all' '1.0'
15
16 setupaptarchive
17
18 APTARCHIVE=$(readlink -f ./aptarchive)
19
20 # note that we do not display Description-md5 with the "apt" cmd
21 # and also show some additional fields that are calculated
22 testsuccessequal "Package: foo
23 Version: 1.0
24 Priority: optional
25 Section: other
26 Maintainer: Joe Sixpack <joe@example.org>
27 Installed-Size: 43.0 kB
28 Download-Size: unknown
29 APT-Manual-Installed: yes
30 APT-Sources: file:$APTARCHIVE unstable/main all Packages
31 Description: Some description
32 That has multiple lines
33 " apt show foo
34 testsuccessequal "Package: bar
35 Version: 1
36 Priority: optional
37 Section: other
38 Maintainer: Joe Sixpack <joe@example.org>
39 Installed-Size: 43.0 kB
40 Download-Size: unknown
41 APT-Sources: file:$APTARCHIVE unstable/main i386 Packages
42 Description: Some description
43 That has multiple lines
44 " apt show bar
45 testsuccessequal "Package: bar:amd64
46 Version: 1
47 Priority: optional
48 Section: other
49 Maintainer: Joe Sixpack <joe@example.org>
50 Installed-Size: 43.0 kB
51 Download-Size: unknown
52 APT-Sources: file:$APTARCHIVE unstable/main amd64 Packages
53 Description: Some description
54 That has multiple lines
55 " apt show bar:amd64
56
57 # this is the default, but disabled by the testcases
58 testsuccess apt show foo -o Apt::Cmd::Disable-Script-Warning=0
59 cp rootdir/tmp/testsuccess.output aptshow.output
60 testsuccess grep '^WARNING: ' aptshow.output
61
62 if [ "$(id -u)" != '0' ]; then
63 testsuccess apt install foo -s -o APT::Get::Show-User-Simulation-Note=1
64 cp rootdir/tmp/testsuccess.output aptshow.output
65 testsuccess grep '^NOTE: ' aptshow.output
66 fi