]>
Commit | Line | Data |
---|---|---|
dae19747 DK |
1 | #!/bin/sh |
2 | set -e | |
3 | ||
4 | TESTDIR="$(readlink -f "$(dirname "$0")")" | |
f883d2c3 | 5 | NATIVE="$(command dpkg --print-architecture)" |
dae19747 DK |
6 | . "$TESTDIR/framework" |
7 | setupenvironment | |
f883d2c3 | 8 | configarchitecture "${NATIVE}" |
dae19747 | 9 | |
f883d2c3 | 10 | buildsimplenativepackage 'libfoo' "${NATIVE}" '3' 'experimental' 'Multi-Arch: same' |
dae19747 | 11 | buildsimplenativepackage 'foo' 'all' '3' 'experimental' 'Depends: newstuff' |
f883d2c3 | 12 | buildsimplenativepackage 'foo' 'all' '2' 'unstable' "Depends: libfoo:$NATIVE, stuff |
dae19747 | 13 | Conflicts: bar, libfoo:i386 |
f883d2c3 JAK |
14 | Recommends: unrelated" |
15 | buildsimplenativepackage 'libfoo' "${NATIVE}" '2' 'unstable' 'Multi-Arch: same' | |
16 | buildsimplenativepackage 'unrelated-2' "${NATIVE}" '2' 'unstable' | |
dae19747 DK |
17 | insertinstalledpackage 'foo' 'all' '1' |
18 | insertinstalledpackage 'bar' 'all' '1' | |
19 | insertinstalledpackage 'stuff' 'all' '1' | |
20 | insertinstalledpackage 'unrelated-1' 'all' '1' | |
21 | ||
22 | setupaptarchive --no-update | |
23 | ||
b4f91d4d | 24 | EIPPLOG="${TMPWORKINGDIRECTORY}/rootdir/var/log/apt/eipp.log" |
8e99b22c | 25 | echo "Dir::Log::Planner \"$EIPPLOG\";" > ./rootdir/etc/apt/apt.conf.d/eipp-logging |
b4f91d4d | 26 | |
dae19747 | 27 | testsuccess apt update |
8e99b22c | 28 | export APT_EDSP_DUMP_FILENAME="${TMPWORKINGDIRECTORY}/downloaded/dump.eipp" |
b4f91d4d | 29 | testfailure test -r "$EIPPLOG" |
8e99b22c | 30 | testfailure aptget install foo --planner dump -y |
b4f91d4d | 31 | testfailure test -r "$EIPPLOG" |
dae19747 DK |
32 | testfailure grep 'unrelated-2' "$APT_EDSP_DUMP_FILENAME" |
33 | testsuccessequal '2' grep -c '^Package: foo$' "$APT_EDSP_DUMP_FILENAME" | |
34 | testsuccessequal '1' grep -c '^Package: libfoo$' "$APT_EDSP_DUMP_FILENAME" | |
8e99b22c | 35 | testsuccessequal 'Planner: dump' grep '^Planner: ' "$APT_EDSP_DUMP_FILENAME" |
b4f91d4d DK |
36 | |
37 | testsuccess aptget install foo -s | |
38 | testsuccess aptget install foo -y | |
39 | testsuccess test -r "$EIPPLOG" | |
f883d2c3 JAK |
40 | testsuccessequal "Request: EIPP 0.1 |
41 | Architecture: ${NATIVE} | |
42 | Architectures: ${NATIVE} | |
43 | Remove: bar:${NATIVE} | |
44 | Install: libfoo:${NATIVE} foo:${NATIVE} | |
45 | Planner: internal" head -n 6 "$EIPPLOG" | |
8e99b22c | 46 | aptinternalplanner < "$EIPPLOG" > planner.log || true |
b4f91d4d DK |
47 | testsuccessequal 'Remove: 6 |
48 | Unpack: 2 | |
49 | Unpack: 4 | |
50 | Configure: 2 | |
8e99b22c | 51 | Configure: 4' grep -e '^Unpack:' -e '^Install:' -e '^Configure:' -e '^Remove:' planner.log |
b4f91d4d DK |
52 | |
53 | rm -f "$EIPPLOG" | |
54 | testsuccess aptget install foo -s --reinstall | |
55 | testsuccess aptget install foo -y --reinstall | |
56 | testsuccess test -r "$EIPPLOG" | |
f883d2c3 JAK |
57 | testsuccessequal "Request: EIPP 0.1 |
58 | Architecture: ${NATIVE} | |
59 | Architectures: ${NATIVE} | |
60 | ReInstall: foo:${NATIVE} | |
61 | Planner: internal" head -n 5 "$EIPPLOG" | |
8e99b22c | 62 | aptinternalplanner < "$EIPPLOG" > planner.log || true |
b4f91d4d | 63 | testsuccessequal 'Unpack: 4 |
8e99b22c | 64 | Configure: 4' grep -e '^Unpack:' -e '^Install:' -e '^Configure:' -e '^Remove:' planner.log |
f74d99c6 | 65 | |
b4f91d4d DK |
66 | rm -f "$EIPPLOG" |
67 | testsuccess aptget purge foo -s | |
68 | testsuccess aptget purge foo -y | |
69 | testsuccess test -r "$EIPPLOG" | |
f883d2c3 JAK |
70 | testsuccessequal "Request: EIPP 0.1 |
71 | Architecture: ${NATIVE} | |
72 | Architectures: ${NATIVE} | |
73 | Remove: foo:${NATIVE} | |
74 | Planner: internal" head -n 5 "$EIPPLOG" | |
8e99b22c DK |
75 | aptinternalplanner < "$EIPPLOG" > planner.log || true |
76 | testsuccessequal 'Remove: 4' grep -e '^Unpack:' -e '^Install:' -e '^Configure:' -e '^Remove:' planner.log |