]> git.saurik.com Git - apt.git/blame_incremental - test/integration/test-allow
keep Release.gpg on untrusted to trusted IMS-Hit
[apt.git] / test / integration / test-allow
... / ...
CommitLineData
1#!/bin/sh
2#
3# Test for --allow-remove-essential and friends replacing --force-yes
4#
5set -e
6
7TESTDIR="$(readlink -f "$(dirname $0)")"
8. "$TESTDIR/framework"
9setupenvironment
10configarchitecture 'amd64'
11
12insertpackage 'unstable' 'downgrade' 'all' '1'
13insertinstalledpackage 'downgrade' 'all' '2'
14
15insertpackage 'unstable' 'hold' 'all' '2'
16insertinstalledpackage 'hold' 'all' '1'
17
18insertinstalledpackage 'essential' 'all' '1' 'Essential: yes'
19
20setupaptarchive
21
22testsuccess aptmark hold hold
23
24# Test --allow-remove--essential
25
26testfailureequal 'Reading package lists...
27Building dependency tree...
28The following packages will be REMOVED:
29 essential
30WARNING: The following essential packages will be removed.
31This should NOT be done unless you know exactly what you are doing!
32 essential
330 upgraded, 0 newly installed, 1 to remove and 1 not upgraded.
34E: Essential packages were removed and -y was used without --allow-remove-essential.' aptget remove essential -y -s
35
36testsuccessequal 'Reading package lists...
37Building dependency tree...
38The following packages will be REMOVED:
39 essential
40WARNING: The following essential packages will be removed.
41This should NOT be done unless you know exactly what you are doing!
42 essential
430 upgraded, 0 newly installed, 1 to remove and 1 not upgraded.
44Remv essential [1]' aptget remove essential -y --allow-remove-essential -s
45
46# Test --allow-change-held-packages (should not influence dist-upgrade, but an install)
47
48testsuccessequal 'Reading package lists...
49Building dependency tree...
50Calculating upgrade...
51The following packages have been kept back:
52 hold
530 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.' aptget dist-upgrade --allow-change-held-packages -s
54
55testfailureequal 'Reading package lists...
56Building dependency tree...
57The following held packages will be changed:
58 hold
59The following packages will be upgraded:
60 hold
611 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
62E: Held packages were changed and -y was used without --allow-change-held-packages.' aptget install hold -y -s
63
64testfailureequal 'Reading package lists...
65Building dependency tree...
66The following held packages will be changed:
67 hold
68The following packages will be upgraded:
69 hold
701 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
71E: Held packages were changed and -y was used without --allow-change-held-packages.' aptget install hold -y -s
72
73testsuccessequal 'Reading package lists...
74Building dependency tree...
75The following held packages will be changed:
76 hold
77The following packages will be upgraded:
78 hold
791 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
80Inst hold [1] (2 unstable [all])
81Conf hold (2 unstable [all])' aptget install hold -y -s --allow-change-held-packages
82
83# Test --allow-downgrades
84
85testfailureequal 'Reading package lists...
86Building dependency tree...
87The following packages will be DOWNGRADED:
88 downgrade
890 upgraded, 0 newly installed, 1 downgraded, 0 to remove and 1 not upgraded.
90E: Packages were downgraded and -y was used without --allow-downgrades.' aptget install downgrade=1 -y -s
91
92testsuccessequal 'Reading package lists...
93Building dependency tree...
94The following packages will be DOWNGRADED:
95 downgrade
960 upgraded, 0 newly installed, 1 downgraded, 0 to remove and 1 not upgraded.
97Inst downgrade [2] (1 unstable [all])
98Conf downgrade (1 unstable [all])' aptget install downgrade=1 --allow-downgrades -y -s