Re: [PATCH v7 18/22] selftests/liveupdate: Add kexec test for multiple and empty sessions

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


On Sat, Nov 22, 2025 at 05:23:45PM -0500, Pasha Tatashin wrote:
> Introduce a new kexec-based selftest, luo_kexec_multi_session, to
> validate the end-to-end lifecycle of a more complex LUO scenario.
>
> While the existing luo_kexec_simple test covers the basic end-to-end
> lifecycle, it is limited to a single session with one preserved file.
> This new test significantly expands coverage by verifying LUO's ability
> to handle a mixed workload involving multiple sessions, some of which
> are intentionally empty. This ensures that the LUO core correctly
> preserves and restores the state of all session types across a reboot.
>
> The test validates the following sequence:
>
> Stage 1 (Pre-kexec):
>
> - Creates two empty test sessions (multi-test-empty-1,
> multi-test-empty-2).
> - Creates a session with one preserved memfd (multi-test-files-1).
> - Creates another session with two preserved memfds
> (multi-test-files-2), each containing unique data.
> - Creates a state-tracking session to manage the transition to
> Stage 2.
> - Executes a kexec reboot via the helper script.
>
> Stage 2 (Post-kexec):
>
> - Retrieves the state-tracking session to confirm it is in the
> post-reboot stage.
> - Retrieves all four test sessions (both the empty and non-empty
> ones).
> - For the non-empty sessions, restores the preserved memfds and
> verifies their contents match the original data patterns.
> - Finalizes all test sessions and the state session to ensure a clean
> teardown and that all associated kernel resources are correctly
> released.
>
> This test provides greater confidence in the robustness of the LUO
> framework by validating its behavior in a more realistic, multi-faceted
> scenario.
>
> Signed-off-by: Pasha Tatashin <pasha.tatashin@xxxxxxxxxx>

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

> ---
> tools/testing/selftests/liveupdate/Makefile | 1 +
> .../selftests/liveupdate/luo_multi_session.c | 162 ++++++++++++++++++
> 2 files changed, 163 insertions(+)
> create mode 100644 tools/testing/selftests/liveupdate/luo_multi_session.c

--
Sincerely yours,
Mike.