Skip to content

Commit 6be088d

Browse files
committed
tests/int/dev: add CAP_SYSLOG to /dev/kmsg tests
Add CAP_SYSLOG to ensure that /dev/kmsg can be accesses on systems where the sysctl kernel.dmesg_restrict = 1. Signed-off-by: Odin Ugedal <[email protected]>
1 parent 5547b57 commit 6be088d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/integration/dev.bats

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ function teardown() {
3838

3939
update_config ' .linux.resources.devices = [{"allow": false, "access": "rwm"}]
4040
| .linux.devices = [{"path": "/dev/kmsg", "type": "c", "major": 1, "minor": 11}]
41+
| .process.capabilities.bounding += ["CAP_SYSLOG"]
42+
| .process.capabilities.effective += ["CAP_SYSLOG"]
43+
| .process.capabilities.inheritable += ["CAP_SYSLOG"]
44+
| .process.capabilities.permitted += ["CAP_SYSLOG"]
4145
| .process.args |= ["sh"]'
4246

4347
runc run -d --console-socket "$CONSOLE_SOCKET" test_deny
@@ -72,6 +76,10 @@ function teardown() {
7276
update_config ' .linux.resources.devices = [{"allow": false, "access": "rwm"},{"allow": true, "type": "c", "major": 1, "minor": 11, "access": "rw"}]
7377
| .linux.devices = [{"path": "/dev/kmsg", "type": "c", "major": 1, "minor": 11}]
7478
| .process.args |= ["sh"]
79+
| .process.capabilities.bounding += ["CAP_SYSLOG"]
80+
| .process.capabilities.effective += ["CAP_SYSLOG"]
81+
| .process.capabilities.inheritable += ["CAP_SYSLOG"]
82+
| .process.capabilities.permitted += ["CAP_SYSLOG"]
7583
| .hostname = "myhostname"'
7684

7785
runc run -d --console-socket "$CONSOLE_SOCKET" test_allow_char

0 commit comments

Comments
 (0)