diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2023-08-22 16:21:00 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-22 16:21:00 +0200 |
commit | 88328d997a6159ab324916972603d0db8afef7aa (patch) | |
tree | dddc9992594b14b9ab6db32d52bd6e38b68f1152 /test | |
parent | sysext: fix a memory leak (diff) | |
parent | test-execute: add tests for credentials directory with mount namespace (diff) | |
download | systemd-88328d997a6159ab324916972603d0db8afef7aa.tar.xz systemd-88328d997a6159ab324916972603d0db8afef7aa.zip |
Merge pull request #28787 from yuwata/credential-next
core: do not leak mount for credentials directory if possible
Diffstat (limited to 'test')
4 files changed, 36 insertions, 0 deletions
diff --git a/test/test-execute/exec-load-credential-with-mount-namespace.service b/test/test-execute/exec-load-credential-with-mount-namespace.service new file mode 100644 index 0000000000..fd71cf6717 --- /dev/null +++ b/test/test-execute/exec-load-credential-with-mount-namespace.service @@ -0,0 +1,9 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later +[Unit] +Description=Test for LoadCredential= + +[Service] +ExecStart=/bin/sh -x -c 'test "$$(cat %d/test-execute.load-credential)" = "foo"' +Type=oneshot +LoadCredential=test-execute.load-credential +PrivateMounts=yes diff --git a/test/test-execute/exec-load-credential-with-seccomp.service b/test/test-execute/exec-load-credential-with-seccomp.service new file mode 100644 index 0000000000..67303f2713 --- /dev/null +++ b/test/test-execute/exec-load-credential-with-seccomp.service @@ -0,0 +1,9 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later +[Unit] +Description=Test for LoadCredential= + +[Service] +ExecStart=/bin/sh -x -c 'test "$$(cat %d/test-execute.load-credential)" = "foo"' +Type=oneshot +LoadCredential=test-execute.load-credential +SystemCallFilter=~open_tree move_mount diff --git a/test/test-execute/exec-set-credential-with-mount-namespace.service b/test/test-execute/exec-set-credential-with-mount-namespace.service new file mode 100644 index 0000000000..67d15e5dbb --- /dev/null +++ b/test/test-execute/exec-set-credential-with-mount-namespace.service @@ -0,0 +1,9 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later +[Unit] +Description=Test for SetCredential= + +[Service] +ExecStart=/bin/sh -x -c 'test "$$(cat %d/test-execute.set-credential)" = "hoge"' +Type=oneshot +SetCredential=test-execute.set-credential:hoge +PrivateMounts=yes diff --git a/test/test-execute/exec-set-credential-with-seccomp.service b/test/test-execute/exec-set-credential-with-seccomp.service new file mode 100644 index 0000000000..778777b947 --- /dev/null +++ b/test/test-execute/exec-set-credential-with-seccomp.service @@ -0,0 +1,9 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later +[Unit] +Description=Test for SetCredential= + +[Service] +ExecStart=/bin/sh -x -c 'test "$$(cat %d/test-execute.set-credential)" = "hoge"' +Type=oneshot +SetCredential=test-execute.set-credential:hoge +SystemCallFilter=~open_tree move_mount |