test/TEST-15: remove all created unit files

We would miss anything created under a template instance.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2020-03-21 16:30:27 +01:00
parent 2c7519c036
commit 4e2ac45a83
1 changed files with 6 additions and 0 deletions

View File

@ -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 () {