summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2017-11-12 12:45:23 +0100
committerGitHub <noreply@github.com>2017-11-12 12:45:23 +0100
commitcb6d2872ba99155fb6a50ede42f14218a29d5f97 (patch)
treeba93261c462e7b9be81e491181f001ea40706868 /test
parentf332611abee97247e40311d99492d53697152a1a (diff)
parent7a18854fe735ddccc1de2a53e531f306491e6567 (diff)
downloadsystemd-cb6d2872ba99155fb6a50ede42f14218a29d5f97.tar.gz
systemd-cb6d2872ba99155fb6a50ede42f14218a29d5f97.tar.bz2
systemd-cb6d2872ba99155fb6a50ede42f14218a29d5f97.zip
Merge pull request #7178 from yuwata/rfe-7169-v2
core: add support to specify errno in SystemCallFilter=
Diffstat (limited to 'test')
-rw-r--r--test/meson.build5
-rw-r--r--test/test-execute/exec-systemcallerrornumber-name.service (renamed from test/test-execute/exec-systemcallerrornumber.service)2
-rw-r--r--test/test-execute/exec-systemcallerrornumber-number.service8
-rw-r--r--test/test-execute/exec-systemcallfilter-with-errno-name.service8
-rw-r--r--test/test-execute/exec-systemcallfilter-with-errno-number.service8
5 files changed, 29 insertions, 2 deletions
diff --git a/test/meson.build b/test/meson.build
index bc37946bab..69d6c758b0 100644
--- a/test/meson.build
+++ b/test/meson.build
@@ -100,13 +100,16 @@ test_data_files = '''
test-execute/exec-supplementarygroups-single-group-user.service
test-execute/exec-supplementarygroups-single-group.service
test-execute/exec-supplementarygroups.service
- test-execute/exec-systemcallerrornumber.service
+ test-execute/exec-systemcallerrornumber-name.service
+ test-execute/exec-systemcallerrornumber-number.service
test-execute/exec-systemcallfilter-failing.service
test-execute/exec-systemcallfilter-failing2.service
test-execute/exec-systemcallfilter-not-failing.service
test-execute/exec-systemcallfilter-not-failing2.service
test-execute/exec-systemcallfilter-system-user-nfsnobody.service
test-execute/exec-systemcallfilter-system-user.service
+ test-execute/exec-systemcallfilter-with-errno-name.service
+ test-execute/exec-systemcallfilter-with-errno-number.service
test-execute/exec-umask-0177.service
test-execute/exec-umask-default.service
test-execute/exec-unset-environment.service
diff --git a/test/test-execute/exec-systemcallerrornumber.service b/test/test-execute/exec-systemcallerrornumber-name.service
index ff7da3c1a4..229b862794 100644
--- a/test/test-execute/exec-systemcallerrornumber.service
+++ b/test/test-execute/exec-systemcallerrornumber-name.service
@@ -2,7 +2,7 @@
Description=Test for SystemCallErrorNumber
[Service]
-ExecStart=/bin/sh -x -c 'uname -a'
+ExecStart=/bin/python3 -c 'import os\ntry: os.uname()\nexcept Exception as e: exit(e.errno)'
Type=oneshot
SystemCallFilter=~uname
SystemCallErrorNumber=EACCES
diff --git a/test/test-execute/exec-systemcallerrornumber-number.service b/test/test-execute/exec-systemcallerrornumber-number.service
new file mode 100644
index 0000000000..2e13f08bf5
--- /dev/null
+++ b/test/test-execute/exec-systemcallerrornumber-number.service
@@ -0,0 +1,8 @@
+[Unit]
+Description=Test for SystemCallErrorNumber
+
+[Service]
+ExecStart=/bin/python3 -c 'import os\ntry: os.uname()\nexcept Exception as e: exit(e.errno)'
+Type=oneshot
+SystemCallFilter=~uname
+SystemCallErrorNumber=255
diff --git a/test/test-execute/exec-systemcallfilter-with-errno-name.service b/test/test-execute/exec-systemcallfilter-with-errno-name.service
new file mode 100644
index 0000000000..b9beb73b7e
--- /dev/null
+++ b/test/test-execute/exec-systemcallfilter-with-errno-name.service
@@ -0,0 +1,8 @@
+[Unit]
+Description=Test for SystemCallFilter with errno name
+
+[Service]
+ExecStart=/bin/python3 -c 'import os\ntry: os.uname()\nexcept Exception as e: exit(e.errno)'
+Type=oneshot
+SystemCallFilter=~uname:EILSEQ
+SystemCallErrorNumber=EACCES
diff --git a/test/test-execute/exec-systemcallfilter-with-errno-number.service b/test/test-execute/exec-systemcallfilter-with-errno-number.service
new file mode 100644
index 0000000000..6e5019d593
--- /dev/null
+++ b/test/test-execute/exec-systemcallfilter-with-errno-number.service
@@ -0,0 +1,8 @@
+[Unit]
+Description=Test for SystemCallFilter with errno number
+
+[Service]
+ExecStart=/bin/python3 -c 'import os\ntry: os.uname()\nexcept Exception as e: exit(e.errno)'
+Type=oneshot
+SystemCallFilter=~uname:255
+SystemCallErrorNumber=EACCES