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