# Re: \[PATCH v8 2/9\] selftests/livepatch: Adapt atomic replace tests to provides/obsoletes

- From: Song Liu \<song@kernel.org\>
- Date: 2026-09-09 05:28:12 
- List: live-patching
- Page: https://ratatoskr.run/live-patching/2026/09/17535296
- Thread: https://ratatoskr.run/live-patching/2026/09/17534879/t.md

```text
On Tue, Sep 8, 2026 at 7:43 PM Yafang Shao [ref] wrote:
>
> The legacy "replace" field in struct klp_patch will be replaced by the
> provides/obsoletes mechanism. As a result, the atomic replace
> selftests fail to build against kernels that only support
> provides/obsoletes.
>
> Adapt the selftests so that they build and run on both old and new
> kernels.  On kernels without the legacy "replace" support, the
> replace-related test cases are skipped with a SKIP message instead
> of being run.
>
> The provides/obsoletes based selftests will be added later after the
> provides/obsoletes are substituted.
>
> Suggested-by: Petr Mladek <pmladek@suse.com>
> Signed-off-by: Yafang Shao <redacted>

Shall we add functions for code blocks inside

   if [[ "$HAS_PROVIDES_ATTR" != "1" ]]; then

etc.?

Other than this.

Acked-by: Song Liu <song@kernel.org>
```
