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