]>
Commit | Line | Data |
---|---|---|
1f6cf9e7 DK |
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' | |
188a6fcf | 11 | insertinstalledpackage 'somestuff' 'all' '1' 'Depends: cool, stuff' |
1f6cf9e7 DK |
12 | |
13 | insertpackage 'unstable' 'cool' 'all' '2' 'Multi-Arch: foreign' | |
14 | insertpackage 'unstable' 'stuff' 'all' '2' 'Multi-Arch: foreign' | |
15 | insertpackage 'unstable' 'coolstuff' 'i386,amd64' '2' 'Depends: cool, stuff' | |
081c9d44 DK |
16 | insertpackage 'unstable' 'awesome' 'all' '2' 'Multi-Arch: foreign |
17 | Conflicts: badstuff' | |
18 | insertpackage 'unstable' 'badstuff' 'all' '2' 'Multi-Arch: foreign | |
19 | Conflicts: awesome' | |
1f6cf9e7 DK |
20 | insertpackage 'unstable' 'awesomecoolstuff' 'i386' '2' 'Depends: coolstuff, awesome' |
21 | ||
22 | insertpackage 'experimental' 'cool' 'all' '3' 'Multi-Arch: foreign' | |
23 | insertpackage 'experimental' 'stuff' 'all' '3' 'Multi-Arch: foreign' | |
24 | insertpackage 'experimental' 'coolstuff' 'i386,amd64' '3' 'Depends: cool, stuff' | |
25 | ||
26 | setupaptarchive | |
27 | ||
92b2e38d DK |
28 | testfailure aptget install --solver dump coolstuff -s |
29 | testsuccess grep ERR_NO_FILENAME rootdir/tmp/testfailure.output | |
30 | export APT_EDSP_DUMP_FILENAME="${TMPWORKINGDIRECTORY}/downloaded/dump.edsp" | |
31 | ||
25b86db1 | 32 | testfailureequal 'Reading package lists... |
1f6cf9e7 DK |
33 | Building dependency tree... |
34 | Execute external solver... | |
35 | The solver encountered an error of type: ERR_JUST_DUMPING | |
36 | The following information might help you to understand what is wrong: | |
37 | I am too dumb, i can just dump! | |
38 | Please use one of my friends instead! | |
39 | ||
40 | E: External solver failed with: I am too dumb, i can just dump!' aptget install --solver dump coolstuff -s | |
92b2e38d DK |
41 | testsuccess test -s "$APT_EDSP_DUMP_FILENAME" |
42 | rm -f "$APT_EDSP_DUMP_FILENAME" | |
1f6cf9e7 | 43 | |
188a6fcf DK |
44 | testsuccessequal 'Reading package lists... |
45 | Building dependency tree... | |
46 | Execute external solver... | |
47 | The following NEW packages will be installed: | |
48 | coolstuff | |
49 | 0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded. | |
50 | Inst coolstuff (2 unstable [amd64]) | |
51 | Conf coolstuff (2 unstable [amd64])' aptget install --solver apt coolstuff -s | |
52 | ||
25b86db1 | 53 | testsuccessequal 'Reading package lists... |
1f6cf9e7 DK |
54 | Building dependency tree... |
55 | Execute external solver... | |
56 | The following NEW packages will be installed: | |
57 | coolstuff | |
58 | 0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded. | |
59 | Inst coolstuff (3 experimental [amd64]) | |
188a6fcf | 60 | Conf coolstuff (3 experimental [amd64])' aptget install --solver apt coolstuff -s -t experimental |
1f6cf9e7 | 61 | |
25b86db1 | 62 | testsuccessequal 'Reading package lists... |
081c9d44 DK |
63 | Building dependency tree... |
64 | Execute external solver... | |
65 | The following packages will be REMOVED: | |
188a6fcf DK |
66 | somestuff |
67 | 0 upgraded, 0 newly installed, 1 to remove and 2 not upgraded. | |
68 | Remv somestuff [1]' aptget autoremove --solver apt somestuff -s | |
69 | testsuccess aptmark auto cool stuff | |
70 | testsuccessequal 'Reading package lists... | |
71 | Building dependency tree... | |
72 | Reading state information... | |
73 | Execute external solver... | |
74 | The following packages will be REMOVED: | |
75 | cool somestuff stuff | |
76 | 0 upgraded, 0 newly installed, 3 to remove and 0 not upgraded. | |
77 | Remv somestuff [1] | |
78 | Remv cool [1] | |
79 | Remv stuff [1]' aptget autoremove --solver apt somestuff -s | |
80 | ||
81 | testsuccessequal "Reading package lists... | |
82 | Building dependency tree... | |
83 | Reading state information... | |
84 | Execute external solver... | |
85 | The following package was automatically installed and is no longer required: | |
86 | stuff | |
87 | Use 'apt-get autoremove' to remove it. | |
88 | The following packages will be REMOVED: | |
89 | cool* somestuff* | |
90 | 0 upgraded, 0 newly installed, 2 to remove and 0 not upgraded. | |
91 | Purg somestuff [1] | |
92 | Purg cool [1]" aptget purge --solver apt cool -s | |
081c9d44 | 93 | |
1f6cf9e7 DK |
94 | testsuccess aptget install awesomecoolstuff:i386 -s |
95 | testsuccess aptget install --solver apt awesomecoolstuff:i386 -s | |
96 | ||
92b2e38d | 97 | rm -f "$APT_EDSP_DUMP_FILENAME" |
1f6cf9e7 | 98 | testfailure aptget install --solver dump awesomecoolstuff:i386 -s |
92b2e38d DK |
99 | testsuccess test -s "$APT_EDSP_DUMP_FILENAME" |
100 | testequal 'Install: awesomecoolstuff:i386' grep :i386 "$APT_EDSP_DUMP_FILENAME" | |
101 | testempty grep -e ':amd64' -e 'Architecture: any' "$APT_EDSP_DUMP_FILENAME" | |
1f6cf9e7 | 102 | |
172947cd DK |
103 | testsuccess aptget dist-upgrade -s |
104 | testsuccess aptget dist-upgrade -s --solver apt | |
105 | ||
106 | testsuccess aptget upgrade -s | |
107 | testsuccess aptget upgrade -s --solver apt | |
108 | ||
081c9d44 DK |
109 | testfailure aptget install awesome badstuff -s |
110 | testfailure aptget install awesome badstuff -s --solver apt | |
111 | testsuccess grep 'ERR_UNSOLVABLE' rootdir/tmp/testfailure.output | |
112 | ||
1f6cf9e7 DK |
113 | configarchitecture 'armel' |
114 | msgtest 'Test direct calling is okay for' 'apt-internal-solver' | |
92b2e38d | 115 | cat "$APT_EDSP_DUMP_FILENAME" | aptinternalsolver -q=0 > solver.result 2>&1 || true |
1f6cf9e7 DK |
116 | if [ "$(tail -n2 solver.result | head -n1 )" = "Message: Done" ]; then |
117 | msgpass | |
118 | else | |
119 | cat solver.result | |
120 | msgfail | |
121 | fi | |
92b2e38d | 122 | rm -f "$APT_EDSP_DUMP_FILENAME" |
1f6cf9e7 DK |
123 | |
124 | testfailure aptget install --solver apt awesomecoolstuff:i386 -s | |
081c9d44 DK |
125 | |
126 | testsuccess aptinternalsolver scenario | |
25b86db1 | 127 | testsuccessequal 'Package: stuff |
081c9d44 DK |
128 | Source: stuff |
129 | Architecture: all | |
130 | Version: 1 | |
eed4639e | 131 | Source-Version: 1 |
081c9d44 DK |
132 | Installed: yes |
133 | APT-ID: 2 | |
134 | Priority: optional | |
135 | Section: other | |
136 | APT-Pin: 100 | |
137 | APT-Candidate: yes | |
138 | ' aptinternalsolver scenario stuff |