MCPcopy Create free account
hub / github.com/prometheus/procfs / TestSysctlStrings

Function TestSysctlStrings

proc_sys_test.go:44–63  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

42}
43
44func TestSysctlStrings(t *testing.T) {
45 fs := getProcFixtures(t)
46
47 for _, tc := range []struct {
48 sysctl string
49 want []string
50 }{
51 {"kernel.seccomp.actions_avail", []string{"kill_process", "kill_thread", "trap", "errno", "trace", "log", "allow"}},
52 } {
53 t.Run(tc.sysctl, func(t *testing.T) {
54 got, err := fs.SysctlStrings(tc.sysctl)
55 if err != nil {
56 t.Fatal(err)
57 }
58 if diff := cmp.Diff(tc.want, got); diff != "" {
59 t.Fatalf("unexpected syscall value(-want +got):\n%s", diff)
60 }
61 })
62 }
63}
64
65func TestSysctlIntsError(t *testing.T) {
66 fs := getProcFixtures(t)

Callers

nothing calls this directly

Calls 2

getProcFixturesFunction · 0.85
SysctlStringsMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…