diff mbox series

[bpf-next,v2,2/2] bpf/selftests: Add a short note about run_in_vm.sh in README.rst

Message ID 20210123004445.299149-3-kpsingh@kernel.org (mailing list archive)
State Superseded
Delegated to: BPF
Headers show
Series BPF selftest helper script | expand

Checks

Context Check Description
netdev/cover_letter success Link
netdev/fixes_present success Link
netdev/patch_count success Link
netdev/tree_selection success Clearly marked for bpf-next
netdev/subject_prefix success Link
netdev/cc_maintainers warning 10 maintainers not CCed: shuah@kernel.org netdev@vger.kernel.org songliubraving@fb.com linux-kselftest@vger.kernel.org natechancellor@gmail.com clang-built-linux@googlegroups.com john.fastabend@gmail.com ndesaulniers@google.com kafai@fb.com yhs@fb.com
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Link
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Link
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 29 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/header_inline success Link
netdev/stable success Stable not CCed

Commit Message

KP Singh Jan. 23, 2021, 12:44 a.m. UTC
Add a short note to make contributors aware of the existence of the
script. The documentation does not intentionally document all the
options of the script to avoid mentioning it in two places (it's
available in the usage / help message of the script).

Signed-off-by: KP Singh <kpsingh@kernel.org>
---
 tools/testing/selftests/bpf/README.rst | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

Comments

Yonghong Song Jan. 24, 2021, 7:14 p.m. UTC | #1
On 1/22/21 4:44 PM, KP Singh wrote:
> Add a short note to make contributors aware of the existence of the
> script. The documentation does not intentionally document all the
> options of the script to avoid mentioning it in two places (it's
> available in the usage / help message of the script).
> 
> Signed-off-by: KP Singh <kpsingh@kernel.org>

Acked-by: Yonghong Song <yhs@fb.com>

> ---
>   tools/testing/selftests/bpf/README.rst | 23 +++++++++++++++++++++++
>   1 file changed, 23 insertions(+)
> 
> diff --git a/tools/testing/selftests/bpf/README.rst b/tools/testing/selftests/bpf/README.rst
> index ca064180d4d0..a0dac65b6b01 100644
> --- a/tools/testing/selftests/bpf/README.rst
> +++ b/tools/testing/selftests/bpf/README.rst
> @@ -6,6 +6,29 @@ General instructions on running selftests can be found in
>   
>   __ /Documentation/bpf/bpf_devel_QA.rst#q-how-to-run-bpf-selftests
>   
> +=========================
> +Running Selftests in a VM
> +=========================
> +
> +It's now possible to run the selftests using ``tools/testing/selftests/bpf/run_in_vm.sh``.
> +The script tries to ensure that the tests are run with the same environment as they
> +would be run post-submit in the CI used by the Maintainers.
> +
> +This script downloads a suitable Kconfig and VM userspace image from the system used by
> +the CI. It builds the kernel (without overwriting your existing Kconfig), recompiles the
> +bpf selftests, runs them (by default ``tools/testing/selftests/bpf/test_progs``) and
> +saves the resulting output (by default in ``~/.bpf_selftests``).
> +
> +For more information on about using the script, run:
> +
> +.. code-block:: console
> +
> +	$ tools/testing/selftests/bpf/run_in_vm.sh -h
> +
> +.. note:: The script does not yet update pahole and LLVM, so these will still need to be
> +          manually updated.
Maybe a little more clarification and actionable.

The script uses pahole and clang based on host environment setting.
If you want to change pahole and llvm, you can change PATH env variable 
in the beginning of script.

I did not test changing PATH env variable inside the script, but I think
it should work.

> +
> +.. note:: The script currently only supports x86_64.
>   
>   Additional information about selftest failures are
>   documented here.
>
diff mbox series

Patch

diff --git a/tools/testing/selftests/bpf/README.rst b/tools/testing/selftests/bpf/README.rst
index ca064180d4d0..a0dac65b6b01 100644
--- a/tools/testing/selftests/bpf/README.rst
+++ b/tools/testing/selftests/bpf/README.rst
@@ -6,6 +6,29 @@  General instructions on running selftests can be found in
 
 __ /Documentation/bpf/bpf_devel_QA.rst#q-how-to-run-bpf-selftests
 
+=========================
+Running Selftests in a VM
+=========================
+
+It's now possible to run the selftests using ``tools/testing/selftests/bpf/run_in_vm.sh``.
+The script tries to ensure that the tests are run with the same environment as they
+would be run post-submit in the CI used by the Maintainers.
+
+This script downloads a suitable Kconfig and VM userspace image from the system used by
+the CI. It builds the kernel (without overwriting your existing Kconfig), recompiles the
+bpf selftests, runs them (by default ``tools/testing/selftests/bpf/test_progs``) and
+saves the resulting output (by default in ``~/.bpf_selftests``).
+
+For more information on about using the script, run:
+
+.. code-block:: console
+
+	$ tools/testing/selftests/bpf/run_in_vm.sh -h
+
+.. note:: The script does not yet update pahole and LLVM, so these will still need to be
+          manually updated.
+
+.. note:: The script currently only supports x86_64.
 
 Additional information about selftest failures are
 documented here.