summaryrefslogtreecommitdiff
path: root/integrationtests
diff options
context:
space:
mode:
Diffstat (limited to 'integrationtests')
-rw-r--r--integrationtests/mountfs_test.go8
-rw-r--r--integrationtests/retbytes_test.go11
2 files changed, 17 insertions, 2 deletions
diff --git a/integrationtests/mountfs_test.go b/integrationtests/mountfs_test.go
index 69a19fd..a32cda7 100644
--- a/integrationtests/mountfs_test.go
+++ b/integrationtests/mountfs_test.go
@@ -4,7 +4,7 @@ import "testing"
var mountfsTraceArgs = []string{
"-trace-syscalls",
- "mount,umount,move_mount,fsopen,fsconfig,fspick,open_tree,fsmount,pivot_root,quotactl,quotactl_fd,statmount,listmount,listns,swapon,swapoff",
+ "mount,umount,move_mount,fsopen,fsconfig,fspick,open_tree,mount_setattr,fsmount,pivot_root,quotactl,quotactl_fd,statmount,listmount,listns,swapon,swapoff",
}
func TestMountFsManagementSyscalls(t *testing.T) {
@@ -20,6 +20,12 @@ func TestMountFsManagementSyscalls(t *testing.T) {
{Tracepoint: "enter_fsconfig", MinCount: 1},
{Tracepoint: "enter_fspick", MinCount: 1},
{Tracepoint: "enter_open_tree", MinCount: 1},
+ // mount_setattr (KindPathname, path@arg1) changes per-mount attributes
+ // of an existing mount and needs CAP_SYS_ADMIN (Linux 5.12+), so it
+ // returns EPERM/EINVAL in the scenario. Its sys_enter_ tracepoint fires
+ // on kernel entry regardless of permission/validity, so MinCount>=1
+ // holds even though the call itself fails.
+ {Tracepoint: "enter_mount_setattr", MinCount: 1},
{Tracepoint: "enter_fsmount", MinCount: 1},
{Tracepoint: "enter_pivot_root", MinCount: 1},
{Tracepoint: "enter_quotactl", MinCount: 1},
diff --git a/integrationtests/retbytes_test.go b/integrationtests/retbytes_test.go
index a7cb45a..9b2b55c 100644
--- a/integrationtests/retbytes_test.go
+++ b/integrationtests/retbytes_test.go
@@ -2,7 +2,7 @@ package integrationtests
import "testing"
-var retbytesTraceArgs = []string{"-trace-syscalls", "sendto,recvfrom,sendmsg,recvmsg,sendmmsg,recvmmsg,sendfile64,splice,tee,process_vm_writev,process_vm_readv,socketpair,pipe2,openat,write,read,close,lseek,fcntl,unlinkat,mkdirat,getdents64,readlinkat,symlink"}
+var retbytesTraceArgs = []string{"-trace-syscalls", "sendto,recvfrom,sendmsg,recvmsg,sendmmsg,recvmmsg,sendfile64,splice,tee,vmsplice,process_vm_writev,process_vm_readv,socketpair,pipe2,openat,write,read,close,lseek,fcntl,unlinkat,mkdirat,getdents64,readlinkat,symlink"}
func TestRetbytesPhaseA(t *testing.T) {
const payloadLen = uint64(18)
@@ -21,6 +21,7 @@ func TestRetbytesPhaseA(t *testing.T) {
{Tracepoint: "enter_process_vm_readv", Comm: "ioworkload", MinCount: 1},
{Tracepoint: "enter_getdents64", Comm: "ioworkload", MinCount: 1},
{Tracepoint: "enter_readlinkat", Comm: "ioworkload", MinCount: 1},
+ {Tracepoint: "enter_vmsplice", Comm: "ioworkload", MinCount: 1},
}, retbytesTraceArgs)
for _, tracepoint := range []string{
@@ -62,4 +63,12 @@ func TestRetbytesPhaseA(t *testing.T) {
readlinkatExp := ExpectedEvent{Tracepoint: "enter_readlinkat", Comm: "ioworkload"}
assertEventBytesAtLeast(t, result, readlinkatExp, 1)
assertEventDurationPositive(t, result, readlinkatExp)
+
+ // vmsplice is TRANSFER_CLASSIFIED: a successful gather of the user iovec
+ // into the pipe reports ctx->ret = bytes moved. The retbytes driver gathers
+ // exactly payloadLen (18) bytes each iteration, so the exit byte count is at
+ // least that. This locks in the TRANSFER byte attribution like splice/tee.
+ vmspliceExp := ExpectedEvent{Tracepoint: "enter_vmsplice", Comm: "ioworkload"}
+ assertEventBytesAtLeast(t, result, vmspliceExp, payloadLen)
+ assertEventDurationPositive(t, result, vmspliceExp)
}