summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--integrationtests/ipc_sysv_test.go9
-rw-r--r--integrationtests/pidfd_test.go12
-rw-r--r--integrationtests/sched_test.go1
-rw-r--r--integrationtests/signals_test.go2
4 files changed, 24 insertions, 0 deletions
diff --git a/integrationtests/ipc_sysv_test.go b/integrationtests/ipc_sysv_test.go
index d5f4fa9..8f21567 100644
--- a/integrationtests/ipc_sysv_test.go
+++ b/integrationtests/ipc_sysv_test.go
@@ -68,6 +68,15 @@ func TestSysVMsgBasic(t *testing.T) {
for _, tp := range []string{"enter_msgget", "enter_msgsnd", "enter_msgrcv", "enter_msgctl"} {
assertEventDurationPositive(t, result, ExpectedEvent{Tracepoint: tp, Comm: "ioworkload"})
}
+
+ // msgrcv is READ_CLASSIFIED: its exit handler reports ctx->ret, the number
+ // of bytes copied into the caller's buffer. The workload sends the literal
+ // "ior-sysv-msg" (12 bytes, scenario_sysv.go sysvMsgText) and reads it back,
+ // so the captured byte count must be at least the payload length. (msgsnd is
+ // UNCLASSIFIED, so only msgrcv carries a meaningful READ byte count.)
+ assertEventBytesAtLeast(t, result,
+ ExpectedEvent{Tracepoint: "enter_msgrcv", Comm: "ioworkload"},
+ uint64(len("ior-sysv-msg")))
}
// sysvSemTraceArgs restricts tracing to the SysV semaphore family so the
diff --git a/integrationtests/pidfd_test.go b/integrationtests/pidfd_test.go
index 6116035..8df2e13 100644
--- a/integrationtests/pidfd_test.go
+++ b/integrationtests/pidfd_test.go
@@ -4,6 +4,18 @@ import "testing"
var pidfdTraceArgs = []string{"-trace-syscalls", "pidfd_open,pidfd_getfd,openat,write,close"}
+// TestPidfdGetfdSuccess asserts the resolved path of the pidfd_getfd event is
+// the duplicated source file, NOT the pidfd's anon_inode.
+//
+// The BPF enter handler captures args[0] = the pidfd (correct: the pidfd is the
+// operand being acted on). One might therefore expect the resolved path to be
+// the self-pidfd's "anon_inode:[pidfd]". It is not, and the PathContains below
+// is deterministic and meaningful for a concrete reason: pidfd_getfd is an
+// fd-transfer op. At exit, applyFdTransferOp (internal/eventloop_exit.go) drops
+// the pidfd and re-points the event's file to the RETURNED fd (the duplicate of
+// the source fd). For a self-pidfd that returned fd lives in this same process
+// and refers to the very same open file, so /proc/<pid>/fd/<newfd> readlinks to
+// "pidfd-getfd-source.txt". Verified deterministic across repeated runs.
func TestPidfdGetfdSuccess(t *testing.T) {
runScenarioResultWithIorArgs(t, "pidfd-getfd-success", []ExpectedEvent{
{
diff --git a/integrationtests/sched_test.go b/integrationtests/sched_test.go
index 204db5a..025ae78 100644
--- a/integrationtests/sched_test.go
+++ b/integrationtests/sched_test.go
@@ -33,6 +33,7 @@ func TestSchedBasic(t *testing.T) {
AssertEventsPresent(t, result, []ExpectedEvent{
{Tracepoint: "enter_sched_yield", Comm: "ioworkload", MinCount: 1},
{Tracepoint: "enter_sched_getaffinity", Comm: "ioworkload", MinCount: 1},
+ {Tracepoint: "enter_sched_setaffinity", Comm: "ioworkload", MinCount: 1},
{Tracepoint: "enter_sched_getscheduler", Comm: "ioworkload", MinCount: 1},
{Tracepoint: "enter_sched_getparam", Comm: "ioworkload", MinCount: 1},
{Tracepoint: "enter_sched_rr_get_interval", Comm: "ioworkload", MinCount: 1},
diff --git a/integrationtests/signals_test.go b/integrationtests/signals_test.go
index 98840aa..eaddb18 100644
--- a/integrationtests/signals_test.go
+++ b/integrationtests/signals_test.go
@@ -32,6 +32,8 @@ func TestSignalsBasic(t *testing.T) {
{Tracepoint: "enter_sigaltstack", Comm: "ioworkload", MinCount: 1},
{Tracepoint: "enter_kill", Comm: "ioworkload", MinCount: 1},
{Tracepoint: "enter_tgkill", Comm: "ioworkload", MinCount: 1},
+ {Tracepoint: "enter_tkill", Comm: "ioworkload", MinCount: 1},
+ {Tracepoint: "enter_rt_sigqueueinfo", Comm: "ioworkload", MinCount: 1},
{Tracepoint: "enter_rt_sigtimedwait", Comm: "ioworkload", MinCount: 1},
})