]> git.saurik.com Git - apt.git/blame - test/integration/test-apt-get-upgrade
reset HOME, USER(NAME), TMPDIR & SHELL in DropPrivileges
[apt.git] / test / integration / test-apt-get-upgrade
CommitLineData
08d3d7e9
MV
1#!/bin/sh
2set -e
3
3abb6a6a
DK
4TESTDIR="$(readlink -f "$(dirname "$0")")"
5. "$TESTDIR/framework"
08d3d7e9
MV
6
7setupenvironment
8configarchitecture "i386"
9
60b3bf0c 10# simple case
10e100e5 11insertpackage 'stable,installed' 'upgrade-simple' 'all' '1.0'
60b3bf0c 12insertpackage 'unstable' 'upgrade-simple' 'all' '2.0'
08d3d7e9 13
60b3bf0c 14# upgrade with a new dependency
10e100e5 15insertpackage 'stable,installed' 'upgrade-with-new-dep' 'all' '1.0'
60b3bf0c
MV
16insertpackage 'unstable' 'upgrade-with-new-dep' 'all' '2.0' 'Depends: new-dep'
17insertpackage 'stable' 'new-dep' 'all' '1.0'
08d3d7e9 18
60b3bf0c 19# upgrade with conflict and a new pkg with higher priority than conflict
10e100e5 20insertpackage 'stable,installed' 'upgrade-with-conflict' 'all' '1.0'
60b3bf0c 21insertpackage 'unstable' 'upgrade-with-conflict' 'all' '2.0' 'Conflicts: conflicting-dep' 'standard'
10e100e5 22insertpackage 'stable,installed' 'conflicting-dep' 'all' '1.0'
08d3d7e9 23
f51401eb
DK
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
08d3d7e9
MV
30setupaptarchive
31
d029b718 32# Test if normal upgrade works as expected
f51401eb 33UPGRADE='Reading package lists...
08d3d7e9 34Building dependency tree...
2a884c61 35Calculating upgrade...
08d3d7e9 36The following packages have been kept back:
f51401eb 37 init upgrade-with-conflict upgrade-with-new-dep
08d3d7e9 38The following packages will be upgraded:
60b3bf0c 39 upgrade-simple
f51401eb 401 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
60b3bf0c 41Inst upgrade-simple [1.0] (2.0 unstable [all])
f51401eb
DK
42Conf upgrade-simple (2.0 unstable [all])'
43testsuccessequal "$UPGRADE" aptget upgrade -s
44testsuccessequal "$UPGRADE" apt upgrade -s --without-new-pkgs
08d3d7e9 45
d029b718 46# Test if apt-get upgrade --with-new-pkgs works
f51401eb 47UPGRADENEW='Reading package lists...
08d3d7e9 48Building dependency tree...
2a884c61 49Calculating upgrade...
08d3d7e9 50The following NEW packages will be installed:
60b3bf0c 51 new-dep
08d3d7e9 52The following packages have been kept back:
f51401eb 53 init upgrade-with-conflict
08d3d7e9 54The following packages will be upgraded:
60b3bf0c 55 upgrade-simple upgrade-with-new-dep
f51401eb 562 upgraded, 1 newly installed, 0 to remove and 2 not upgraded.
60b3bf0c
MV
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])
f51401eb
DK
62Conf upgrade-with-new-dep (2.0 unstable [all])'
63testsuccessequal "$UPGRADENEW" aptget upgrade -s --with-new-pkgs
64testsuccessequal "$UPGRADENEW" apt upgrade -s
08d3d7e9 65
d029b718 66# Test if apt-get dist-upgrade works
25b86db1 67testsuccessequal 'Reading package lists...
08d3d7e9 68Building dependency tree...
2a884c61 69Calculating upgrade...
60b3bf0c
MV
70The following packages will be REMOVED:
71 conflicting-dep
08d3d7e9 72The following NEW packages will be installed:
f51401eb 73 new-dep systemd
08d3d7e9 74The following packages will be upgraded:
f51401eb
DK
75 init upgrade-simple upgrade-with-conflict upgrade-with-new-dep
764 upgraded, 2 newly installed, 1 to remove and 0 not upgraded.
60b3bf0c 77Remv conflicting-dep [1.0]
f51401eb
DK
78Inst systemd (2 unstable [all])
79Conf systemd (2 unstable [all])
80Inst init [1] (2 unstable [all])
60b3bf0c
MV
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])
f51401eb 85Conf init (2 unstable [all])
60b3bf0c
MV
86Conf upgrade-with-conflict (2.0 unstable [all])
87Conf new-dep (1.0 stable [all])
88Conf upgrade-simple (2.0 unstable [all])
d029b718 89Conf upgrade-with-new-dep (2.0 unstable [all])' aptget -s dist-upgrade
08d3d7e9 90
f51401eb
DK
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