@@ -42,20 +42,23 @@ function scmp_act_notify_template() {
4242# noNewPrivileges, for this reason many of the following cases are tested with
4343# both values.
4444
45+ # Test basic actions handled by the agent work fine. noNewPrivileges FALSE.
4546@test " runc run [seccomp] (SCMP_ACT_NOTIFY noNewPrivileges false)" {
4647 scmp_act_notify_template " mkdir /dev/shm/foo && stat /dev/shm/foo-bar" false ' "mkdir"'
4748
4849 runc run test_busybox
4950 [ " $status " -eq 0 ]
5051}
5152
53+ # Test basic actions handled by the agent work fine. noNewPrivileges TRUE.
5254@test " runc run [seccomp] (SCMP_ACT_NOTIFY noNewPrivileges true)" {
5355 scmp_act_notify_template " mkdir /dev/shm/foo && stat /dev/shm/foo-bar" true ' "mkdir"'
5456
5557 runc run test_busybox
5658 [ " $status " -eq 0 ]
5759}
5860
61+ # Test actions not-handled by the agent work fine. noNewPrivileges FALSE.
5962@test " runc exec [seccomp] (SCMP_ACT_NOTIFY noNewPrivileges false)" {
6063 requires root
6164
@@ -68,6 +71,7 @@ function scmp_act_notify_template() {
6871 [ " $status " -eq 0 ]
6972}
7073
74+ # Test actions not-handled by the agent work fine. noNewPrivileges TRUE.
7175@test " runc exec [seccomp] (SCMP_ACT_NOTIFY noNewPrivileges true)" {
7276 requires root
7377
@@ -78,13 +82,15 @@ function scmp_act_notify_template() {
7882 [ " $status " -eq 0 ]
7983}
8084
85+ # Test important syscalls (some might be executed by runc) work fine when handled by the agent. noNewPrivileges FALSE.
8186@test " runc run [seccomp] (SCMP_ACT_NOTIFY important syscalls noNewPrivileges false)" {
8287 scmp_act_notify_template " /bin/true" false ' "execve","openat","open","read","close"'
8388
8489 runc run test_busybox
8590 [ " $status " -eq 0 ]
8691}
8792
93+ # Test important syscalls (some might be executed by runc) work fine when handled by the agent. noNewPrivileges TRUE.
8894@test " runc run [seccomp] (SCMP_ACT_NOTIFY important syscalls noNewPrivileges true)" {
8995 scmp_act_notify_template " /bin/true" true ' "execve","openat","open","read","close"'
9096
@@ -105,14 +111,16 @@ function scmp_act_notify_template() {
105111 [ " $status " -eq 0 ]
106112}
107113
108- @test " runc run [seccomp] (SCMP_ACT_NOTIFY empty listener path)" {
114+ # Ensure listenerPath is present if the profile uses seccomp notify actions.
115+ @test " runc run [seccomp] (SCMP_ACT_NOTIFY empty listener path and notify act)" {
109116 scmp_act_notify_template " /bin/true" false ' "mkdir"'
110117 update_config ' .linux.seccomp.listenerPath = ""'
111118
112119 runc run test_busybox
113120 [ " $status " -ne 0 ]
114121}
115122
123+ # Test using an invalid socket (none listening) as listenerPath fails.
116124@test " runc run [seccomp] (SCMP_ACT_NOTIFY wrong listener path)" {
117125 scmp_act_notify_template " /bin/true" false ' "mkdir"'
118126 update_config ' .linux.seccomp.listenerPath = "/some-non-existing-listener-path.sock"'
@@ -121,7 +129,8 @@ function scmp_act_notify_template() {
121129 [ " $status " -ne 0 ]
122130}
123131
124- @test " runc run [seccomp] (SCMP_ACT_NOTIFY abstract listener path)" {
132+ # Test using an invalid abstract socket as listenerPath fails.
133+ @test " runc run [seccomp] (SCMP_ACT_NOTIFY wrong abstract listener path)" {
125134 scmp_act_notify_template " /bin/true" false ' "mkdir"'
126135 update_config ' .linux.seccomp.listenerPath = "@mysocketishere"'
127136
0 commit comments