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