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