summaryrefslogtreecommitdiff
path: root/integrationtests/fcntl_test.go
blob: 5062bd6e09b30a9953192e391f55fed41316c02a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
package integrationtests

import "testing"

func TestFcntlDupfd(t *testing.T) {
	runScenario(t, "fcntl-dupfd", []ExpectedEvent{
		{
			PathContains: "fcntlfile.txt",
			Tracepoint:   "enter_fcntl",
			Comm:         "ioworkload",
			MinCount:     1,
		},
	})
}

func TestFcntlSetfl(t *testing.T) {
	runScenario(t, "fcntl-setfl", []ExpectedEvent{
		{
			PathContains: "fcntlsetflfile.txt",
			Tracepoint:   "enter_fcntl",
			Comm:         "ioworkload",
			MinCount:     2,
		},
	})
}

func TestFcntlDupfdCloexec(t *testing.T) {
	runScenario(t, "fcntl-dupfd-cloexec", []ExpectedEvent{
		{
			PathContains: "fcntlcloexecfile.txt",
			Tracepoint:   "enter_fcntl",
			Comm:         "ioworkload",
			MinCount:     1,
		},
	})
}

func TestFcntlInvalidFd(t *testing.T) {
	runScenario(t, "fcntl-invalid-fd", []ExpectedEvent{
		{
			Tracepoint: "enter_fcntl",
			Comm:       "ioworkload",
			MinCount:   1,
		},
	})
}

func TestFcntlDupfdMax(t *testing.T) {
	runScenario(t, "fcntl-dupfd-max", []ExpectedEvent{
		{
			PathContains: "fcntldupfdmaxfile.txt",
			Tracepoint:   "enter_fcntl",
			Comm:         "ioworkload",
			MinCount:     1,
		},
	})
}