mirror of
https://github.com/Dasharo/systemd.git
synced 2026-03-06 15:02:31 -08:00
test: clean up test artifacts
So we don't run into unexpected fails when two tests use the same paths.
This commit is contained in:
@@ -7,6 +7,14 @@ set -o pipefail
|
||||
|
||||
# Test RuntimeDirectoryPreserve=yes
|
||||
|
||||
at_exit() {
|
||||
set +e
|
||||
|
||||
rm -fr /run/hoge /tmp/aaa
|
||||
}
|
||||
|
||||
trap at_exit EXIT
|
||||
|
||||
systemd-mount -p RuntimeDirectory=hoge -p RuntimeDirectoryPreserve=yes -t tmpfs tmpfs /tmp/aaa
|
||||
|
||||
touch /run/hoge/foo
|
||||
|
||||
@@ -7,6 +7,17 @@ set -o pipefail
|
||||
|
||||
# Test unit configuration/state/cache/log/runtime data cleanup
|
||||
|
||||
at_exit() {
|
||||
set +e
|
||||
|
||||
rm -fr /{etc,run,var/lib,var/cache,var/log}/test-service
|
||||
rm -fr /{etc,run,var/lib,var/cache,var/log}/private/test-service
|
||||
rm -fr /{etc,run,var/lib,var/cache,var/log}/hoge
|
||||
rm -fr /{etc,run,var/lib,var/cache,var/log}/test-socket
|
||||
}
|
||||
|
||||
trap at_exit EXIT
|
||||
|
||||
cat >/run/systemd/system/test-service.service <<EOF
|
||||
[Service]
|
||||
ConfigurationDirectory=test-service
|
||||
|
||||
Reference in New Issue
Block a user