On Thu, May 15, 2025 at 06:23:17PM +0000, Pasha Tatashin wrote: > Introduce a self-test mechanism for the LUO to allow verification of > core subsystem management functionality. This is primarily intended > for developers and system integrators validating the live update > feature. > > The tests are enabled via the new Kconfig option > CONFIG_LIVEUPDATE_SELFTESTS (default 'n') and are triggered through > a new ioctl command, LIVEUPDATE_IOCTL_SELFTESTS, added to the > /dev/liveupdate device node. > > This ioctl accepts commands defined in luo_selftests.h to: > - LUO_CMD_SUBSYSTEM_REGISTER: Creates and registers a dummy LUO > subsystem using the liveupdate_register_subsystem() function. It > allocates a data page and copies initial data from userspace. > - LUO_CMD_SUBSYSTEM_UNREGISTER: Unregisters the specified dummy > subsystem using the liveupdate_unregister_subsystem() function and > cleans up associated test resources. > - LUO_CMD_SUBSYSTEM_GETDATA: Copies the data page associated with a > registered test subsystem back to userspace, allowing verification of > data potentially modified or preserved by test callbacks. > This provides a way to test the fundamental registration and > unregistration flows within the LUO framework from userspace without > requiring a full live update sequence. I don't think ioctl for selftest is a good idea. Can't we test register/unregister and state machine transitions with kunit? And have a separate test module that registers as a subsystem, preserves it's state and then verifies the state after the reboot. This will require running qemu and qemu usage in tools/testing is a mess right now, but still. -- Sincerely yours, Mike.