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