@@ -2144,13 +2144,13 @@ struct tst_test test = {
.setup = setup,
.test_all = run,
.cleanup = cleanup,
- .needs_cgroup_controllers = (const char *const []){ "memory", NULL },
+ .needs_cgroup_ctrls = (const char *const []){ "memory", NULL },
...
};
-------------------------------------------------------------------------------
Above, we first ensure the memory controller is available on the
-test's CGroup with '.needs_cgroup_controllers'. This populates a structure,
+test's CGroup with '.needs_cgroup_ctrls'. This populates a structure,
'tst_cg', which represents the test's CGroup.
We then write the current processes PID into 'cgroup.procs', which
@@ -2217,7 +2217,7 @@ static void cleanup(void)
struct tst_test test = {
.setup = setup,
.test_all = run,
- .needs_cgroup_controllers = (const char *const []){
+ .needs_cgroup_ctrls = (const char *const []){
"cpuset",
"memory",
NULL
@@ -115,7 +115,7 @@ void tst_cg_print_config(void);
/* Ensure the specified controller is available in the test's default
* CGroup, mounting/enabling it if necessary. Usually this is not
- * necesary use tst_test.needs_cgroup_controllers instead.
+ * necessary use tst_test.needs_cgroup_ctrls instead.
*/
void tst_cg_require(const char *const ctrl_name,
const struct tst_cg_opts *const options)
@@ -1259,7 +1259,7 @@ static void do_setup(int argc, char *argv[])
if (tst_test->needs_cgroup_ctrls)
do_cgroup_requires();
else if (tst_test->needs_cgroup_ver)
- tst_brk(TBROK, "needs_cgroup_ver only works with needs_cgroup_controllers");
+ tst_brk(TBROK, "tst_test->needs_cgroup_ctrls must be set");
}
static void do_test_setup(void)
We only have needs_cgroup_ctrls instead of needs_cgroup_controllers in tst_test structure. So fix it. Signed-off-by: Yang Xu <xuyang2018.jy@fujitsu.com> --- I found it when I plan to write a cgroup regression test to ltp. doc/c-test-api.txt | 6 +++--- include/tst_cgroup.h | 2 +- lib/tst_test.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-)