]> git.ipfire.org Git - thirdparty/libcgroup.git/commit
tests/gunit: Add a simple fuzzer
authorKamalesh Babulal <kamalesh.babulal@oracle.com>
Tue, 31 Jan 2023 18:27:22 +0000 (11:27 -0700)
committerTom Hromatka <tom.hromatka@oracle.com>
Tue, 31 Jan 2023 18:27:27 +0000 (11:27 -0700)
commitdac22679ee3e888be5dedc50e22e0d001bfceb4a
treee11817aeecc7ef19145a3a5e6cfc321cb00cae07
parent9795cdf9c18878388b9aa5c428c29eca8d6ad0a7
tests/gunit: Add a simple fuzzer

Add a simple fuzzing test case that would exercise API's unlikely code
paths by passing NULL/negative values as arguments.

Output:
--------
[...]

[----------] 1 test from APIArgsTest
[ RUN      ] APIArgsTest.API_cgroup_set_permissions
[       OK ] APIArgsTest.API_cgroup_set_permissions (0 ms)
[----------] 1 test from APIArgsTest (0 ms total)

to begin with, it exercises cgroup_set_permissions() by passing a NULL
pointer in place of struct cgroup. This test case will be extended to
cover almost all APIs.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
tests/gunit/017-API_fuzz_test.cpp [new file with mode: 0644]
tests/gunit/Makefile.am