]> git.saurik.com Git - apt.git/blame_incremental - test/integration/test-apt-mark
add --sha512 option + documentation for apt-ftparchive
[apt.git] / test / integration / test-apt-mark
... / ...
CommitLineData
1#!/bin/sh
2set -e
3
4TESTDIR=$(readlink -f $(dirname $0))
5. $TESTDIR/framework
6setupenvironment
7configarchitecture 'amd64' 'i386'
8
9insertpackage 'unstable' 'bar' 'amd64,i386' '1'
10insertpackage 'unstable' 'uninstalled' 'all' '1'
11insertpackage 'unstable' 'uninstalled-native' 'amd64' '1'
12
13insertinstalledpackage 'foo' 'all' '1'
14insertinstalledpackage 'bar' 'amd64' '1'
15
16setupaptarchive
17
18# dpkg is "installed" by our test framework
19testdpkginstalled dpkg
20
21testnoautopkg() {
22 testempty aptmark showauto
23 testempty aptcache showauto
24 testsuccessequal 'bar
25dpkg
26foo' aptmark showmanual
27 testsuccessequal 'bar
28foo' aptmark showmanual bar foo uninstalled
29}
30testfooisauto() {
31 testsuccessequal 'foo' aptmark showauto
32 testsuccessequal 'foo' aptcache showauto
33 testsuccessequal 'foo' aptmark showauto foo
34 testsuccessequal 'foo' aptcache showauto foo
35 testsuccessequal 'bar
36dpkg' aptmark showmanual
37 testsuccessequal 'bar' aptmark showmanual bar
38}
39testmarkonpkgasauto() {
40 testsuccess $1 $2 foo
41 testfooisauto
42 testsuccess $1 $2 foo
43 testfooisauto
44
45 testsuccess $1 $3 foo
46 testnoautopkg
47 testsuccess $1 $3 foo
48 testnoautopkg
49}
50
51testfailureequal 'E: No packages found' aptmark auto
52testfailureequal 'E: No packages found' aptmark manual
53
54testnoautopkg
55testmarkonpkgasauto 'aptmark' 'auto' 'manual'
56testmarkonpkgasauto 'aptmark' 'markauto' 'unmarkauto'
57testmarkonpkgasauto 'aptget' 'markauto' 'unmarkauto'
58
59testnoholdpkg() {
60 testempty aptmark showhold
61 testempty aptmark showholds # typical "typo"
62 testempty aptmark showhold dpkg
63 testempty aptmark showholds dpkg
64}
65testpkgonhold() {
66 testsuccessequal "$1" aptmark showhold
67 testsuccessequal "$1" aptmark showholds
68 testsuccessequal "$1" aptmark showhold $1
69 testsuccessequal "$1" aptmark showholds $1
70}
71testmarkonepkgashold() {
72 testsuccess aptmark hold $1
73 testpkgonhold $1
74 testsuccess aptmark hold $1
75 testpkgonhold $1
76 testsuccess aptmark unhold $1
77 testnoholdpkg
78 testsuccess aptmark unhold $1
79 testnoholdpkg
80}
81
82testfailureequal 'E: No packages found' aptmark hold
83testfailureequal 'E: No packages found' aptmark unhold
84
85testnoholdpkg
86testmarkonepkgashold 'foo'
87testmarkonepkgashold 'bar'
88
89msgtest 'dpkg supports --merge-avail via' 'stdin'
90if dpkg --merge-avail - < /dev/null >/dev/null 2>&1; then
91 msgpass
92else
93 msgskip 'dpkg version too old'
94 exit 0
95fi
96
97testmarkonepkgashold 'uninstalled'
98testmarkonepkgashold 'uninstalled-native'
99
100testsuccessequal 'uninstalled set on hold.' aptmark hold uninstalled
101testsuccessequal 'uninstalled-native set on hold.' aptmark hold uninstalled-native