]> git.saurik.com Git - apt.git/blame - 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
1f6cf9e7
DK
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'
188a6fcf 11insertinstalledpackage 'somestuff' 'all' '1' 'Depends: cool, stuff'
1f6cf9e7
DK
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'
081c9d44
DK
16insertpackage 'unstable' 'awesome' 'all' '2' 'Multi-Arch: foreign
17Conflicts: badstuff'
18insertpackage 'unstable' 'badstuff' 'all' '2' 'Multi-Arch: foreign
19Conflicts: awesome'
1f6cf9e7
DK
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
92b2e38d
DK
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
25b86db1 32testfailureequal 'Reading package lists...
1f6cf9e7
DK
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
92b2e38d
DK
41testsuccess test -s "$APT_EDSP_DUMP_FILENAME"
42rm -f "$APT_EDSP_DUMP_FILENAME"
1f6cf9e7 43
188a6fcf
DK
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
25b86db1 53testsuccessequal 'Reading package lists...
1f6cf9e7
DK
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])
188a6fcf 60Conf coolstuff (3 experimental [amd64])' aptget install --solver apt coolstuff -s -t experimental
1f6cf9e7 61
25b86db1 62testsuccessequal 'Reading package lists...
081c9d44
DK
63Building dependency tree...
64Execute external solver...
65The following packages will be REMOVED:
188a6fcf
DK
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
081c9d44 93
1f6cf9e7
DK
94testsuccess aptget install awesomecoolstuff:i386 -s
95testsuccess aptget install --solver apt awesomecoolstuff:i386 -s
96
92b2e38d 97rm -f "$APT_EDSP_DUMP_FILENAME"
1f6cf9e7 98testfailure aptget install --solver dump awesomecoolstuff:i386 -s
92b2e38d
DK
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"
1f6cf9e7 102
172947cd
DK
103testsuccess aptget dist-upgrade -s
104testsuccess aptget dist-upgrade -s --solver apt
105
106testsuccess aptget upgrade -s
107testsuccess aptget upgrade -s --solver apt
108
081c9d44
DK
109testfailure aptget install awesome badstuff -s
110testfailure aptget install awesome badstuff -s --solver apt
111testsuccess grep 'ERR_UNSOLVABLE' rootdir/tmp/testfailure.output
112
1f6cf9e7
DK
113configarchitecture 'armel'
114msgtest 'Test direct calling is okay for' 'apt-internal-solver'
92b2e38d 115cat "$APT_EDSP_DUMP_FILENAME" | aptinternalsolver -q=0 > solver.result 2>&1 || true
1f6cf9e7
DK
116if [ "$(tail -n2 solver.result | head -n1 )" = "Message: Done" ]; then
117 msgpass
118else
119 cat solver.result
120 msgfail
121fi
92b2e38d 122rm -f "$APT_EDSP_DUMP_FILENAME"
1f6cf9e7
DK
123
124testfailure aptget install --solver apt awesomecoolstuff:i386 -s
081c9d44
DK
125
126testsuccess aptinternalsolver scenario
25b86db1 127testsuccessequal 'Package: stuff
081c9d44
DK
128Source: stuff
129Architecture: all
130Version: 1
eed4639e 131Source-Version: 1
081c9d44
DK
132Installed: yes
133APT-ID: 2
134Priority: optional
135Section: other
136APT-Pin: 100
137APT-Candidate: yes
138' aptinternalsolver scenario stuff