]>
Commit | Line | Data |
---|---|---|
374f8492 DK |
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 | |
081c9d44 | 23 | testempty aptcache showauto |
374f8492 DK |
24 | testequal 'bar |
25 | dpkg | |
26 | foo' aptmark showmanual | |
27 | testequal 'bar | |
28 | foo' aptmark showmanual bar foo uninstalled | |
29 | } | |
081c9d44 | 30 | testfooisauto() { |
374f8492 | 31 | testequal 'foo' aptmark showauto |
081c9d44 | 32 | testequal 'foo' aptcache showauto |
374f8492 | 33 | testequal 'foo' aptmark showauto foo |
081c9d44 | 34 | testequal 'foo' aptcache showauto foo |
374f8492 DK |
35 | testequal 'bar |
36 | dpkg' aptmark showmanual | |
37 | testequal 'bar' aptmark showmanual bar | |
081c9d44 DK |
38 | } |
39 | testmarkonpkgasauto() { | |
40 | testsuccess $1 $2 foo | |
41 | testfooisauto | |
42 | testsuccess $1 $2 foo | |
43 | testfooisauto | |
374f8492 | 44 | |
081c9d44 DK |
45 | testsuccess $1 $3 foo |
46 | testnoautopkg | |
47 | testsuccess $1 $3 foo | |
374f8492 DK |
48 | testnoautopkg |
49 | } | |
50 | ||
51 | testequal 'E: No packages found' aptmark auto | |
52 | testequal 'E: No packages found' aptmark manual | |
53 | ||
54 | testnoautopkg | |
081c9d44 DK |
55 | testmarkonpkgasauto 'aptmark' 'auto' 'manual' |
56 | testmarkonpkgasauto 'aptmark' 'markauto' 'unmarkauto' | |
57 | testmarkonpkgasauto 'aptget' 'markauto' 'unmarkauto' | |
374f8492 DK |
58 | |
59 | testnoholdpkg() { | |
60 | testempty aptmark showhold | |
61 | testempty aptmark showholds # typical "typo" | |
62 | testempty aptmark showhold dpkg | |
63 | testempty aptmark showholds dpkg | |
64 | } | |
081c9d44 | 65 | testpkgonhold() { |
374f8492 DK |
66 | testequal "$1" aptmark showhold |
67 | testequal "$1" aptmark showholds | |
081c9d44 DK |
68 | testequal "$1" aptmark showhold $1 |
69 | testequal "$1" aptmark showholds $1 | |
70 | } | |
71 | testmarkonepkgashold() { | |
72 | testsuccess aptmark hold $1 | |
73 | testpkgonhold $1 | |
74 | testsuccess aptmark hold $1 | |
75 | testpkgonhold $1 | |
76 | testsuccess aptmark unhold $1 | |
77 | testnoholdpkg | |
374f8492 DK |
78 | testsuccess aptmark unhold $1 |
79 | testnoholdpkg | |
80 | } | |
81 | ||
82 | testequal 'E: No packages found' aptmark hold | |
83 | testequal 'E: No packages found' aptmark unhold | |
84 | ||
85 | testnoholdpkg | |
86 | testmarkonepkgashold 'foo' | |
87 | testmarkonepkgashold 'bar' | |
1d838084 DK |
88 | |
89 | msgtest 'dpkg supports --merge-avail via' 'stdin' | |
90 | if dpkg --merge-avail - < /dev/null >/dev/null 2>&1; then | |
91 | msgpass | |
92 | else | |
93 | msgskip 'dpkg version too old' | |
94 | exit 0 | |
95 | fi | |
96 | ||
374f8492 DK |
97 | testmarkonepkgashold 'uninstalled' |
98 | testmarkonepkgashold 'uninstalled-native' | |
99 | ||
100 | testequal 'uninstalled set on hold.' aptmark hold uninstalled | |
101 | testequal 'uninstalled-native set on hold.' aptmark hold uninstalled-native |