]> git.saurik.com Git - apt.git/blame_incremental - test/integration/test-bug-543966-downgrade-below-1000-pin
test: Get rid of debhelper rules.tiny example dep
[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 all 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 PKGPINPRIO=''
37 local REPPINPRIO=''
38 if [ "$1" != '*' ]; then
39 PKGPINPRIO=''
40 REPPINPRIO=' 500'
41 fi
42 writepin "$1" '99'
43 testsuccessequal "base-files:
44 Installed: 5.0.0-1
45 Candidate: 5.0.0-1
46 Version table:
47 *** 5.0.0-1 100
48 100 $STATUS
49 5.0.0 ${PKGPINPRIO:-99}
50 ${REPPINPRIO:- 99} file:${APTARCHIVE} unstable/main all Packages" aptcache policy base-files -o apt::pin=99
51
52 writepin "$1" '100'
53 testsuccessequal "base-files:
54 Installed: 5.0.0-1
55 Candidate: 5.0.0-1
56 Version table:
57 *** 5.0.0-1 100
58 100 $STATUS
59 5.0.0 ${PKGPINPRIO:-100}
60 ${REPPINPRIO:- 100} file:${APTARCHIVE} unstable/main all Packages" aptcache policy base-files -o apt::pin=100
61
62 writepin "$1" '999'
63 testsuccessequal "base-files:
64 Installed: 5.0.0-1
65 Candidate: 5.0.0-1
66 Version table:
67 *** 5.0.0-1 100
68 100 $STATUS
69 5.0.0 ${PKGPINPRIO:-999}
70 ${REPPINPRIO:- 999} file:${APTARCHIVE} unstable/main all Packages" aptcache policy base-files -o apt::pin=999
71
72 writepin "$1" '1000'
73 testsuccessequal "base-files:
74 Installed: 5.0.0-1
75 Candidate: 5.0.0
76 Version table:
77 *** 5.0.0-1 100
78 100 $STATUS
79 5.0.0 ${PKGPINPRIO:-1000}
80 ${REPPINPRIO:-1000} file:${APTARCHIVE} unstable/main all Packages" aptcache policy base-files -o apt::pin=1000
81}
82
83msgmsg 'Tests with generic-form pin'
84testpinning '*'
85msgmsg 'Tests with specific-form pin'
86testpinning 'base-files'
87msgmsg 'Tests with specific-form pin with glob'
88testpinning 'base-fil*'
89msgmsg 'Tests with specific-form pin with regex'
90testpinning '/^base-f[iI]les$/'