Debian Codegraph @

test/integration/test-bug-769609-triggers-still-pending-after-run

raw symbols SCIP
1 #!/bin/shscip-shell filesystem . . `/bin/sh`.
2 set -e
3
4 TESTDIR="$(readlinkscip-shell system . . readlink. -f "$(dirnamescip-shell system . . dirname. "$0")")"
5 . "$TESTDIR/framework"
6
7 setupenvironment
8 allowremovemanual
9 configarchitecture 'amd64'
10
11 msgtest 'Check if installed dpkg supports' 'noawait trigger'
12 if dpkgscip-shell system . . dpkg. --compare-versions "$(dpkg_version)" 'ge' '1.16.1'; then
13 msgpass
14 else
15 msgskip 'dpkg version too old'
16 exit 0
17 fi
18 configdpkgnoopchroot
19
20 buildtriggerpackagesscip-shell shell shell-project 0.0.0 buildtriggerpackages().() {
21 local TYPE="$1"
22 setupsimplenativepackage "triggerable-$TYPE" 'all' '1.0' 'unstable' "Depends: trigdepends-$TYPE"
23 BUILDDIR="incoming/triggerable-${TYPE}-1.0"
24 catscip-shell system . . cat. >"${BUILDDIR}/debian/postinst" <<EOF
25 #!/bin/sh
26 if [ "\$1" = 'triggered' ]; then
27 echo "TRIGGER IS RUNNING"
28 fi
29 EOF
30 echoscip-shell system . . echo. "$TYPE /usr/share/doc" > "${BUILDDIR}/debian/triggers"
31 buildpackage "$BUILDDIR" 'unstable' 'main' 'native'
32 rmscip-shell system . . rm. -rf "$BUILDDIR"
33 buildsimplenativepackage "trigdepends-$TYPE" 'all' '1.0' 'unstable'
34 }
35
36 #buildtriggerpackages 'interest'
37 buildtriggerpackagesscip-shell shell shell-project 0.0.0 buildtriggerpackages(). 'interest-noawait'
38 buildsimplenativepackage "trigstuff" 'all' '1.0' 'unstable'
39
40 setupaptarchive
41
42 runtestsscip-shell shell shell-project 0.0.0 runtests().() {
43 local TYPE="$1"
44 msgmsg 'Working with trigger type' "$TYPE"
45 testsuccess aptget install triggerable-$TYPE -y
46 cpscip-shell system . . cp. rootdir/tmp/testsuccess.output terminal.output
47 testsuccess grep '^REWRITE ' terminal.output
48 testdpkginstalled triggerable-$TYPE trigdepends-$TYPE
49
50 testsuccess aptget install trigdepends-$TYPE -y --reinstall
51 cpscip-shell system . . cp. rootdir/tmp/testsuccess.output terminal.output
52 testsuccess grep '^REWRITE ' terminal.output
53 testsuccess grep 'TRIGGER IS RUNNING' terminal.output
54 testdpkginstalled triggerable-$TYPE trigdepends-$TYPE
55
56 testsuccess aptget install trigstuff -y
57 cpscip-shell system . . cp. rootdir/tmp/testsuccess.output terminal.output
58 testsuccess grep '^REWRITE ' terminal.output
59 testsuccess grep 'TRIGGER IS RUNNING' terminal.output
60 testdpkginstalled triggerable-$TYPE trigdepends-$TYPE trigstuff
61
62 testsuccess aptget purge trigstuff -y
63 cpscip-shell system . . cp. rootdir/tmp/testsuccess.output terminal.output
64 testsuccess grep '^REWRITE ' terminal.output
65 testsuccess grep 'TRIGGER IS RUNNING' terminal.output
66 testdpkginstalled triggerable-$TYPE trigdepends-$TYPE
67 testdpkgnotinstalled trigstuff
68
69 testsuccess aptget purge trigdepends-$TYPE -y
70 cpscip-shell system . . cp. rootdir/tmp/testsuccess.output terminal.output
71 testfailure grep '^REWRITE ' terminal.output
72 testfailure grep 'TRIGGER IS RUNNING' terminal.output
73 testdpkgnotinstalled triggerable-$TYPE trigdepends-$TYPE
74 }
75 #runtests 'interest'
76 runtestsscip-shell shell shell-project 0.0.0 runtests(). 'interest-noawait'