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