]> 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:30:56 +0000 (11:30 -0700)
committerTom Hromatka <tom.hromatka@oracle.com>
Tue, 31 Jan 2023 18:31:03 +0000 (11:31 -0700)
commit2611ac7f94c5f234a22cd670908da6ab46aa88fe
treea6d1d4d4b8077336dae41d21f57b4d8db278eb84
parent34e98305dd2522a4cb5b5bfd59c9dbc53c5ef540
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>
(cherry picked from commit dac22679ee3e888be5dedc50e22e0d001bfceb4a)
tests/gunit/017-API_fuzz_test.cpp [new file with mode: 0644]
tests/gunit/Makefile.am