From patchwork Thu May 12 07:18:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hangbin Liu X-Patchwork-Id: 12847238 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 40453C433F5 for ; Thu, 12 May 2022 07:18:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350874AbiELHSu (ORCPT ); Thu, 12 May 2022 03:18:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350871AbiELHSm (ORCPT ); Thu, 12 May 2022 03:18:42 -0400 Received: from mail-pf1-x42c.google.com (mail-pf1-x42c.google.com [IPv6:2607:f8b0:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 76B36BCE9C; Thu, 12 May 2022 00:18:38 -0700 (PDT) Received: by mail-pf1-x42c.google.com with SMTP id c14so4034352pfn.2; Thu, 12 May 2022 00:18:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8lNrBu7iRaQlA9BDLbcaT8Dxm63DhLNUJbaN6jF3jlE=; b=kDbrU9IxXlNiyEhYINlb1IAJQLgxaiJZmRNpOdbv2L9BLIcMSljh+CGHR1ZCyPx46z CcMew3i3WX7EGkmMM8Ypr04ZrVpy2ipkVH5cPAhWfnp7Ti+vglGveqWm9akXb7UWnhbe oq3GPNHyPSMFi0g/PVNAxIZ8Pp46PrUx51sTO094AaJe09Hsp3EuKoIXXuNdWtAjPMeJ gcChVYUyjIhF+BcLV5dqc9QXDQopFVUGvmVPDHe4MJOvZlPXm06V/W0kU1ae/6ospQQ9 nd2DPE3Ef543XDAOC9myJkUtKyM1+fI4tClQYj7VxXtz1osgvOk2OTZ2xKNc2YUyUY8W wIug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=8lNrBu7iRaQlA9BDLbcaT8Dxm63DhLNUJbaN6jF3jlE=; b=6aqnKsYHuDZbXwfyfGvKRniDG+N5bwFzjjxTDm4vLC3Limi+PLwckVVW9Ms1S67zx/ 1D6HjBTeOMmCAZ8mi78CpquLdw7kAcvR8khd2K5mL/k4j2utKBnBSzc3sTtKVE/w4v0e hzOWXonfT74JOFInz7F+34MufdkzxyyPUV1eUoy8N1JY8XH4MBASTJ495ftpuaXXe7t0 dx9zSU/iRx2tJf6gSBHenWiL9xl2YN9eWCnHN19gdl7Knfl6M3r0sLPN+yhPhSXvMrnL GSL+/LM+AN0PRDiVJeQto8gaSvAzd4ZsMqOU/l45QTJYJqmfitZf+QMnUozJ3eTu/trK Ed6Q== X-Gm-Message-State: AOAM531w1/iDBSlW/NKwLx9zVGVIob02WB17yOECf85gzmGYaNLfXkSa MSiDY/lVb8d7oXdP/QLLVw1GEC/zOsPaBg== X-Google-Smtp-Source: ABdhPJxd4/ut7jPbhH/ynuqhsjuPGADP8Imx5RLX0trUZ0jhawdbTJZzvXg9U/z+NRx8xCZKDPkZrQ== X-Received: by 2002:a05:6a02:10d:b0:381:f4c8:ad26 with SMTP id bg13-20020a056a02010d00b00381f4c8ad26mr23922668pgb.135.1652339917710; Thu, 12 May 2022 00:18:37 -0700 (PDT) Received: from Laptop-X1.redhat.com ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id w17-20020a170902e89100b0015e8d4eb2b4sm3244533plg.254.2022.05.12.00.18.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 May 2022 00:18:36 -0700 (PDT) From: Hangbin Liu To: netdev@vger.kernel.org Cc: Shuah Khan , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Ilya Leoshkevich , linux-kselftest@vger.kernel.org, bpf@vger.kernel.org, Hangbin Liu Subject: [PATCH net 1/2] selftests/bpf: Fix build error with ima_setup.sh Date: Thu, 12 May 2022 15:18:18 +0800 Message-Id: <20220512071819.199873-2-liuhangbin@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220512071819.199873-1-liuhangbin@gmail.com> References: <20220512071819.199873-1-liuhangbin@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org KP fixed ima_setup.sh missing issue when build test_progs separately with commit 854055c0cf30 ("selftests/bpf: Fix flavored variants of test_ima"). But the fix is incorrect because the build will failed with error: $ OUTPUT="/tmp/bpf" make test_progs [...] make: *** No rule to make target '/tmp/bpf/ima_setup.sh', needed by 'ima_setup.sh'. Stop. Fix it by adding a new variable TRUNNER_EXTRA_BUILD to build extra binaries. Left TRUNNER_EXTRA_FILES only for copying files Fixes: 854055c0cf30 ("selftests/bpf: Fix flavored variants of test_ima") Signed-off-by: Hangbin Liu --- tools/testing/selftests/bpf/Makefile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile index 3820608faf57..5944d3a8fff6 100644 --- a/tools/testing/selftests/bpf/Makefile +++ b/tools/testing/selftests/bpf/Makefile @@ -466,10 +466,10 @@ $(TRUNNER_EXTRA_OBJS): $(TRUNNER_OUTPUT)/%.o: \ # non-flavored in-srctree builds receive special treatment, in particular, we # do not need to copy extra resources (see e.g. test_btf_dump_case()) -$(TRUNNER_BINARY)-extras: $(TRUNNER_EXTRA_FILES) | $(TRUNNER_OUTPUT) +$(TRUNNER_BINARY)-extras: $(TRUNNER_EXTRA_BUILD) | $(TRUNNER_OUTPUT) ifneq ($2:$(OUTPUT),:$(shell pwd)) $$(call msg,EXT-COPY,$(TRUNNER_BINARY),$(TRUNNER_EXTRA_FILES)) - $(Q)rsync -aq $$^ $(TRUNNER_OUTPUT)/ + $(Q)rsync -aq $(TRUNNER_EXTRA_FILES) $(TRUNNER_OUTPUT)/ endif $(OUTPUT)/$(TRUNNER_BINARY): $(TRUNNER_TEST_OBJS) \ @@ -490,9 +490,9 @@ TRUNNER_EXTRA_SOURCES := test_progs.c cgroup_helpers.c trace_helpers.c \ network_helpers.c testing_helpers.c \ btf_helpers.c flow_dissector_load.h \ cap_helpers.c -TRUNNER_EXTRA_FILES := $(OUTPUT)/urandom_read $(OUTPUT)/bpf_testmod.ko \ - ima_setup.sh \ +TRUNNER_EXTRA_BUILD := $(OUTPUT)/urandom_read $(OUTPUT)/bpf_testmod.ko \ $(wildcard progs/btf_dump_test_case_*.c) +TRUNNER_EXTRA_FILES := $(TRUNNER_EXTRA_BUILD) ima_setup.sh TRUNNER_BPF_BUILD_RULE := CLANG_BPF_BUILD_RULE TRUNNER_BPF_CFLAGS := $(BPF_CFLAGS) $(CLANG_CFLAGS) -DENABLE_ATOMICS_TESTS $(eval $(call DEFINE_TEST_RUNNER,test_progs)) @@ -513,6 +513,7 @@ endif TRUNNER_TESTS_DIR := map_tests TRUNNER_BPF_PROGS_DIR := progs TRUNNER_EXTRA_SOURCES := test_maps.c +TRUNNER_EXTRA_BUILD := TRUNNER_EXTRA_FILES := TRUNNER_BPF_BUILD_RULE := $$(error no BPF objects should be built) TRUNNER_BPF_CFLAGS := From patchwork Thu May 12 07:18:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hangbin Liu X-Patchwork-Id: 12847239 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0B359C433EF for ; Thu, 12 May 2022 07:18:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350873AbiELHS4 (ORCPT ); Thu, 12 May 2022 03:18:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38022 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350879AbiELHSt (ORCPT ); Thu, 12 May 2022 03:18:49 -0400 Received: from mail-pg1-x535.google.com (mail-pg1-x535.google.com [IPv6:2607:f8b0:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F7B1C5E48; Thu, 12 May 2022 00:18:44 -0700 (PDT) Received: by mail-pg1-x535.google.com with SMTP id 7so3808495pga.12; Thu, 12 May 2022 00:18:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=6UxEmmuG1N0Iwm83q5/mJkqiaq+2A/J4A3rU7XGWf4o=; b=QzfF6VRn+PtiqILq7UWQRU7Axj4yufoeYfPInxBX51q6ughZBRyL9y5OxlmnWB8VSl M1wqaRGIyhCFmeXWLPiM4/No7e9N5K8A+Ol23ys7+6HieRhL32gIWKFoAEBqEWeC0wn6 D43q9QbGLGudqgJzOD+06D+gC9NCfBgHR3h/fETyv66GirlkWzWJI1qaaSvdtAHnw/z5 TTtXUMCPdDLPs6oSE9+v1vD56PL/eZuGQTZEbdadKh3qhjII57SdGdDTvJFxHNfHUubC Hldl4fGicdsscSX9siHY/wItIKmsG5wGf4a7rzlOpoUN+KHvjXc146wRKKmFJ+zWn9+J xRPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=6UxEmmuG1N0Iwm83q5/mJkqiaq+2A/J4A3rU7XGWf4o=; b=wHyZBs/K+mAi6rQPFdCS9VWAs3IzmpaGMjvHYJPXlTv/guGVjcfAWUYRg9cRLPCHWd ZpQ5mJanDkKE85GQCt/U24Opxrd3J1Z9PB1qW+5lE8pPl3xa6QXtVwtrdNhWoa2KUNL6 /1HNRHBPlp0OPLQpTa3QMmfWUPhNZ1/rs8Wn0fpYYjxI40Qf7L0FZoPl3LrRKnKlCgzM SO2VyPdnaRo0GvYtltoCNXKG0QWzTZoi/fPWzqau8ifEuQKdmgoafVS8Mo4YiK5IiUof Capdh/lTHB10VHvY1K0DCnEVX78K8MO6wOPaoyg/ez5ADscyJmrIGaNri8X9hlBg6W69 mJ7w== X-Gm-Message-State: AOAM533Wp3xYo0s0M+5e1A8ZRLqisWh/uNj/fqE3b/Oh5JYPsWvfuBkD 1sB14UFO/OROmcGgw/bl6Snp31NKt7BxZQ== X-Google-Smtp-Source: ABdhPJx75txHssOaqCjfGXODpikDMzECnWJ48mJvru2gYqIsztZyRWVG9hvJ7GlnfWu3Q+3yFIKP7A== X-Received: by 2002:a63:7e11:0:b0:3c6:84e3:9c59 with SMTP id z17-20020a637e11000000b003c684e39c59mr18812328pgc.615.1652339923413; Thu, 12 May 2022 00:18:43 -0700 (PDT) Received: from Laptop-X1.redhat.com ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id w17-20020a170902e89100b0015e8d4eb2b4sm3244533plg.254.2022.05.12.00.18.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 May 2022 00:18:42 -0700 (PDT) From: Hangbin Liu To: netdev@vger.kernel.org Cc: Shuah Khan , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Ilya Leoshkevich , linux-kselftest@vger.kernel.org, bpf@vger.kernel.org, Hangbin Liu Subject: [PATCH net 2/2] selftests/bpf: add missed ima_setup.sh in Makefile Date: Thu, 12 May 2022 15:18:19 +0800 Message-Id: <20220512071819.199873-3-liuhangbin@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220512071819.199873-1-liuhangbin@gmail.com> References: <20220512071819.199873-1-liuhangbin@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org When build bpf test and install it to another folder, e.g. make -j10 install -C tools/testing/selftests/ TARGETS="bpf" \ SKIP_TARGETS="" INSTALL_PATH=/tmp/kselftests The ima_setup.sh is missed in target folder, which makes test_ima failed. Fix it by adding ima_setup.sh to TEST_PROGS_EXTENDED. Fixes: 34b82d3ac105 ("bpf: Add a selftest for bpf_ima_inode_hash") Signed-off-by: Hangbin Liu --- tools/testing/selftests/bpf/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile index 5944d3a8fff6..b4fd1352a2ac 100644 --- a/tools/testing/selftests/bpf/Makefile +++ b/tools/testing/selftests/bpf/Makefile @@ -75,7 +75,7 @@ TEST_PROGS := test_kmod.sh \ test_xsk.sh TEST_PROGS_EXTENDED := with_addr.sh \ - with_tunnels.sh \ + with_tunnels.sh ima_setup.sh \ test_xdp_vlan.sh test_bpftool.py # Compile but not part of 'make run_tests'