This commit adds unit tests for the internal function
cg_build_path(). While code coverage is not (yet) enabled,
I believe these tests provide full code coverage for the
aforementioned function and its sister function
cg_build_path_locked().
The following tests are in this commit:
BuildPathV1_ControllerMismatch() - Calls cg_build_path() with a
controller that isn't in cg_mount_table[]. Expects a return
value of NULL
BuildPathV1_ControllerMatch() - Calls cg_build_path() with a valid
controller in cg_mount_table[]
BuildPathV1_ControllerMatchWithName() - Calls cg_build_path() with
a valid controller and a cgroup name
BuildPathV1_ControllerMatchWithNs() - Calls cg_build_path() with a
valid controller that has a namespace
BuildPathV1_ControllerMatchWithNameAndNs() - Calls cg_build_path()
with a valid controller, a cgroup name, and the controller has
a namespace
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com> Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>