From: David Tardon Date: Thu, 3 Oct 2019 17:05:06 +0000 (+0200) Subject: add test for ExecStopPost X-Git-Tag: v244-rc1~183 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=02baf239d87295362740d961765091b778795573;p=thirdparty%2Fsystemd.git add test for ExecStopPost This is a follow-up to #4843. --- diff --git a/test/TEST-42-EXECSTOPPOST/Makefile b/test/TEST-42-EXECSTOPPOST/Makefile new file mode 100644 index 00000000000..45e9bfc67cd --- /dev/null +++ b/test/TEST-42-EXECSTOPPOST/Makefile @@ -0,0 +1,9 @@ +BUILD_DIR=$(shell ../../tools/find-build-dir.sh) + +all setup run: + @basedir=../.. TEST_BASE_DIR=../ BUILD_DIR=$(BUILD_DIR) ./test.sh --$@ + +clean clean-again: + @basedir=../.. TEST_BASE_DIR=../ BUILD_DIR=$(BUILD_DIR) ./test.sh --clean + +.PHONY: all setup run clean clean-again diff --git a/test/TEST-42-EXECSTOPPOST/test.sh b/test/TEST-42-EXECSTOPPOST/test.sh new file mode 100755 index 00000000000..dd967879cab --- /dev/null +++ b/test/TEST-42-EXECSTOPPOST/test.sh @@ -0,0 +1,47 @@ +#!/bin/bash +set -e +TEST_DESCRIPTION="test that ExecStopPost= is always run" + +. $TEST_BASE_DIR/test-functions + +test_setup() { + create_empty_image_rootdir + + ( + LOG_LEVEL=5 + eval $(udevadm info --export --query=env --name=${LOOPDEV}p2) + + setup_basic_environment + + mask_supporting_services + + # setup policy for Type=dbus test + mkdir -p $initdir/etc/dbus-1/system.d + cat > $initdir/etc/dbus-1/system.d/systemd.test.ExecStopPost.conf < + + + + + + +EOF + + # setup the testsuite service + cat >$initdir/etc/systemd/system/testsuite.service < /tmp/forking1.sh < /tmp/forking2.sh < /tmp/notify1.sh < /testok + +exit 0