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

- From: Yafang Shao \<hidden\>
- Date: 2026-09-09 06:59:52 
- List: live-patching
- Page: https://ratatoskr.run/live-patching/2026/09/17535746
- Thread: https://ratatoskr.run/live-patching/2026/09/17534879/t.md

```text
On Wed, Sep 9, 2026 at 1:28 PM Song Liu [ref] wrote:
>
> 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.?

Makes sense. It will be clearer.
I will rework it in the next version.

>
> Other than this.
>
> Acked-by: Song Liu <song@kernel.org>



-- 
Regards
Yafang
```
