Module Name:    src
Committed By:   riastradh
Date:           Sun Apr 16 18:24:23 UTC 2017

Modified Files:
        src/tests/kernel: t_rnd.c

Log Message:
Stress rump hyperentropy a little harder.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/tests/kernel/t_rnd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/kernel/t_rnd.c
diff -u src/tests/kernel/t_rnd.c:1.10 src/tests/kernel/t_rnd.c:1.11
--- src/tests/kernel/t_rnd.c:1.10	Fri Jan 13 21:30:41 2017
+++ src/tests/kernel/t_rnd.c	Sun Apr 16 18:24:23 2017
@@ -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 @@ __RCSID("$NetBSD: t_rnd.c,v 1.10 2017/01
 #include <sys/rndio.h>
 
 #include <atf-c.h>
+#include <unistd.h>
 
 #include <rump/rump.h>
 #include <rump/rump_syscalls.h>
@@ -98,10 +99,15 @@ ATF_TC_BODY(read_random, tc)
 {
 	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)

Reply via email to