[PATCH v3 3/3] selftests/nommu: add nommu mmap and mremap behavior tests

Mark Brown broonie at kernel.org
Mon Sep 28 05:34:15 PDT 2026


On Sat, Sep 26, 2026 at 10:08:19AM +0900, Hajime Tazaki wrote:
> Introduce a kselftest utility to validate memory mapping capabilities
> under nommu kernels, aligned with
> Documentation/admin-guide/mm/nommu-mmap.rst.

> +static int run_mapping_matrix_test(struct test_case_t *tcase)
> +{
> +	int fd;
> +	void *ptr;
> +	char path_buf[PATH_MAX];
> +	const char *path = tcase->pathname;
> +	int rc = KSFT_PASS;
> +	int expected_error;
> +
> +	ksft_print_msg("[RUN] Testing: %s\n", tcase->name);

> +		if (fd < 0) {
> +			ksft_test_result_skip("Failed to setup temp node: %s\n",
> +					      tcase->pathname);

Your test reports should use a consistant string when reporting the
result for a given test, that way tooling can tie results together
between different runs.  Report the diagnostic information with a
separate print.

> +	if (result == KSFT_PASS)
> +		ksft_finished();
> +
> +	ksft_exit_fail();
> +}

Just unconditionally call ksft_finshed(), it will check the counts of
reported tests and exit with an appropriate error code - you don't need
to manually collate the results in your test code.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-um/attachments/20260928/f2468768/attachment.sig>


More information about the linux-um mailing list