]>
Commit | Line | Data |
---|---|---|
00c6e1a3 MV |
1 | #!/bin/sh |
2 | set -e | |
3 | ||
4 | TESTDIR=$(readlink -f $(dirname $0)) | |
5 | . $TESTDIR/framework | |
6 | setupenvironment | |
7 | configarchitecture "i386" | |
8 | ||
a02f0c29 | 9 | insertpackage 'unstable' 'rapt' 'i386' '0.8.15' |
00c6e1a3 MV |
10 | insertpackage 'unstable' 'arch' 'i386' '1.0' |
11 | ||
12 | setupaptarchive | |
13 | ||
14 | testcandidate() { | |
15 | msgtest "Test that the Candidate for $1 is" $2 | |
16 | if [ "$(aptcache policy $1 | grep '^ Candidate:')" = " Candidate: $2" ]; then | |
17 | msgpass | |
18 | else | |
19 | echo | |
20 | aptcache policy $1 | |
21 | msgfail | |
22 | fi | |
23 | } | |
24 | ||
a02f0c29 | 25 | testcandidate rapt '0.8.15' |
00c6e1a3 MV |
26 | testequal 'N: Unable to locate package doesntexist' aptcache policy doesntexist -q=0 |
27 | testequal 'Reading package lists... | |
28 | Building dependency tree... | |
2a884c61 | 29 | Calculating upgrade... |
a02f0c29 | 30 | 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget dist-upgrade --trivial-only |
00c6e1a3 | 31 | |
a02f0c29 | 32 | echo 'Package: rapt |
00c6e1a3 MV |
33 | Pin: release a=unstable |
34 | Pin-Priority: -1' > rootdir/etc/apt/preferences | |
35 | ||
a02f0c29 | 36 | testcandidate rapt '(none)' |
00c6e1a3 MV |
37 | testequal 'N: Unable to locate package doesntexist' aptcache policy doesntexist -q=0 |
38 | testequal 'Reading package lists... | |
39 | Building dependency tree... | |
2a884c61 | 40 | Calculating upgrade... |
a02f0c29 | 41 | 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget dist-upgrade --trivial-only |
00c6e1a3 MV |
42 | |
43 | echo ' | |
44 | Package: doesntexist | |
45 | Pin: release a=unstable | |
46 | Pin-Priority: 1000' >> rootdir/etc/apt/preferences | |
47 | ||
a02f0c29 | 48 | testcandidate rapt '(none)' |
00c6e1a3 MV |
49 | |
50 | echo ' | |
a02f0c29 | 51 | Package: rapt |
00c6e1a3 MV |
52 | Pin: release a=unstable |
53 | Pin-Priority: 1000' >> rootdir/etc/apt/preferences | |
54 | ||
a02f0c29 | 55 | testcandidate rapt '(none)' |
00c6e1a3 MV |
56 | testequal 'N: Unable to locate package doesntexist' aptcache policy doesntexist -q=0 |
57 | ||
58 | testequal 'Reading package lists... | |
59 | Building dependency tree... | |
2a884c61 | 60 | Calculating upgrade... |
a02f0c29 | 61 | 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget dist-upgrade --trivial-only |
00c6e1a3 MV |
62 | |
63 | echo 'Package: arch:amd64 | |
64 | Pin: release a=unstable | |
65 | Pin-Priority: -1' > rootdir/etc/apt/preferences | |
66 | ||
67 | testcandidate arch '1.0' | |
68 | ||
69 | echo ' | |
70 | Package: arch:i386 | |
71 | Pin: release a=unstable | |
72 | Pin-Priority: -1' >> rootdir/etc/apt/preferences | |
73 | ||
74 | testcandidate arch '(none)' | |
75 |