Skip to content

Commit

Permalink
test/TEST-15: remove all created unit files
Browse files Browse the repository at this point in the history
We would miss anything created under a template instance.
  • Loading branch information
keszybz committed Mar 28, 2020
1 parent 2c7519c commit 4e2ac45
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/units/testsuite-15.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down

0 comments on commit 4e2ac45

Please sign in to comment.