(t *testing.T)
| 22 | const procfsFixtures = "testdata/fixtures/proc" |
| 23 | |
| 24 | func TestKernelRandom(t *testing.T) { |
| 25 | fs, err := NewFS(procfsFixtures) |
| 26 | if err != nil { |
| 27 | t.Fatalf("failed to access %s: %v", procfsFixtures, err) |
| 28 | } |
| 29 | |
| 30 | random, err := fs.KernelRandom() |
| 31 | if err != nil { |
| 32 | t.Fatalf("failed to collect %s/sys/kernel/random: %v", procfsFixtures, err) |
| 33 | } |
| 34 | |
| 35 | if *random.EntropyAvaliable != 3943 { |
| 36 | t.Errorf("entropy_avail, want %d got %d", 3943, *random.EntropyAvaliable) |
| 37 | } |
| 38 | if *random.PoolSize != 4096 { |
| 39 | t.Errorf("poolsize, want %d got %d", 4096, *random.PoolSize) |
| 40 | } |
| 41 | if *random.URandomMinReseedSeconds != 60 { |
| 42 | t.Errorf("urandom_min_reseed_secs, want %d got %d", 60, *random.URandomMinReseedSeconds) |
| 43 | } |
| 44 | if *random.WriteWakeupThreshold != 3072 { |
| 45 | t.Errorf("write_wakeup_threshold, want %d got %d", 3072, *random.WriteWakeupThreshold) |
| 46 | } |
| 47 | if random.ReadWakeupThreshold != nil { |
| 48 | t.Errorf("read_wakeup_threshold, want %v got %d", nil, *random.ReadWakeupThreshold) |
| 49 | } |
| 50 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…