4 TESTDIR
=$(readlink -f $(dirname $0))
8 configarchitecture
'amd64'
10 msgtest
'Check if installed dpkg supports' 'noawait trigger'
11 if dpkg
-checkbuilddeps -d 'dpkg (>= 1.16.1)' /dev
/null
; then
14 msgskip
'dpkg version too old'
19 buildtriggerpackages
() {
21 setupsimplenativepackage
"triggerable-$TYPE" 'all' '1.0' 'unstable' "Depends: trigdepends-$TYPE"
22 BUILDDIR
="incoming/triggerable-${TYPE}-1.0"
23 cat >${BUILDDIR}/debian
/postinst
<<EOF
25 if [ "\$1" = 'triggered' ]; then
29 echo "$TYPE /usr/share/doc" > ${BUILDDIR}/debian
/triggers
30 buildpackage
"$BUILDDIR" 'unstable' 'main' 'native'
32 buildsimplenativepackage
"trigdepends-$TYPE" 'all' '1.0' 'unstable'
35 # FIXME: implement test with activate-style triggers
36 #buildtriggerpackages 'interest'
37 buildtriggerpackages
'interest-noawait'
39 buildsimplenativepackage
"trigstuff" 'all' '1.0' 'unstable'
46 msgmsg
'Working with trigger type' "$TYPE"
47 testsuccess aptget
install triggerable
-$TYPE -y
48 cp rootdir
/tmp
/testsuccess.output terminal.output
49 testsuccess
grep '^REWRITE ' terminal.output
50 testdpkginstalled triggerable
-$TYPE trigdepends
-$TYPE
52 testsuccess aptget
install trigdepends
-$TYPE -y --reinstall
53 cp rootdir
/tmp
/testsuccess.output terminal.output
54 testsuccess
grep '^REWRITE ' terminal.output
55 testsuccess
grep ' root root ' terminal.output
56 testdpkginstalled triggerable
-$TYPE trigdepends
-$TYPE
58 testsuccess aptget
install trigstuff
-y
59 cp rootdir
/tmp
/testsuccess.output terminal.output
60 testsuccess
grep '^REWRITE ' terminal.output
61 testsuccess
grep ' root root ' terminal.output
62 testdpkginstalled triggerable
-$TYPE trigdepends
-$TYPE trigstuff
64 testsuccess aptget purge trigstuff
-y
65 cp rootdir
/tmp
/testsuccess.output terminal.output
66 testsuccess
grep '^REWRITE ' terminal.output
67 testsuccess
grep ' root root ' terminal.output
68 testdpkginstalled triggerable
-$TYPE trigdepends
-$TYPE
69 testdpkgnotinstalled trigstuff
71 testsuccess aptget purge trigdepends
-$TYPE -y
72 cp rootdir
/tmp
/testsuccess.output terminal.output
73 testfailure
grep '^REWRITE ' terminal.output
74 testfailure
grep ' root root ' terminal.output
75 testdpkgnotinstalled triggerable
-$TYPE trigdepends
-$TYPE
78 runtests
'interest-noawait'