]> git.saurik.com Git - apt.git/blame_incremental - test/integration/test-bug-543966-downgrade-below-1000-pin
handle site-changing redirects as mirror changes
[apt.git] / test / integration / test-bug-543966-downgrade-below-1000-pin
... / ...
CommitLineData
1#!/bin/sh
2set -e
3
4TESTDIR=$(readlink -f $(dirname $0))
5. $TESTDIR/framework
6
7setupenvironment
8configarchitecture 'i386'
9
10insertpackage 'unstable' 'base-files' 'all' '5.0.0'
11insertinstalledpackage 'base-files' 'all' '5.0.0-1'
12
13setupaptarchive
14
15STATUS=$(readlink -f rootdir/var/lib/dpkg/status)
16APTARCHIVE="$(readlink -f aptarchive)"
17
18testsuccessequal "base-files:
19 Installed: 5.0.0-1
20 Candidate: 5.0.0-1
21 Version table:
22 *** 5.0.0-1 100
23 100 $STATUS
24 5.0.0 500
25 500 file:${APTARCHIVE} unstable/main i386 Packages" aptcache policy base-files -o apt::pin=0
26
27writepin() {
28 echo "Package: $1
29Pin: release a=unstable
30Pin-Priority: $2" > rootdir/etc/apt/preferences
31}
32
33
34
35testpinning() {
36 local PKGPIN=''
37 local PKGPINPRIO=''
38 local REPPINPRIO=''
39 if [ "$1" != '*' ]; then
40 PKGPINPRIO=''
41 REPPINPRIO=' 500'
42 PKGPIN='Package pin: 5.0.0
43 '
44 fi
45 writepin "$1" '99'
46 testsuccessequal "base-files:
47 Installed: 5.0.0-1
48 Candidate: 5.0.0-1
49 ${PKGPIN}Version table:
50 *** 5.0.0-1 100
51 100 $STATUS
52 5.0.0 ${PKGPINPRIO:-99}
53 ${REPPINPRIO:- 99} file:${APTARCHIVE} unstable/main i386 Packages" aptcache policy base-files -o apt::pin=99
54
55 writepin "$1" '100'
56 testsuccessequal "base-files:
57 Installed: 5.0.0-1
58 Candidate: 5.0.0-1
59 ${PKGPIN}Version table:
60 *** 5.0.0-1 100
61 100 $STATUS
62 5.0.0 ${PKGPINPRIO:-100}
63 ${REPPINPRIO:- 100} file:${APTARCHIVE} unstable/main i386 Packages" aptcache policy base-files -o apt::pin=100
64
65 writepin "$1" '999'
66 testsuccessequal "base-files:
67 Installed: 5.0.0-1
68 Candidate: 5.0.0-1
69 ${PKGPIN}Version table:
70 *** 5.0.0-1 100
71 100 $STATUS
72 5.0.0 ${PKGPINPRIO:-999}
73 ${REPPINPRIO:- 999} file:${APTARCHIVE} unstable/main i386 Packages" aptcache policy base-files -o apt::pin=999
74
75 writepin "$1" '1000'
76 testsuccessequal "base-files:
77 Installed: 5.0.0-1
78 Candidate: 5.0.0
79 ${PKGPIN}Version table:
80 *** 5.0.0-1 100
81 100 $STATUS
82 5.0.0 ${PKGPINPRIO:-1000}
83 ${REPPINPRIO:-1000} file:${APTARCHIVE} unstable/main i386 Packages" aptcache policy base-files -o apt::pin=1000
84}
85
86msgmsg 'Tests with generic-form pin'
87testpinning '*'
88msgmsg 'Tests with specific-form pin'
89testpinning 'base-files'
90msgmsg 'Tests with specific-form pin with glob'
91testpinning 'base-fil*'
92msgmsg 'Tests with specific-form pin with regex'
93testpinning '/^base-f[iI]les$/'