]> granicus.if.org Git - strace/commitdiff
tests: extend test coverage of RND* ioctl commands
authorDmitry V. Levin <ldv@altlinux.org>
Mon, 5 Nov 2018 17:40:36 +0000 (17:40 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Mon, 5 Nov 2018 17:40:36 +0000 (17:40 +0000)
* tests/ioctl_random.c (main): Check the error path of RNDADDENTROPY
parser.  Check decoding of unrecognized RND* ioctl commands.

tests/ioctl_random.c

index 06545e85727d32bc442bb8819d602590936a099f..7382551eb6d17919be41d98b084ca4f49e1fb101 100644 (file)
@@ -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;
 }