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