]> git.saurik.com Git - apt.git/blame_incremental - test/integration/test-external-dependency-solver-protocol
implement apt-get source msg 'Please use: $vcs' for git
[apt.git] / test / integration / test-external-dependency-solver-protocol
... / ...
CommitLineData
1#!/bin/sh
2set -e
3
4TESTDIR=$(readlink -f $(dirname $0))
5. $TESTDIR/framework
6setupenvironment
7configarchitecture 'amd64' 'i386'
8
9insertinstalledpackage 'cool' 'all' '1'
10insertinstalledpackage 'stuff' 'all' '1'
11insertinstalledpackage 'somestuff' 'all' '1' 'Depends: cool, stuff'
12
13insertpackage 'unstable' 'cool' 'all' '2' 'Multi-Arch: foreign'
14insertpackage 'unstable' 'stuff' 'all' '2' 'Multi-Arch: foreign'
15insertpackage 'unstable' 'coolstuff' 'i386,amd64' '2' 'Depends: cool, stuff'
16insertpackage 'unstable' 'awesome' 'all' '2' 'Multi-Arch: foreign
17Conflicts: badstuff'
18insertpackage 'unstable' 'badstuff' 'all' '2' 'Multi-Arch: foreign
19Conflicts: awesome'
20insertpackage 'unstable' 'awesomecoolstuff' 'i386' '2' 'Depends: coolstuff, awesome'
21
22insertpackage 'experimental' 'cool' 'all' '3' 'Multi-Arch: foreign'
23insertpackage 'experimental' 'stuff' 'all' '3' 'Multi-Arch: foreign'
24insertpackage 'experimental' 'coolstuff' 'i386,amd64' '3' 'Depends: cool, stuff'
25
26setupaptarchive
27
28testfailure aptget install --solver dump coolstuff -s
29testsuccess grep ERR_NO_FILENAME rootdir/tmp/testfailure.output
30export APT_EDSP_DUMP_FILENAME="${TMPWORKINGDIRECTORY}/downloaded/dump.edsp"
31
32testfailureequal 'Reading package lists...
33Building dependency tree...
34Execute external solver...
35The solver encountered an error of type: ERR_JUST_DUMPING
36The following information might help you to understand what is wrong:
37I am too dumb, i can just dump!
38Please use one of my friends instead!
39
40E: External solver failed with: I am too dumb, i can just dump!' aptget install --solver dump coolstuff -s
41testsuccess test -s "$APT_EDSP_DUMP_FILENAME"
42rm -f "$APT_EDSP_DUMP_FILENAME"
43
44testsuccessequal 'Reading package lists...
45Building dependency tree...
46Execute external solver...
47The following NEW packages will be installed:
48 coolstuff
490 upgraded, 1 newly installed, 0 to remove and 2 not upgraded.
50Inst coolstuff (2 unstable [amd64])
51Conf coolstuff (2 unstable [amd64])' aptget install --solver apt coolstuff -s
52
53testsuccessequal 'Reading package lists...
54Building dependency tree...
55Execute external solver...
56The following NEW packages will be installed:
57 coolstuff
580 upgraded, 1 newly installed, 0 to remove and 2 not upgraded.
59Inst coolstuff (3 experimental [amd64])
60Conf coolstuff (3 experimental [amd64])' aptget install --solver apt coolstuff -s -t experimental
61
62testsuccessequal 'Reading package lists...
63Building dependency tree...
64Execute external solver...
65The following packages will be REMOVED:
66 somestuff
670 upgraded, 0 newly installed, 1 to remove and 2 not upgraded.
68Remv somestuff [1]' aptget autoremove --solver apt somestuff -s
69testsuccess aptmark auto cool stuff
70testsuccessequal 'Reading package lists...
71Building dependency tree...
72Reading state information...
73Execute external solver...
74The following packages will be REMOVED:
75 cool somestuff stuff
760 upgraded, 0 newly installed, 3 to remove and 0 not upgraded.
77Remv somestuff [1]
78Remv cool [1]
79Remv stuff [1]' aptget autoremove --solver apt somestuff -s
80
81testsuccessequal "Reading package lists...
82Building dependency tree...
83Reading state information...
84Execute external solver...
85The following package was automatically installed and is no longer required:
86 stuff
87Use 'apt-get autoremove' to remove it.
88The following packages will be REMOVED:
89 cool* somestuff*
900 upgraded, 0 newly installed, 2 to remove and 0 not upgraded.
91Purg somestuff [1]
92Purg cool [1]" aptget purge --solver apt cool -s
93
94testsuccess aptget install awesomecoolstuff:i386 -s
95testsuccess aptget install --solver apt awesomecoolstuff:i386 -s
96
97rm -f "$APT_EDSP_DUMP_FILENAME"
98testfailure aptget install --solver dump awesomecoolstuff:i386 -s
99testsuccess test -s "$APT_EDSP_DUMP_FILENAME"
100testequal 'Install: awesomecoolstuff:i386' grep :i386 "$APT_EDSP_DUMP_FILENAME"
101testempty grep -e ':amd64' -e 'Architecture: any' "$APT_EDSP_DUMP_FILENAME"
102
103testsuccess aptget dist-upgrade -s
104testsuccess aptget dist-upgrade -s --solver apt
105
106testsuccess aptget upgrade -s
107testsuccess aptget upgrade -s --solver apt
108
109testfailure aptget install awesome badstuff -s
110testfailure aptget install awesome badstuff -s --solver apt
111testsuccess grep 'ERR_UNSOLVABLE' rootdir/tmp/testfailure.output
112
113configarchitecture 'armel'
114msgtest 'Test direct calling is okay for' 'apt-internal-solver'
115cat "$APT_EDSP_DUMP_FILENAME" | aptinternalsolver -q=0 > solver.result 2>&1 || true
116if [ "$(tail -n2 solver.result | head -n1 )" = "Message: Done" ]; then
117 msgpass
118else
119 cat solver.result
120 msgfail
121fi
122rm -f "$APT_EDSP_DUMP_FILENAME"
123
124testfailure aptget install --solver apt awesomecoolstuff:i386 -s
125
126testsuccess aptinternalsolver scenario
127testsuccessequal 'Package: stuff
128Source: stuff
129Architecture: all
130Version: 1
131Source-Version: 1
132Installed: yes
133APT-ID: 2
134Priority: optional
135Section: other
136APT-Pin: 100
137APT-Candidate: yes
138' aptinternalsolver scenario stuff