From: Zbigniew Jędrzejewski-Szmek Date: Sat, 21 Mar 2020 15:30:27 +0000 (+0100) Subject: test/TEST-15: remove all created unit files X-Git-Tag: v246-rc1~682^2~54 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4e2ac45a83e5495a5c1d3ecac62a054e0cef7746;p=thirdparty%2Fsystemd.git test/TEST-15: remove all created unit files We would miss anything created under a template instance. --- diff --git a/test/units/testsuite-15.sh b/test/units/testsuite-15.sh index c1d640a31c6..b09b6a12837 100755 --- a/test/units/testsuite-15.sh +++ b/test/units/testsuite-15.sh @@ -7,6 +7,12 @@ _clear_service () { rm -f /{etc,run,usr/lib}/systemd/system/$1.service rm -fr /{etc,run,usr/lib}/systemd/system/$1.service.d rm -fr /{etc,run,usr/lib}/systemd/system/$1.service.{wants,requires} + if [[ $1 == *@ ]]; then + systemctl stop $1*.service 2>/dev/null || : + rm -f /{etc,run,usr/lib}/systemd/system/$1*.service + rm -fr /{etc,run,usr/lib}/systemd/system/$1*.service.d + rm -fr /{etc,run,usr/lib}/systemd/system/$1*.service.{wants,requires} + fi } clear_services () {