Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/kernel Stress rump hyperentropy a little harder.



details:   https://anonhg.NetBSD.org/src/rev/239a66603110
branches:  trunk
changeset: 352975:239a66603110
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Apr 16 18:24:23 2017 +0000

description:
Stress rump hyperentropy a little harder.

diffstat:

 tests/kernel/t_rnd.c |  14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diffs (44 lines):

diff -r 8e9e23127f72 -r 239a66603110 tests/kernel/t_rnd.c
--- a/tests/kernel/t_rnd.c      Sun Apr 16 18:05:35 2017 +0000
+++ b/tests/kernel/t_rnd.c      Sun Apr 16 18:24:23 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: t_rnd.c,v 1.10 2017/01/13 21:30:41 christos Exp $      */
+/*     $NetBSD: t_rnd.c,v 1.11 2017/04/16 18:24:23 riastradh Exp $     */
 
 /*
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: t_rnd.c,v 1.10 2017/01/13 21:30:41 christos Exp $");
+__RCSID("$NetBSD: t_rnd.c,v 1.11 2017/04/16 18:24:23 riastradh Exp $");
 
 #include <sys/types.h>
 #include <sys/fcntl.h>
@@ -35,6 +35,7 @@
 #include <sys/rndio.h>
 
 #include <atf-c.h>
+#include <unistd.h>
 
 #include <rump/rump.h>
 #include <rump/rump_syscalls.h>
@@ -98,10 +99,15 @@
 {
        char buf[128];
        int fd;
+       unsigned i;
 
        rump_init();
-       RL(fd = rump_sys_open("/dev/random", O_RDONLY));
-       RL(rump_sys_read(fd, buf, sizeof(buf)));
+       for (i = 0; i < 1000; i++) {
+               alarm(2);
+               RL(fd = rump_sys_open("/dev/random", RUMP_O_RDONLY));
+               RL(rump_sys_read(fd, buf, sizeof(buf)));
+               RZ(rump_sys_close(fd));
+       }
 }
 
 ATF_TP_ADD_TCS(tp)



Home | Main Index | Thread Index | Old Index