]> git.saurik.com Git - apt.git/blobdiff - test/integration/test-bug-769609-triggers-still-pending-after-run
test: Use a file to determine TEST_DEFAULT_GROUP
[apt.git] / test / integration / test-bug-769609-triggers-still-pending-after-run
index 146fa766b93fe4d4b71f697526ceaa73b85e224b..b44ebf74f0b9aa1856e3f36b9328ba5a1f8b684d 100755 (executable)
@@ -1,8 +1,8 @@
 #!/bin/sh
 set -e
 
-TESTDIR=$(readlink -f $(dirname $0))
-. $TESTDIR/framework
+TESTDIR="$(readlink -f "$(dirname "$0")")"
+. "$TESTDIR/framework"
 
 setupenvironment
 configarchitecture 'amd64'
@@ -20,13 +20,13 @@ buildtriggerpackages() {
        local TYPE="$1"
        setupsimplenativepackage "triggerable-$TYPE" 'all' '1.0' 'unstable' "Depends: trigdepends-$TYPE"
        BUILDDIR="incoming/triggerable-${TYPE}-1.0"
-       cat >${BUILDDIR}/debian/postinst <<EOF
+       cat >"${BUILDDIR}/debian/postinst" <<EOF
 #!/bin/sh
 if [ "\$1" = 'triggered' ]; then
-       ls -l /proc/self/fd/
+       echo "TRIGGER IS RUNNING"
 fi
 EOF
-       echo "$TYPE /usr/share/doc" > ${BUILDDIR}/debian/triggers
+       echo "$TYPE /usr/share/doc" > "${BUILDDIR}/debian/triggers"
        buildpackage "$BUILDDIR" 'unstable' 'main' 'native'
        rm -rf "$BUILDDIR"
        buildsimplenativepackage "trigdepends-$TYPE" 'all' '1.0' 'unstable'
@@ -49,26 +49,26 @@ runtests() {
        testsuccess aptget install trigdepends-$TYPE -y --reinstall
        cp rootdir/tmp/testsuccess.output terminal.output
        testsuccess grep '^REWRITE ' terminal.output
-       testsuccess grep ' root root ' terminal.output
+       testsuccess grep 'TRIGGER IS RUNNING' terminal.output
        testdpkginstalled triggerable-$TYPE trigdepends-$TYPE
 
        testsuccess aptget install trigstuff -y
        cp rootdir/tmp/testsuccess.output terminal.output
        testsuccess grep '^REWRITE ' terminal.output
-       testsuccess grep ' root root ' terminal.output
+       testsuccess grep 'TRIGGER IS RUNNING' terminal.output
        testdpkginstalled triggerable-$TYPE trigdepends-$TYPE trigstuff
 
        testsuccess aptget purge trigstuff -y
        cp rootdir/tmp/testsuccess.output terminal.output
        testsuccess grep '^REWRITE ' terminal.output
-       testsuccess grep ' root root ' terminal.output
+       testsuccess grep 'TRIGGER IS RUNNING' terminal.output
        testdpkginstalled triggerable-$TYPE trigdepends-$TYPE
        testdpkgnotinstalled trigstuff
 
        testsuccess aptget purge trigdepends-$TYPE -y
        cp rootdir/tmp/testsuccess.output terminal.output
        testfailure grep '^REWRITE ' terminal.output
-       testfailure grep ' root root ' terminal.output
+       testfailure grep 'TRIGGER IS RUNNING' terminal.output
        testdpkgnotinstalled triggerable-$TYPE trigdepends-$TYPE
 }
 #runtests 'interest'