mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-09-11 04:32:29 -04:00
selftests/cgroup: fix missing TAP output in test_hugetlb_memcg
main() in test_hugetlb_memcg never calls ksft_print_header(), ksft_set_plan(), or ksft_finished(), so its output has no TAP plan and is not valid TAP, unlike the sibling test_memcontrol and test_kmem tests. Add the header/plan/finished calls following the same pattern. Signed-off-by: Song Hu <husong@kylinos.cn> Reviewed-by: Tao Cui <cuitao@kylinos.cn> Signed-off-by: Tejun Heo <tj@kernel.org>
This commit is contained in:
@@ -199,7 +199,10 @@ static int test_hugetlb_memcg(char *root)
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
char root[PATH_MAX];
|
||||
int ret = EXIT_SUCCESS, has_memory_hugetlb_acc;
|
||||
int has_memory_hugetlb_acc;
|
||||
|
||||
ksft_print_header();
|
||||
ksft_set_plan(1);
|
||||
|
||||
has_memory_hugetlb_acc = proc_mount_contains("memory_hugetlb_accounting");
|
||||
if (has_memory_hugetlb_acc < 0)
|
||||
@@ -211,7 +214,7 @@ int main(int argc, char **argv)
|
||||
if (get_hugepage_size() != 2048) {
|
||||
ksft_print_msg("test_hugetlb_memcg requires 2MB hugepages\n");
|
||||
ksft_test_result_skip("test_hugetlb_memcg\n");
|
||||
return ret;
|
||||
ksft_finished();
|
||||
}
|
||||
|
||||
if (cg_find_unified_root(root, sizeof(root), NULL))
|
||||
@@ -233,10 +236,9 @@ int main(int argc, char **argv)
|
||||
ksft_test_result_skip("test_hugetlb_memcg\n");
|
||||
break;
|
||||
default:
|
||||
ret = EXIT_FAILURE;
|
||||
ksft_test_result_fail("test_hugetlb_memcg\n");
|
||||
break;
|
||||
}
|
||||
|
||||
return ret;
|
||||
ksft_finished();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user