From patchwork Fri May 13 01:01:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hangbin Liu X-Patchwork-Id: 12848268 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 A950FC433FE for ; Fri, 13 May 2022 01:01:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1359844AbiEMBBd (ORCPT ); Thu, 12 May 2022 21:01:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1359862AbiEMBB3 (ORCPT ); Thu, 12 May 2022 21:01:29 -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 EADCC369D2; Thu, 12 May 2022 18:01:27 -0700 (PDT) Received: by mail-pg1-x535.google.com with SMTP id a191so6102081pge.2; Thu, 12 May 2022 18:01:27 -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=UPJLZXnBKLt9czR7ENUYjEwJqEmw9rAhwVuvoguL++3lwYpcIOb1bWngCyXrEdnaLL wCBQ9QbP6m9qh4IkUup/PfwsA3PDIXct9ZEFBBcaxFPZK7DtSipl7D9mJX282YVA/7VK GzHgiqv0ZXD09ZUkXw9VZOuJViTogGKBzCs/j7f0RXxVYXPf5oEwfsSG6i11GxpdDPZS tOET/USEMw5jxLB4Zu0Isr1REjZ2yg1Hw/1N+TI+2GER3jt2WtQVnDM1m33nvy+0D/4j sDlXvZJF8VGmf6Xk7BOaQgN6iyr8h8HRB+BgpopKAC2yPrLvjhUg5CRsQTUBlSrnrFat sV+g== 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=MyI8VlNvRHdcA/rcWJNmMJJ9f4pRR8eLu3cVSvxo3x4HyuKBgSrpUEmIcJ/7gMC1n2 tNejsSLugSkzYpNaCdNl91nKqAkTlmn6yGi3LdhM/yWEe/uppkt4ivD+GTJCiKBXexqF bFYJXMCMTLY7HPHYJR2i9m8lz9iAByP4Fqmt9k/d0TdgDDUyFA69PAjdEWxzxLiOAh0s d2R21I7ARRklVvIpN7sp7GU1gMnjb1Sa54Fyv6mbG1VihArNuJnvI39LluG6uK5TFk8t E8P8bq2oZ1yd7pnI7kqTdDLipoJmw6UWLAAmVL5l3Di3klM2B/feowiiEaFV0khFCxgN wLMQ== X-Gm-Message-State: AOAM530g1N3e1+EgMpW12Bx3zf33QW4RhoSz71X7CEsyYAF4ClK6crzU w7j831tltNL0bDtoas1suwCPRME9BYSuTw== X-Google-Smtp-Source: ABdhPJxkXpvj8MQvNuqXRlG72CStzSpu43zpYbso4FuDsX3NAJsyO6CQq9SejVpxlCy18DoXASV3cg== X-Received: by 2002:aa7:84d1:0:b0:510:8796:4f38 with SMTP id x17-20020aa784d1000000b0051087964f38mr2010045pfn.8.1652403687276; Thu, 12 May 2022 18:01:27 -0700 (PDT) Received: from Laptop-X1.redhat.com ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id i7-20020a63cd07000000b003c14af5063esm323149pgg.86.2022.05.12.18.01.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 May 2022 18:01:26 -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: [PATCHv2 bpf-next 1/2] selftests/bpf: Fix build error with ima_setup.sh Date: Fri, 13 May 2022 09:01:09 +0800 Message-Id: <20220513010110.319061-2-liuhangbin@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220513010110.319061-1-liuhangbin@gmail.com> References: <20220513010110.319061-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 Fri May 13 01:01:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hangbin Liu X-Patchwork-Id: 12848269 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 6DF5CC433F5 for ; Fri, 13 May 2022 01:01:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1359851AbiEMBBq (ORCPT ); Thu, 12 May 2022 21:01:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35278 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1359862AbiEMBBe (ORCPT ); Thu, 12 May 2022 21:01:34 -0400 Received: from mail-pg1-x52f.google.com (mail-pg1-x52f.google.com [IPv6:2607:f8b0:4864:20::52f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7094B3F8B0; Thu, 12 May 2022 18:01:33 -0700 (PDT) Received: by mail-pg1-x52f.google.com with SMTP id q76so6071831pgq.10; Thu, 12 May 2022 18:01:33 -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=CA3TB5xNjBOAO42WCpd3V99zFX4agGub346TwXS7PiEQq5iAPnCFBN4LTKLkbenzoI uY/cOdR+CexzCFELMnPW3y7WPWskLe56tTLjlZApEsgUTw7frLjk6yDUL8KHSJRl5nTt EDfPxFq+OlleRzz4Hnwnv5SHwhnlTZf0u/Xg2PtsJpCgq/+eiB0dcqxXNPSAV85+tByH 7SIyNZVaNYuz5D5wQwgc7n2wcaWVLrlf+AN0rdCTXSFarYqo0oladQw75ObixQo/csMf 3KPeULy3Raykaok58f2lXrxwNFbGsN9ZFIX/pz97RqK+PW8mIGh4rkD0aSPThX1nL+Dr Lgrg== 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=KpP5fLhRmLzVbzR6u4W7YQ5DBjKtr3H5eE21GgrMKKfPldlx8VUcSoyA1UnjZF8d2l /JppedBolsHbx8/Rs5Ixu2RjHTmJqhCKISahTdqO+YodQO8z99eAiiA42tnO9mT/2Sve fhOnqLHdGZ0s6f0FeKpb+f/mEpDVGufksN9CaT/VqvC4P/zBAxrfe2GqhQne+K6641tg SSMBQtVOg9X6/ip0jhla0UUrw8alE6+0gssjJToI5ZIIrnFXDzRdWZGpwX0TdjL72ktD 2h9SF0oB9M/9MlLL/i6oBggesOdE70xig2apY4IF1SvyGxgHLr+2O+29I7KA5L6nvGQF pqyg== X-Gm-Message-State: AOAM530TszprR9V93SJwgqAduFg9fqDdI3QRqB0Vb6TUjNJS99xgu6XU m5T60tL+8IeF/FOmOXn456KNebO1Dn/mjQ== X-Google-Smtp-Source: ABdhPJzoIv4wMVMgRg71tcu014wm5h0LdJC1YI4LkqLwsRmvpBSkYkNvrYqNxwKDed66lanTtN7obg== X-Received: by 2002:a05:6a00:1146:b0:4c9:ede0:725a with SMTP id b6-20020a056a00114600b004c9ede0725amr1990270pfm.35.1652403692799; Thu, 12 May 2022 18:01:32 -0700 (PDT) Received: from Laptop-X1.redhat.com ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id i7-20020a63cd07000000b003c14af5063esm323149pgg.86.2022.05.12.18.01.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 May 2022 18:01:32 -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: [PATCHv2 bpf-next 2/2] selftests/bpf: add missed ima_setup.sh in Makefile Date: Fri, 13 May 2022 09:01:10 +0800 Message-Id: <20220513010110.319061-3-liuhangbin@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220513010110.319061-1-liuhangbin@gmail.com> References: <20220513010110.319061-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'