Re: [PATCH v7 16/22] selftests/liveupdate: Add userspace API selftests

From: Mike Rapoport
Date: Mon Nov 24 2025 - 00:25:25 EST


On Sat, Nov 22, 2025 at 05:23:43PM -0500, Pasha Tatashin wrote:
> Introduce a selftest suite for LUO. These tests validate the core
> userspace-facing API provided by the /dev/liveupdate device and its
> associated ioctls.
>
> The suite covers fundamental device behavior, session management, and
> the file preservation mechanism using memfd as a test case. This
> provides regression testing for the LUO uAPI.
>
> The following functionality is verified:
>
> Device Access:
> Basic open and close operations on /dev/liveupdate.
> Enforcement of exclusive device access (verifying EBUSY on a
> second open).
>
> Session Management:
> Successful creation of sessions with unique names.
> Failure to create sessions with duplicate names.
>
> File Preservation:
> Preserving a single memfd and verifying its content remains
> intact post-preservation.
> Preserving multiple memfds within a single session, each with
> unique data.
> A complex scenario involving multiple sessions, each containing
> a mix of empty and data-filled memfds.
>
> Note: This test suite is limited to verifying the pre-kexec
> functionality of LUO (e.g., session creation, file preservation).
> The post-kexec restoration of resources is not covered, as the kselftest
> framework does not currently support orchestrating a reboot and
> continuing execution in the new kernel.
>
> Signed-off-by: Pasha Tatashin <pasha.tatashin@xxxxxxxxxx>

Reviewed-by: Mike Rapoport (Microsoft) <rppt@xxxxxxxxxx>

> ---
> MAINTAINERS | 1 +
> tools/testing/selftests/Makefile | 1 +
> tools/testing/selftests/liveupdate/.gitignore | 9 +
> tools/testing/selftests/liveupdate/Makefile | 27 ++
> tools/testing/selftests/liveupdate/config | 11 +
> .../testing/selftests/liveupdate/liveupdate.c | 348 ++++++++++++++++++
> 6 files changed, 397 insertions(+)
> create mode 100644 tools/testing/selftests/liveupdate/.gitignore
> create mode 100644 tools/testing/selftests/liveupdate/Makefile
> create mode 100644 tools/testing/selftests/liveupdate/config
> create mode 100644 tools/testing/selftests/liveupdate/liveupdate.c

--
Sincerely yours,
Mike.