From: Dmitry V. Levin Date: Mon, 5 Nov 2018 17:40:36 +0000 (+0000) Subject: tests: extend test coverage of RND* ioctl commands X-Git-Tag: v4.26~88 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f9e5f12b7c2d1d54abaa911a0047d08d7bd5d407;p=strace 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. --- 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; }