]> git.saurik.com Git - apt.git/blame - test/integration/test-pin-non-existent-package
Defaults is a vector of Pin not of PkgPin
[apt.git] / test / integration / test-pin-non-existent-package
CommitLineData
5b7d1ee6
DK
1#!/bin/sh
2set -e
3
4TESTDIR=$(readlink -f $(dirname $0))
5. $TESTDIR/framework
6setupenvironment
7configarchitecture "i386"
8
9insertpackage 'unstable' 'apt' 'i386' '0.8.15'
10
11setupaptarchive
12
13testcandidate() {
14 msgtest "Test that the Candidate for $1 is" $2
15 test "$(aptcache policy $1 | grep '^ Candidate:')" = " Candidate: $2" && msgpass || msgfail
16}
17
18testcandidate apt '0.8.15'
19testequal 'N: Unable to locate package doesntexist' aptcache policy doesntexist -q=0
20testequal 'Reading package lists...
21Building dependency tree...
220 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget dist-upgrade
23
24echo 'Package: apt
25Pin: release a=unstable
26Pin-Priority: -1' > rootdir/etc/apt/preferences
27
28testcandidate apt '(none)'
29testequal 'N: Unable to locate package doesntexist' aptcache policy doesntexist -q=0
30testequal 'Reading package lists...
31Building dependency tree...
320 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget dist-upgrade
33
34echo '
35Package: doesntexist
36Pin: release a=unstable
37Pin-Priority: 1000' >> rootdir/etc/apt/preferences
38
39testcandidate apt '(none)'
40testequal 'N: Unable to locate package doesntexist' aptcache policy doesntexist -q=0
41
42testequal 'Reading package lists...
43Building dependency tree...
440 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget dist-upgrade