1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-02-15 05:57:26 +03:00

test: add test cases for issue #30357

(cherry picked from commit 9d51ab78300364c71a0e1f138e1d2cbc65771b93)
(cherry picked from commit d644d2f562051a86f7a8b2a8e382cee315463bd9)
(cherry picked from commit 948239494414da16147162871bac109b197c35e7)
(cherry picked from commit e60c4b4512c1885fdae7c00550516ef46bf08546)
This commit is contained in:
Yu Watanabe 2023-12-08 10:41:49 +09:00 committed by Luca Boccassi
parent b25cc2b109
commit 662ff90023

View File

@ -285,6 +285,44 @@ EOF
# Verifies that the --offline= option works with --root=
systemd-analyze security --threshold=90 --offline=true --root=/tmp/img/ testfile.service
cat <<EOF >/tmp/foo@.service
[Service]
ExecStart=ls
EOF
cat <<EOF >/tmp/hoge@test.service
[Service]
ExecStart=ls
EOF
# issue #30357
pushd /tmp
systemd-analyze verify foo@bar.service
systemd-analyze verify foo@.service
systemd-analyze verify hoge@test.service
(! systemd-analyze verify hoge@nonexist.service)
(! systemd-analyze verify hoge@.service)
popd
pushd /
systemd-analyze verify tmp/foo@bar.service
systemd-analyze verify tmp/foo@.service
systemd-analyze verify tmp/hoge@test.service
(! systemd-analyze verify tmp/hoge@nonexist.service)
(! systemd-analyze verify tmp/hoge@.service)
popd
pushd /usr
systemd-analyze verify ../tmp/foo@bar.service
systemd-analyze verify ../tmp/foo@.service
systemd-analyze verify ../tmp/hoge@test.service
(! systemd-analyze verify ../tmp/hoge@nonexist.service)
(! systemd-analyze verify ../tmp/hoge@.service)
popd
systemd-analyze verify /tmp/foo@bar.service
systemd-analyze verify /tmp/foo@.service
systemd-analyze verify /tmp/hoge@test.service
(! systemd-analyze verify /tmp/hoge@nonexist.service)
(! systemd-analyze verify /tmp/hoge@.service)
# Added an additional "INVALID_ID" id to the .json to verify that nothing breaks when input is malformed
# The PrivateNetwork id description and weight was changed to verify that 'security' is actually reading in
# values from the .json file when required. The default weight for "PrivateNetwork" is 2500, and the new weight