Re: [PATCH v13 12/12] selftests/livepatch: introduce tests

Joe Lawrence
2018-10-15T19:47:02Z

On 10/15/2018 08:37 AM, Petr Mladek wrote:
> From: Joe Lawrence <joe.lawrence@redhat.com>
>
> Add a few livepatch modules and simple target modules that the included
> regression suite can run tests against:
>
> - basic livepatching (multiple patches, atomic replace)
> - pre/post (un)patch callbacks
> - shadow variable API
>
> Signed-off-by: Joe Lawrence <joe.lawrence@redhat.com>
> ---
>
> [ ... snip ... ]
>
> diff --git a/tools/testing/selftests/livepatch/functions.sh b/tools/testing/selftests/livepatch/functions.sh
> new file mode 100644
> index 000000000000..d448b115f06c
> --- /dev/null
> +++ b/tools/testing/selftests/livepatch/functions.sh
>
> [ ... snip ... ]
>
> +# disable_lp(modname) - disable a livepatch
> +# modname - module name to unload
> +function disable_lp() {
> + local mod="$1"
> +
> + log "% echo 0 > /sys/kernel/livepatch/$mod/enabled"
> + echo 0 > /sys/kernel/livepatch/"$mod"/enabled
> +
> + # Wait until the transition finishes and the livepatch gets
> + # removed from sysfs...
> + loop_until '[[ ! -e "/sys/kernel/livepatch/$mod" ]]' ||
> + die "failed to disable livepatch $mod"

small nit in case there is a v14:

Applying: selftests/livepatch: introduce tests
/root/linux/.git/rebase-apply/patch:1513: space before tab in indent.
# Wait until the transition finishes and the livepatch gets

And FWIW v13's selftests ran just fine on ppc64le over here.

-- Joe