]> git.saurik.com Git - apt.git/blame - test/integration/test-external-dependency-solver-protocol
remove incorrect optimization branches
[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'
11
12insertpackage 'unstable' 'cool' 'all' '2' 'Multi-Arch: foreign'
13insertpackage 'unstable' 'stuff' 'all' '2' 'Multi-Arch: foreign'
14insertpackage 'unstable' 'coolstuff' 'i386,amd64' '2' 'Depends: cool, stuff'
081c9d44
DK
15insertpackage 'unstable' 'awesome' 'all' '2' 'Multi-Arch: foreign
16Conflicts: badstuff'
17insertpackage 'unstable' 'badstuff' 'all' '2' 'Multi-Arch: foreign
18Conflicts: awesome'
1f6cf9e7
DK
19insertpackage 'unstable' 'awesomecoolstuff' 'i386' '2' 'Depends: coolstuff, awesome'
20
21insertpackage 'experimental' 'cool' 'all' '3' 'Multi-Arch: foreign'
22insertpackage 'experimental' 'stuff' 'all' '3' 'Multi-Arch: foreign'
23insertpackage 'experimental' 'coolstuff' 'i386,amd64' '3' 'Depends: cool, stuff'
24
25setupaptarchive
26
92b2e38d
DK
27testfailure aptget install --solver dump coolstuff -s
28testsuccess grep ERR_NO_FILENAME rootdir/tmp/testfailure.output
29export APT_EDSP_DUMP_FILENAME="${TMPWORKINGDIRECTORY}/downloaded/dump.edsp"
30
25b86db1 31testfailureequal 'Reading package lists...
1f6cf9e7
DK
32Building dependency tree...
33Execute external solver...
34The solver encountered an error of type: ERR_JUST_DUMPING
35The following information might help you to understand what is wrong:
36I am too dumb, i can just dump!
37Please use one of my friends instead!
38
39E: External solver failed with: I am too dumb, i can just dump!' aptget install --solver dump coolstuff -s
92b2e38d
DK
40testsuccess test -s "$APT_EDSP_DUMP_FILENAME"
41rm -f "$APT_EDSP_DUMP_FILENAME"
1f6cf9e7
DK
42
43#FIXME: this should be unstable, but we don't support pinning yet
25b86db1 44testsuccessequal 'Reading package lists...
1f6cf9e7
DK
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 (3 experimental [amd64])
51Conf coolstuff (3 experimental [amd64])' aptget install --solver apt coolstuff -s
52
25b86db1 53testsuccessequal 'Reading package lists...
081c9d44
DK
54Building dependency tree...
55Execute external solver...
56The following packages will be REMOVED:
57 cool*
580 upgraded, 0 newly installed, 1 to remove and 1 not upgraded.
59Purg cool [1]' aptget purge --solver apt cool -s
60
1f6cf9e7
DK
61testsuccess aptget install awesomecoolstuff:i386 -s
62testsuccess aptget install --solver apt awesomecoolstuff:i386 -s
63
92b2e38d 64rm -f "$APT_EDSP_DUMP_FILENAME"
1f6cf9e7 65testfailure aptget install --solver dump awesomecoolstuff:i386 -s
92b2e38d
DK
66testsuccess test -s "$APT_EDSP_DUMP_FILENAME"
67testequal 'Install: awesomecoolstuff:i386' grep :i386 "$APT_EDSP_DUMP_FILENAME"
68testempty grep -e ':amd64' -e 'Architecture: any' "$APT_EDSP_DUMP_FILENAME"
1f6cf9e7 69
172947cd
DK
70testsuccess aptget dist-upgrade -s
71testsuccess aptget dist-upgrade -s --solver apt
72
73testsuccess aptget upgrade -s
74testsuccess aptget upgrade -s --solver apt
75
081c9d44
DK
76testfailure aptget install awesome badstuff -s
77testfailure aptget install awesome badstuff -s --solver apt
78testsuccess grep 'ERR_UNSOLVABLE' rootdir/tmp/testfailure.output
79
1f6cf9e7
DK
80configarchitecture 'armel'
81msgtest 'Test direct calling is okay for' 'apt-internal-solver'
92b2e38d 82cat "$APT_EDSP_DUMP_FILENAME" | aptinternalsolver -q=0 > solver.result 2>&1 || true
1f6cf9e7
DK
83if [ "$(tail -n2 solver.result | head -n1 )" = "Message: Done" ]; then
84 msgpass
85else
86 cat solver.result
87 msgfail
88fi
92b2e38d 89rm -f "$APT_EDSP_DUMP_FILENAME"
1f6cf9e7
DK
90
91testfailure aptget install --solver apt awesomecoolstuff:i386 -s
081c9d44
DK
92
93testsuccess aptinternalsolver scenario
25b86db1 94testsuccessequal 'Package: stuff
081c9d44
DK
95Source: stuff
96Architecture: all
97Version: 1
eed4639e 98Source-Version: 1
081c9d44
DK
99Installed: yes
100APT-ID: 2
101Priority: optional
102Section: other
103APT-Pin: 100
104APT-Candidate: yes
105' aptinternalsolver scenario stuff