]> git.saurik.com Git - apt.git/blame_incremental - test/integration/test-apt-get-upgrade
add apt-key support for armored GPG key files (*.asc)
[apt.git] / test / integration / test-apt-get-upgrade
... / ...
CommitLineData
1#!/bin/sh
2set -e
3
4TESTDIR="$(readlink -f "$(dirname "$0")")"
5. "$TESTDIR/framework"
6
7setupenvironment
8configarchitecture "i386"
9
10# simple case
11insertpackage 'stable,installed' 'upgrade-simple' 'all' '1.0'
12insertpackage 'unstable' 'upgrade-simple' 'all' '2.0'
13
14# upgrade with a new dependency
15insertpackage 'stable,installed' 'upgrade-with-new-dep' 'all' '1.0'
16insertpackage 'unstable' 'upgrade-with-new-dep' 'all' '2.0' 'Depends: new-dep'
17insertpackage 'stable' 'new-dep' 'all' '1.0'
18
19# upgrade with conflict and a new pkg with higher priority than conflict
20insertpackage 'stable,installed' 'upgrade-with-conflict' 'all' '1.0'
21insertpackage 'unstable' 'upgrade-with-conflict' 'all' '2.0' 'Conflicts: conflicting-dep' 'standard'
22insertpackage 'stable,installed' 'conflicting-dep' 'all' '1.0'
23
24# upgrade with conflict and a new pkg with higher priority than conflict
25insertpackage 'stable,installed' 'init' 'all' '1'
26insertpackage 'unstable' 'init' 'all' '2' 'Pre-Depends: systemd | sysvinit'
27insertpackage 'unstable' 'systemd' 'all' '2' 'Conflicts: conflicting-dep'
28insertpackage 'unstable' 'sysvinit' 'all' '2'
29
30setupaptarchive
31
32# Test if normal upgrade works as expected
33UPGRADE='Reading package lists...
34Building dependency tree...
35Calculating upgrade...
36The following packages have been kept back:
37 init upgrade-with-conflict upgrade-with-new-dep
38The following packages will be upgraded:
39 upgrade-simple
401 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
41Inst upgrade-simple [1.0] (2.0 unstable [all])
42Conf upgrade-simple (2.0 unstable [all])'
43testsuccessequal "$UPGRADE" aptget upgrade -s
44testsuccessequal "$UPGRADE" apt upgrade -s --without-new-pkgs
45
46# Test if apt-get upgrade --with-new-pkgs works
47UPGRADENEW='Reading package lists...
48Building dependency tree...
49Calculating upgrade...
50The following NEW packages will be installed:
51 new-dep
52The following packages have been kept back:
53 init upgrade-with-conflict
54The following packages will be upgraded:
55 upgrade-simple upgrade-with-new-dep
562 upgraded, 1 newly installed, 0 to remove and 2 not upgraded.
57Inst new-dep (1.0 stable [all])
58Inst upgrade-simple [1.0] (2.0 unstable [all])
59Inst upgrade-with-new-dep [1.0] (2.0 unstable [all])
60Conf new-dep (1.0 stable [all])
61Conf upgrade-simple (2.0 unstable [all])
62Conf upgrade-with-new-dep (2.0 unstable [all])'
63testsuccessequal "$UPGRADENEW" aptget upgrade -s --with-new-pkgs
64testsuccessequal "$UPGRADENEW" apt upgrade -s
65
66# Test if apt-get dist-upgrade works
67testsuccessequal 'Reading package lists...
68Building dependency tree...
69Calculating upgrade...
70The following packages will be REMOVED:
71 conflicting-dep
72The following NEW packages will be installed:
73 new-dep systemd
74The following packages will be upgraded:
75 init upgrade-simple upgrade-with-conflict upgrade-with-new-dep
764 upgraded, 2 newly installed, 1 to remove and 0 not upgraded.
77Remv conflicting-dep [1.0]
78Inst systemd (2 unstable [all])
79Conf systemd (2 unstable [all])
80Inst init [1] (2 unstable [all])
81Inst upgrade-with-conflict [1.0] (2.0 unstable [all])
82Inst new-dep (1.0 stable [all])
83Inst upgrade-simple [1.0] (2.0 unstable [all])
84Inst upgrade-with-new-dep [1.0] (2.0 unstable [all])
85Conf init (2 unstable [all])
86Conf upgrade-with-conflict (2.0 unstable [all])
87Conf new-dep (1.0 stable [all])
88Conf upgrade-simple (2.0 unstable [all])
89Conf upgrade-with-new-dep (2.0 unstable [all])' aptget -s dist-upgrade
90
91msgmsg 'make systemd a non-choice in the or-group and try again'
92echo 'Package: systemd
93Pin: release unstable
94Pin-Priority: -1' > rootdir/etc/apt/preferences.d/nosystemd.pref
95
96testsuccessequal "$UPGRADE" aptget upgrade -s
97testsuccessequal "$UPGRADE" apt upgrade -s --without-new-pkgs
98
99UPGRADENEW='Reading package lists...
100Building dependency tree...
101Calculating upgrade...
102The following NEW packages will be installed:
103 new-dep sysvinit
104The following packages have been kept back:
105 upgrade-with-conflict
106The following packages will be upgraded:
107 init upgrade-simple upgrade-with-new-dep
1083 upgraded, 2 newly installed, 0 to remove and 1 not upgraded.
109Inst sysvinit (2 unstable [all])
110Conf sysvinit (2 unstable [all])
111Inst init [1] (2 unstable [all])
112Inst new-dep (1.0 stable [all])
113Inst upgrade-simple [1.0] (2.0 unstable [all])
114Inst upgrade-with-new-dep [1.0] (2.0 unstable [all])
115Conf init (2 unstable [all])
116Conf new-dep (1.0 stable [all])
117Conf upgrade-simple (2.0 unstable [all])
118Conf upgrade-with-new-dep (2.0 unstable [all])'
119testsuccessequal "$UPGRADENEW" aptget upgrade -s --with-new-pkgs
120testsuccessequal "$UPGRADENEW" apt upgrade -s
121
122testsuccessequal 'Reading package lists...
123Building dependency tree...
124Calculating upgrade...
125The following packages will be REMOVED:
126 conflicting-dep
127The following NEW packages will be installed:
128 new-dep sysvinit
129The following packages will be upgraded:
130 init upgrade-simple upgrade-with-conflict upgrade-with-new-dep
1314 upgraded, 2 newly installed, 1 to remove and 0 not upgraded.
132Remv conflicting-dep [1.0]
133Inst sysvinit (2 unstable [all])
134Conf sysvinit (2 unstable [all])
135Inst init [1] (2 unstable [all])
136Inst upgrade-with-conflict [1.0] (2.0 unstable [all])
137Inst new-dep (1.0 stable [all])
138Inst upgrade-simple [1.0] (2.0 unstable [all])
139Inst upgrade-with-new-dep [1.0] (2.0 unstable [all])
140Conf init (2 unstable [all])
141Conf upgrade-with-conflict (2.0 unstable [all])
142Conf new-dep (1.0 stable [all])
143Conf upgrade-simple (2.0 unstable [all])
144Conf upgrade-with-new-dep (2.0 unstable [all])' aptget -s dist-upgrade