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