This is an AI-generated review of your patch. The human sending this
email has considered the AI review valid, or at least plausible.
---
selftests: rds: support RDS built as loadable modules

This commit removes CONFIG_MODULES=n from the rds selftest config to prevent
unrelated features from being silently dropped. It updates the configuration
check routines to accept options built as either modules or built-in, and
adds support for probing the backing modules.

> diff --git a/tools/testing/selftests/net/rds/rds_run.sh 
> b/tools/testing/selftests/net/rds/rds_run.sh
> index ef16039be1ae5..c16b30dbdd169 100755
> --- a/tools/testing/selftests/net/rds/rds_run.sh
> +++ b/tools/testing/selftests/net/rds/rds_run.sh
[ ... ]
> @@ -93,38 +93,58 @@ check_gcov_conf()
>       fi
>  }
>  
> +# Checks if a kconfig is enabled (set to =y or =m)
> +# $1: kconfig symbol to check
> +# $2: (optional) module name backing $1
> +#     Ex: check_conf_enabled CONFIG_RDS_TCP rds_tcp
> +#     Modules for configs set to  =m will be probed
> +#     If omitted, only a built-in (=y) config is accepted.
> +# Returns on success.  exits 4 on failure
>  # Kselftest framework requirement - SKIP code is 4.
>  check_conf_enabled() {
> -     if ! grep -x "$1=y" "$kconfig" > /dev/null 2>&1; then
> -             echo "selftests: [SKIP] This test requires $1 enabled"
> -             echo "Please run tools/testing/selftests/net/rds/config.sh and 
> rebuild the kernel"
> -             exit 4
> +     if grep -x "$1=y" "$kconfig" > /dev/null 2>&1; then
> +             return
>       fi
> +     if [ -n "${2:-}" ] && grep -x "$1=m" "$kconfig" > /dev/null 2>&1; then
> +             probe_module "$2"
> +             return
> +     fi
> +     echo "selftests: [SKIP] This test requires $1 enabled"
> +     echo "Please run" \
> +          "tools/testing/selftests/net/rds/config.sh and rebuild the kernel"

[Severity: Medium]
Should tools/testing/selftests/net/rds/config.sh also be updated to
reflect the new module support?

If a user follows these instructions to run config.sh for missing
dependencies, that script still explicitly disables CONFIG_MODULES via
scripts/config --disable CONFIG_MODULES.

Could this undermine the goal of this patch by forcefully disabling modules in
the user's kernel configuration anyway?

> +     exit 4
>  }

Reply via email to