(t *testing.T)
| 20 | ) |
| 21 | |
| 22 | func 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 | |
| 44 | func TestSysctlStrings(t *testing.T) { |
| 45 | fs := getProcFixtures(t) |
nothing calls this directly
no test coverage detected