summaryrefslogtreecommitdiff
path: root/integrationtests/dir_test.go
blob: 585f03fc7f5bfdfc03a916b282b010d2c43f4dc5 (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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
package integrationtests

import "testing"

func TestDirBasic(t *testing.T) {
	runScenario(t, "dir-basic", []ExpectedEvent{
		{
			PathContains: "subdir",
			Tracepoint:   "enter_mkdir",
			Comm:         "ioworkload",
			MinCount:     1,
		},
	})
}

func TestDirMkdirat(t *testing.T) {
	runScenario(t, "dir-mkdirat", []ExpectedEvent{
		{
			PathContains: "mkdirat-subdir",
			Tracepoint:   "enter_mkdirat",
			Comm:         "ioworkload",
			MinCount:     1,
		},
	})
}

func TestDirChdir(t *testing.T) {
	runScenario(t, "dir-chdir", []ExpectedEvent{
		{
			PathContains: "dir-chdir",
			Tracepoint:   "enter_chdir",
			Comm:         "ioworkload",
			MinCount:     1,
		},
	})
}

func TestDirGetdents(t *testing.T) {
	runScenario(t, "dir-getdents", []ExpectedEvent{
		{
			PathContains: "dir-getdents",
			Tracepoint:   "enter_getdents64",
			Comm:         "ioworkload",
			MinCount:     1,
		},
	})
}

func TestDirMkdirEexist(t *testing.T) {
	runScenario(t, "dir-mkdir-eexist", []ExpectedEvent{
		{
			PathContains: "mkdir-eexist-subdir",
			Tracepoint:   "enter_mkdir",
			Comm:         "ioworkload",
			MinCount:     2,
		},
	})
}

func TestDirChdirEnoent(t *testing.T) {
	runScenario(t, "dir-chdir-enoent", []ExpectedEvent{
		{
			PathContains: "chdir-enoent-missing",
			Tracepoint:   "enter_chdir",
			Comm:         "ioworkload",
			MinCount:     1,
		},
	})
}

func TestDirGetdentsEbadf(t *testing.T) {
	runScenario(t, "dir-getdents-ebadf", []ExpectedEvent{
		{
			Tracepoint: "enter_getdents64",
			Comm:       "ioworkload",
			MinCount:   1,
		},
	})
}