1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-12-22 13:33:56 +03:00

test: add more tests for "systemctl clean"

This commit is contained in:
Yu Watanabe 2019-08-31 09:30:12 +02:00 committed by Zbigniew Jędrzejewski-Szmek
parent a8b689b7d0
commit a3f8e4d94a

View File

@ -169,6 +169,151 @@ systemctl clean testservice --what=all
! test -L /var/cache/testservice
! test -L /var/log/testservice
cat > /etc/systemd/system/tmp-hoge.mount <<EOF
[Mount]
What=tmpfs
Type=tmpfs
ConfigurationDirectory=hoge
RuntimeDirectory=hoge
StateDirectory=hoge
CacheDirectory=hoge
LogsDirectory=hoge
EOF
systemctl daemon-reload
! test -e /etc/hoge
! test -e /run/hoge
! test -e /var/lib/hoge
! test -e /var/cache/hoge
! test -e /var/log/hoge
systemctl start tmp-hoge.mount
test -d /etc/hoge
test -d /run/hoge
test -d /var/lib/hoge
test -d /var/cache/hoge
test -d /var/log/hoge
! systemctl clean tmp-hoge.mount
test -d /etc/hoge
test -d /run/hoge
test -d /var/lib/hoge
test -d /var/cache/hoge
test -d /var/log/hoge
systemctl stop tmp-hoge.mount
test -d /etc/hoge
! test -d /run/hoge
test -d /var/lib/hoge
test -d /var/cache/hoge
test -d /var/log/hoge
systemctl clean tmp-hoge.mount --what=configuration
! test -d /etc/hoge
! test -d /run/hoge
test -d /var/lib/hoge
test -d /var/cache/hoge
test -d /var/log/hoge
systemctl clean tmp-hoge.mount
! test -d /etc/hoge
! test -d /run/hoge
test -d /var/lib/hoge
! test -d /var/cache/hoge
test -d /var/log/hoge
systemctl clean tmp-hoge.mount --what=logs
! test -d /etc/hoge
! test -d /run/hoge
test -d /var/lib/hoge
! test -d /var/cache/hoge
! test -d /var/log/hoge
systemctl clean tmp-hoge.mount --what=all
! test -d /etc/hoge
! test -d /run/hoge
! test -d /var/lib/hoge
! test -d /var/cache/hoge
! test -d /var/log/hoge
cat > /etc/systemd/system/testservice.socket <<EOF
[Socket]
ListenSequentialPacket=/run/testservice.socket
RemoveOnStop=yes
ExecStartPre=true
ConfigurationDirectory=testsocket
RuntimeDirectory=testsocket
StateDirectory=testsocket
CacheDirectory=testsocket
LogsDirectory=testsocket
EOF
systemctl daemon-reload
! test -e /etc/testsocket
! test -e /run/testsocket
! test -e /var/lib/testsocket
! test -e /var/cache/testsocket
! test -e /var/log/testsocket
systemctl start testservice.socket
test -d /etc/testsocket
! test -d /run/testsocket
test -d /var/lib/testsocket
test -d /var/cache/testsocket
test -d /var/log/testsocket
! systemctl clean testservice.socket
systemctl stop testservice.socket
test -d /etc/testsocket
! test -d /run/testsocket
test -d /var/lib/testsocket
test -d /var/cache/testsocket
test -d /var/log/testsocket
systemctl clean testservice.socket --what=configuration
! test -e /etc/testsocket
! test -d /run/testsocket
test -d /var/lib/testsocket
test -d /var/cache/testsocket
test -d /var/log/testsocket
systemctl clean testservice.socket
! test -e /etc/testsocket
! test -e /run/testsocket
test -d /var/lib/testsocket
! test -e /var/cache/testsocket
test -d /var/log/testsocket
systemctl clean testservice.socket --what=logs
! test -e /etc/testsocket
! test -e /run/testsocket
test -d /var/lib/testsocket
! test -e /var/cache/testsocket
! test -e /var/log/testsocket
systemctl clean testservice.socket --what=all
! test -e /etc/testsocket
! test -e /run/testsocket
! test -e /var/lib/testsocket
! test -e /var/cache/testsocket
! test -e /var/log/testsocket
echo OK > /testok
exit 0