From patchwork Tue Feb 2 22:15:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: KP Singh X-Patchwork-Id: 12063019 X-Patchwork-Delegate: bpf@iogearbox.net Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5DE70C433E0 for ; Tue, 2 Feb 2021 22:16:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1D60864F2C for ; Tue, 2 Feb 2021 22:16:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233027AbhBBWQt (ORCPT ); Tue, 2 Feb 2021 17:16:49 -0500 Received: from mail.kernel.org ([198.145.29.99]:34502 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233382AbhBBWQq (ORCPT ); Tue, 2 Feb 2021 17:16:46 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id E34CA64F93; Tue, 2 Feb 2021 22:16:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1612304165; bh=p07brJnYF/aAoAxaFoUpXky3LTt0oZtOY0Z3uYvab9g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=E0P4lgvkLqkxyydeYv7HJvzMD81S7Xz9qhXB1AD/C+vPhxUkddXjQbApfDSGSCCB6 vo+H/AF7YoORPsk2+0L+wPqNsuykO+nZhq6HoY9+eA/zJghNElR58+g0jSCC/yoUuG c+pwIOINN2SSCEn4WVZMvgolTpWpqq75SKYLIxEu4qnUHrVieV/aIxTqzqvzU/mLCm MhshNpud1TC9a+BKUH68MR/mf16FAG7F25RXl9obMvfBX4ydaVf64s1UgvrPW1hGFQ /PjUo5QB6N2gkZy0MEwlRNBb8xy7gvllyvYbb5EgveNsVGxODL/cmvy8oXhE2UG2ov /zyrBk1PtaCmw== From: KP Singh To: bpf@vger.kernel.org Cc: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Florent Revest , Brendan Jackman Subject: [PATCH bpf-next v4 2/2] bpf/selftests: Add a short note about run_in_vm.sh in README.rst Date: Tue, 2 Feb 2021 22:15:57 +0000 Message-Id: <20210202221557.2039173-3-kpsingh@kernel.org> X-Mailer: git-send-email 2.30.0.365.g02bc693789-goog In-Reply-To: <20210202221557.2039173-1-kpsingh@kernel.org> References: <20210202221557.2039173-1-kpsingh@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org X-Patchwork-Delegate: bpf@iogearbox.net 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 --- tools/testing/selftests/bpf/README.rst | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tools/testing/selftests/bpf/README.rst b/tools/testing/selftests/bpf/README.rst index ca064180d4d0..80ddcce8df02 100644 --- a/tools/testing/selftests/bpf/README.rst +++ b/tools/testing/selftests/bpf/README.rst @@ -6,6 +6,30 @@ 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 uses pahole and clang based on host environment setting. + If you want to change pahole and llvm, you can change `PATH` environment + variable in the beginning of script. + +.. note:: The script currently only supports x86_64. Additional information about selftest failures are documented here.