[LTP] migrate_pages01: Convert to new API
linuxtestproject.agent@gmail.com
linuxtestproject.agent@gmail.com
Tue Nov 24 17:29:36 CET 2026
Hi Pradeep,
On Tue Nov 24 13:12:37 2026 +0000, Pradeep Susarla <pradeep.susarla@gmail.com> wrote:
> migrate_pages01: Convert to new API
> + if (!SAFE_FORK()) {
> + SAFE_SETUID(ltpuser->pw_uid);
> + TST_EXP_FAIL(sys_migrate_pages(parent_pid, sane_max_node,
> + sane_old_nodes, sane_new_nodes),
> + EPERM, "migrate_pages() of root process as %s",
> + ltpuser->pw_name);
> + exit(0);
> + }
> +
> + tst_reap_children();
The explicit tst_reap_children() call is redundant because the LTP test
framework automatically reaps child processes after each test invocation.
Drop the tst_reap_children() call here.
> +static void run(void)
> +{
> + verify_sane_nodes();
> + verify_invalid_pid();
> + verify_invalid_masksize();
> + verify_invalid_mem();
> + verify_invalid_nodes();
> + verify_invalid_perm();
> +}
Instead of defining separate verify_*() functions called manually from
run() with .test_all, define a struct tcase array and dispatch the test
cases through .test and .tcnt = ARRAY_SIZE(tcases).
> #else
> -int main(void)
> -{
> - tst_brkm(TCONF, NULL, NUMA_ERROR_MSG);
> -}
> +TST_TEST_TCONF(NUMA_ERROR_MSG);
> #endif
TST_TEST_TCONF() requires a human-readable string literal instead of a
macro constant like NUMA_ERROR_MSG, e.g.
TST_TEST_TCONF("requires libnuma >= 2").
Verdict - Needs revision
---
Note:
The agent can sometimes produce false positives although often its
findings are genuine. If you find issues with the review, please
comment this email or ignore the suggestions.
Regards,
LTP AI Reviewer
More information about the ltp
mailing list