summaryrefslogtreecommitdiff
path: root/integrationtests
diff options
context:
space:
mode:
Diffstat (limited to 'integrationtests')
-rw-r--r--integrationtests/chmod_test.go32
1 files changed, 32 insertions, 0 deletions
diff --git a/integrationtests/chmod_test.go b/integrationtests/chmod_test.go
new file mode 100644
index 0000000..7c08be8
--- /dev/null
+++ b/integrationtests/chmod_test.go
@@ -0,0 +1,32 @@
+package integrationtests
+
+import "testing"
+
+// TestChmodBasic verifies ior captures the chmod permission-change family
+// end-to-end. chmod and fchmodat take a real filesystem path (args[0] and
+// args[1] respectively), so both must be path-classified (KindPathname) and
+// the file path captured. fchmod operates on an open fd (KindFd) and carries
+// no path, so we only assert the tracepoint fired. fchmodat2 is best-effort
+// (ENOSYS on kernels < 6.6) and not asserted; the running kernel is 6.x+, so
+// it does fire in practice, but the older siblings are the stable assertions.
+func TestChmodBasic(t *testing.T) {
+ runScenario(t, "chmod-basic", []ExpectedEvent{
+ {
+ PathContains: "chmodfile.txt",
+ Tracepoint: "enter_chmod",
+ Comm: "ioworkload",
+ MinCount: 1,
+ },
+ {
+ PathContains: "chmodfile.txt",
+ Tracepoint: "enter_fchmodat",
+ Comm: "ioworkload",
+ MinCount: 1,
+ },
+ {
+ Tracepoint: "enter_fchmod",
+ Comm: "ioworkload",
+ MinCount: 1,
+ },
+ })
+}