]> git.saurik.com Git - apt.git/blob - test/integration/test-apt-mark
69e0f933d1463e81e933263fc553137abdb8615a
[apt.git] / test / integration / test-apt-mark
1 #!/bin/sh
2 set -e
3
4 TESTDIR=$(readlink -f $(dirname $0))
5 . $TESTDIR/framework
6 setupenvironment
7 configarchitecture 'amd64' 'i386'
8
9 insertpackage 'unstable' 'bar' 'amd64,i386' '1'
10 insertpackage 'unstable' 'uninstalled' 'all' '1'
11 insertpackage 'unstable' 'uninstalled-native' 'amd64' '1'
12
13 insertinstalledpackage 'foo' 'all' '1'
14 insertinstalledpackage 'bar' 'amd64' '1'
15
16 setupaptarchive
17
18 # dpkg is "installed" by our test framework
19 testdpkginstalled dpkg
20
21 testnoautopkg() {
22 testempty aptmark showauto
23 testequal 'bar
24 dpkg
25 foo' aptmark showmanual
26 testequal 'bar
27 foo' aptmark showmanual bar foo uninstalled
28 }
29 testmarkonpkgasauto() {
30 testsuccess aptmark $1 foo
31 testequal 'foo' aptmark showauto
32 testequal 'foo' aptmark showauto foo
33 testequal 'bar
34 dpkg' aptmark showmanual
35 testequal 'bar' aptmark showmanual bar
36
37 testsuccess aptmark $2 foo
38 testnoautopkg
39 }
40
41 testequal 'E: No packages found' aptmark auto
42 testequal 'E: No packages found' aptmark manual
43
44 testnoautopkg
45 testmarkonpkgasauto 'auto' 'manual'
46 testmarkonpkgasauto 'markauto' 'unmarkauto'
47
48 testnoholdpkg() {
49 testempty aptmark showhold
50 testempty aptmark showholds # typical "typo"
51 testempty aptmark showhold dpkg
52 testempty aptmark showholds dpkg
53 }
54 testmarkonepkgashold() {
55 testsuccess aptmark hold $1
56 testequal "$1" aptmark showhold
57 testequal "$1" aptmark showholds
58 testsuccess aptmark unhold $1
59 testnoholdpkg
60 }
61
62 testequal 'E: No packages found' aptmark hold
63 testequal 'E: No packages found' aptmark unhold
64
65 testnoholdpkg
66 testmarkonepkgashold 'foo'
67 testmarkonepkgashold 'bar'
68 testmarkonepkgashold 'uninstalled'
69 testmarkonepkgashold 'uninstalled-native'
70
71 testequal 'uninstalled set on hold.' aptmark hold uninstalled
72 testequal 'uninstalled-native set on hold.' aptmark hold uninstalled-native