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