summaryrefslogtreecommitdiffstats
path: root/vendor/golang.org/x/sys/unix/syscall_linux_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/golang.org/x/sys/unix/syscall_linux_test.go')
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_linux_test.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_test.go b/vendor/golang.org/x/sys/unix/syscall_linux_test.go
index 91184cae0..e42b4ee68 100644
--- a/vendor/golang.org/x/sys/unix/syscall_linux_test.go
+++ b/vendor/golang.org/x/sys/unix/syscall_linux_test.go
@@ -15,6 +15,21 @@ import (
"golang.org/x/sys/unix"
)
+func TestIoctlGetInt(t *testing.T) {
+ f, err := os.Open("/dev/random")
+ if err != nil {
+ t.Fatalf("failed to open device: %v", err)
+ }
+ defer f.Close()
+
+ v, err := unix.IoctlGetInt(int(f.Fd()), unix.RNDGETENTCNT)
+ if err != nil {
+ t.Fatalf("failed to perform ioctl: %v", err)
+ }
+
+ t.Logf("%d bits of entropy available", v)
+}
+
func TestPoll(t *testing.T) {
f, cleanup := mktmpfifo(t)
defer cleanup()