summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2018-10-05 14:46:30 +0900
committerGitHub <noreply@github.com>2018-10-05 14:46:30 +0900
commite913b7988f5aec19a4bd38fda021de86f8f06aa5 (patch)
treefa091a3c6f399cb92b9fb117fffaf430b88dd92f /test
parentb62f9008668a5330c61b4de7e0d48147bcd1edf7 (diff)
downloadsystemd-e913b7988f5aec19a4bd38fda021de86f8f06aa5.tar.gz
systemd-e913b7988f5aec19a4bd38fda021de86f8f06aa5.tar.bz2
systemd-e913b7988f5aec19a4bd38fda021de86f8f06aa5.zip
test-execute: add a test for systemcall filter (#10273)
This adds a test for issue #9939 which is fixed by a5404992cc7724ebf7572a0aa89d9fdb26ce0b62 (#9942).
Diffstat (limited to 'test')
-rw-r--r--test/meson.build1
-rw-r--r--test/test-execute/exec-systemcallfilter-with-errno-multi.service9
2 files changed, 10 insertions, 0 deletions
diff --git a/test/meson.build b/test/meson.build
index 37034fca96..7e8f2cfa90 100644
--- a/test/meson.build
+++ b/test/meson.build
@@ -134,6 +134,7 @@ test_data_files = '''
test-execute/exec-systemcallfilter-system-user-nfsnobody.service
test-execute/exec-systemcallfilter-system-user-nobody.service
test-execute/exec-systemcallfilter-system-user.service
+ test-execute/exec-systemcallfilter-with-errno-multi.service
test-execute/exec-systemcallfilter-with-errno-name.service
test-execute/exec-systemcallfilter-with-errno-number.service
test-execute/exec-temporaryfilesystem-options.service
diff --git a/test/test-execute/exec-systemcallfilter-with-errno-multi.service b/test/test-execute/exec-systemcallfilter-with-errno-multi.service
new file mode 100644
index 0000000000..951e7ac36b
--- /dev/null
+++ b/test/test-execute/exec-systemcallfilter-with-errno-multi.service
@@ -0,0 +1,9 @@
+[Unit]
+Description=Test for SystemCallFilter updating errno
+# test for issue #9939 which is fixed by a5404992cc7724ebf7572a0aa89d9fdb26ce0b62 (#9942)
+
+[Service]
+ExecStart=/usr/bin/python3 -c 'import os\ntry: os.uname()\nexcept Exception as e: exit(e.errno)'
+Type=oneshot
+SystemCallFilter=~uname:ENOENT uname:EILSEQ
+SystemCallErrorNumber=EACCES