From f9e5f12b7c2d1d54abaa911a0047d08d7bd5d407 Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Mon, 5 Nov 2018 17:40:36 +0000 Subject: [PATCH] tests: extend test coverage of RND* ioctl commands * tests/ioctl_random.c (main): Check the error path of RNDADDENTROPY parser. Check decoding of unrecognized RND* ioctl commands. --- tests/ioctl_random.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/ioctl_random.c b/tests/ioctl_random.c index 06545e85..7382551e 100644 --- a/tests/ioctl_random.c +++ b/tests/ioctl_random.c @@ -59,6 +59,9 @@ main(void) printf("ioctl(-1, RNDGETENTCNT, %p)" RVAL_EBADF, &cnt); ioctl(-1, RNDADDTOENTCNT, &cnt); printf("ioctl(-1, RNDADDTOENTCNT, [6])" RVAL_EBADF); + + ioctl(-1, RNDADDENTROPY, NULL); + printf("ioctl(-1, RNDADDENTROPY, NULL)" RVAL_EBADF); ioctl(-1, RNDADDENTROPY, info); printf("ioctl(-1, RNDADDENTROPY, {entropy_count=3, buf_size=8, buf=\"12345678\"})" RVAL_EBADF); @@ -69,6 +72,9 @@ main(void) ioctl(-1, RNDRESEEDCRNG); printf("ioctl(-1, RNDRESEEDCRNG)" RVAL_EBADF); + ioctl(-1, _IO('R', 0xff), NULL); + printf("ioctl(-1, _IOC(_IOC_NONE, %#x, 0xff, 0), 0)" RVAL_EBADF, 'R'); + puts("+++ exited with 0 +++"); return 0; } -- 2.40.0