]> git.saurik.com Git - apt.git/blame_incremental - test/integration/test-pin-non-existent-package
Use _apt as our unprivileged user name
[apt.git] / test / integration / test-pin-non-existent-package
... / ...
CommitLineData
1#!/bin/sh
2set -e
3
4TESTDIR=$(readlink -f $(dirname $0))
5. $TESTDIR/framework
6setupenvironment
7configarchitecture "i386"
8
9insertpackage 'unstable' 'rapt' 'i386' '0.8.15'
10insertpackage 'unstable' 'arch' 'i386' '1.0'
11
12setupaptarchive
13
14testcandidate() {
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
25testcandidate rapt '0.8.15'
26testequal 'N: Unable to locate package doesntexist' aptcache policy doesntexist -q=0
27testequal 'Reading package lists...
28Building dependency tree...
290 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget dist-upgrade --trivial-only
30
31echo 'Package: rapt
32Pin: release a=unstable
33Pin-Priority: -1' > rootdir/etc/apt/preferences
34
35testcandidate rapt '(none)'
36testequal 'N: Unable to locate package doesntexist' aptcache policy doesntexist -q=0
37testequal 'Reading package lists...
38Building dependency tree...
390 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget dist-upgrade --trivial-only
40
41echo '
42Package: doesntexist
43Pin: release a=unstable
44Pin-Priority: 1000' >> rootdir/etc/apt/preferences
45
46testcandidate rapt '(none)'
47
48echo '
49Package: rapt
50Pin: release a=unstable
51Pin-Priority: 1000' >> rootdir/etc/apt/preferences
52
53testcandidate rapt '(none)'
54testequal 'N: Unable to locate package doesntexist' aptcache policy doesntexist -q=0
55
56testequal 'Reading package lists...
57Building dependency tree...
580 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget dist-upgrade --trivial-only
59
60echo 'Package: arch:amd64
61Pin: release a=unstable
62Pin-Priority: -1' > rootdir/etc/apt/preferences
63
64testcandidate arch '1.0'
65
66echo '
67Package: arch:i386
68Pin: release a=unstable
69Pin-Priority: -1' >> rootdir/etc/apt/preferences
70
71testcandidate arch '(none)'
72