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

Function TestSysctlIntsError

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

Source from the content-addressed store, hash-verified

63}
64
65func TestSysctlIntsError(t *testing.T) {
66 fs := getProcFixtures(t)
67
68 for _, tc := range []struct {
69 sysctl string
70 want string
71 }{
72 {"kernel.seccomp.actions_avail", "error parsing file: field 0 in sysctl kernel.seccomp.actions_avail is not a valid int: strconv.ParseInt: parsing \"kill_process\": invalid syntax"},
73 } {
74 t.Run(tc.sysctl, func(t *testing.T) {
75 _, err := fs.SysctlInts(tc.sysctl)
76 if err == nil {
77 t.Fatal("Error Parsing File: expected error")
78 }
79 if diff := cmp.Diff(tc.want, err.Error()); diff != "" {
80 t.Fatalf("unexpected syscall value(-want +got):\n%s", diff)
81 }
82 })
83 }
84}

Callers

nothing calls this directly

Calls 2

getProcFixturesFunction · 0.85
SysctlIntsMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…