]> git.saurik.com Git - apt.git/blob - test/integration/test-external-dependency-solver-protocol
do not call resolver twice on (dist-)upgrade
[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 insertpackage 'unstable' 'awesomecoolstuff' 'i386' '2' 'Depends: coolstuff, awesome'
17
18 insertpackage 'experimental' 'cool' 'all' '3' 'Multi-Arch: foreign'
19 insertpackage 'experimental' 'stuff' 'all' '3' 'Multi-Arch: foreign'
20 insertpackage 'experimental' 'coolstuff' 'i386,amd64' '3' 'Depends: cool, stuff'
21
22 setupaptarchive
23
24 rm -f /tmp/dump.edsp
25 testequal 'Reading package lists...
26 Building dependency tree...
27 Execute external solver...
28 The solver encountered an error of type: ERR_JUST_DUMPING
29 The following information might help you to understand what is wrong:
30 I am too dumb, i can just dump!
31 Please use one of my friends instead!
32
33 E: External solver failed with: I am too dumb, i can just dump!' aptget install --solver dump coolstuff -s
34 testsuccess test -s /tmp/dump.edsp
35 rm -f /tmp/dump.edsp
36
37 #FIXME: this should be unstable, but we don't support pinning yet
38 testequal 'Reading package lists...
39 Building dependency tree...
40 Execute external solver...
41 The following NEW packages will be installed:
42 coolstuff
43 0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded.
44 Inst coolstuff (3 experimental [amd64])
45 Conf coolstuff (3 experimental [amd64])' aptget install --solver apt coolstuff -s
46
47 testsuccess aptget install awesomecoolstuff:i386 -s
48 testsuccess aptget install --solver apt awesomecoolstuff:i386 -s
49
50 rm -f /tmp/dump.edsp
51 testfailure aptget install --solver dump awesomecoolstuff:i386 -s
52 testsuccess test -s /tmp/dump.edsp
53
54 testsuccess aptget dist-upgrade -s
55 testsuccess aptget dist-upgrade -s --solver apt
56
57 testsuccess aptget upgrade -s
58 testsuccess aptget upgrade -s --solver apt
59
60 configarchitecture 'armel'
61 msgtest 'Test direct calling is okay for' 'apt-internal-solver'
62 cat /tmp/dump.edsp | aptinternalsolver > solver.result 2>&1 || true
63 if [ "$(tail -n2 solver.result | head -n1 )" = "Message: Done" ]; then
64 msgpass
65 else
66 cat solver.result
67 msgfail
68 fi
69 rm -f /tmp/dump.edsp
70
71 testfailure aptget install --solver apt awesomecoolstuff:i386 -s