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

Function TestSysctlInts

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

Source from the content-addressed store, hash-verified

20)
21
22func TestSysctlInts(t *testing.T) {
23 fs := getProcFixtures(t)
24
25 for _, tc := range []struct {
26 sysctl string
27 want []int
28 }{
29 {"kernel.random.entropy_avail", []int{3943}},
30 {"vm.lowmem_reserve_ratio", []int{256, 256, 32, 0, 0}},
31 } {
32 t.Run(tc.sysctl, func(t *testing.T) {
33 got, err := fs.SysctlInts(tc.sysctl)
34 if err != nil {
35 t.Fatal(err)
36 }
37 if diff := cmp.Diff(tc.want, got); diff != "" {
38 t.Fatalf("unexpected syscall value(-want +got):\n%s", diff)
39 }
40 })
41 }
42}
43
44func TestSysctlStrings(t *testing.T) {
45 fs := getProcFixtures(t)

Callers

nothing calls this directly

Calls 2

getProcFixturesFunction · 0.85
SysctlIntsMethod · 0.80

Tested by

no test coverage detected