From patchwork Fri May 15 12:00:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yauheni Kaliuta X-Patchwork-Id: 1291071 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: incoming-bpf@patchwork.ozlabs.org Delivered-To: patchwork-incoming-bpf@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=bpf-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=CWWP66ZT; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 49Nn6m16YDz9sV0 for ; Fri, 15 May 2020 22:00:48 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726166AbgEOMAr (ORCPT ); Fri, 15 May 2020 08:00:47 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:27371 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726062AbgEOMAr (ORCPT ); Fri, 15 May 2020 08:00:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1589544046; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CddcCML9u77RP1qItK3WVdNaZvzlZ+4uDdw9FYA4Ktg=; b=CWWP66ZTsK/r1CfXFwpRNc2oD5kgOEtlzARkmZ5UiNBSZUWS/CpNQM/fYABWnp5diHWSMq OzwTu2Ma+sbVdCcSME8tB+yuvZg1P5VFf8sQI+6xPJPtJTDV7eUbR9f3OzWmg3d5zWrH2c NoywoR9MHAe9Lw5Uunx5rugLKnF6aWA= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-350--wn1hhPoOUe_4918EpGWyA-1; Fri, 15 May 2020 08:00:44 -0400 X-MC-Unique: -wn1hhPoOUe_4918EpGWyA-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DBFA087309A; Fri, 15 May 2020 12:00:43 +0000 (UTC) Received: from astarta.redhat.com (ovpn-113-25.ams2.redhat.com [10.36.113.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 36F2860F8D; Fri, 15 May 2020 12:00:37 +0000 (UTC) From: Yauheni Kaliuta To: bpf@vger.kernel.org Cc: Jiri Benc , Jiri Olsa , Shuah Khan Subject: [PATCH v2 1/3] selftests: do not use .ONESHELL Date: Fri, 15 May 2020 15:00:24 +0300 Message-Id: <20200515120026.113278-2-yauheni.kaliuta@redhat.com> In-Reply-To: <20200515120026.113278-1-yauheni.kaliuta@redhat.com> References: <20200515120026.113278-1-yauheni.kaliuta@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Sender: bpf-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org Using one shell for the whole recipe with long lists can cause make[1]: execvp: /bin/sh: Argument list too long with some shells. Triggered by commit 309b81f0fdc4 ("selftests/bpf: Install generated test progs") It requires to change the rule which rely on the one shell behaviour (run_tests). Simplify also INSTALL_SINGLE_RULE, remove extra echo, required to workaround .ONESHELL. Signed-off-by: Yauheni Kaliuta Cc: Jiri Benc Cc: Shuah Khan Acked-by: Jiri Benc --- tools/testing/selftests/lib.mk | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk index b0556c752443..5b82433d88e3 100644 --- a/tools/testing/selftests/lib.mk +++ b/tools/testing/selftests/lib.mk @@ -59,9 +59,8 @@ else all: $(TEST_GEN_PROGS) $(TEST_GEN_PROGS_EXTENDED) $(TEST_GEN_FILES) endif -.ONESHELL: define RUN_TESTS - @BASE_DIR="$(selfdir)"; \ + BASE_DIR="$(selfdir)"; \ . $(selfdir)/kselftest/runner.sh; \ if [ "X$(summary)" != "X" ]; then \ per_test_logging=1; \ @@ -71,22 +70,21 @@ endef run_tests: all ifdef building_out_of_srctree - @if [ "X$(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES)" != "X" ]; then - @rsync -aq $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES) $(OUTPUT) + @if [ "X$(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES)" != "X" ]; then \ + rsync -aq $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES) $(OUTPUT); \ fi - @if [ "X$(TEST_PROGS)" != "X" ]; then - $(call RUN_TESTS, $(TEST_GEN_PROGS) $(TEST_CUSTOM_PROGS) $(OUTPUT)/$(TEST_PROGS)) - else - $(call RUN_TESTS, $(TEST_GEN_PROGS) $(TEST_CUSTOM_PROGS)) + @if [ "X$(TEST_PROGS)" != "X" ]; then \ + $(call RUN_TESTS, $(TEST_GEN_PROGS) $(TEST_CUSTOM_PROGS) $(OUTPUT)/$(TEST_PROGS)) ; \ + else \ + $(call RUN_TESTS, $(TEST_GEN_PROGS) $(TEST_CUSTOM_PROGS)); \ fi else - $(call RUN_TESTS, $(TEST_GEN_PROGS) $(TEST_CUSTOM_PROGS) $(TEST_PROGS)) + @$(call RUN_TESTS, $(TEST_GEN_PROGS) $(TEST_CUSTOM_PROGS) $(TEST_PROGS)) endif define INSTALL_SINGLE_RULE $(if $(INSTALL_LIST),@mkdir -p $(INSTALL_PATH)) - $(if $(INSTALL_LIST),@echo rsync -a $(INSTALL_LIST) $(INSTALL_PATH)/) - $(if $(INSTALL_LIST),@rsync -a $(INSTALL_LIST) $(INSTALL_PATH)/) + $(if $(INSTALL_LIST),rsync -a $(INSTALL_LIST) $(INSTALL_PATH)/) endef define INSTALL_RULE From patchwork Fri May 15 12:00:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yauheni Kaliuta X-Patchwork-Id: 1291072 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: incoming-bpf@patchwork.ozlabs.org Delivered-To: patchwork-incoming-bpf@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=bpf-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=EXjjuvjb; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 49Nn6s11glz9sV0 for ; Fri, 15 May 2020 22:00:53 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726139AbgEOMAw (ORCPT ); Fri, 15 May 2020 08:00:52 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:38403 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726062AbgEOMAw (ORCPT ); Fri, 15 May 2020 08:00:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1589544051; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=U2SQc7Kw0tOOlWxNV9I62/TRj+qmAVOcVhm20UoLLYM=; b=EXjjuvjb+4hgGpaZQhuwVKW5AEWTd0MD8hNxWb+gn8ZaDHCk9+BDBxWDQRaNT+xN0Tx/i/ Xq2WrFb211Cx35wH9Aw01MhPl/PT80FPdz1RspSbElXAtHHr0DCXQqqdEZoOZ5CT1fx0uk 8hW4gZD5YJIS3mKWzRfeRmWhiNQkRLQ= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-20-LqEm3tO3NXG0sREbgVCgCw-1; Fri, 15 May 2020 08:00:48 -0400 X-MC-Unique: LqEm3tO3NXG0sREbgVCgCw-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 12D22835B41; Fri, 15 May 2020 12:00:47 +0000 (UTC) Received: from astarta.redhat.com (ovpn-113-25.ams2.redhat.com [10.36.113.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6E8A761989; Fri, 15 May 2020 12:00:44 +0000 (UTC) From: Yauheni Kaliuta To: bpf@vger.kernel.org Cc: Jiri Benc , Jiri Olsa , Shuah Khan Subject: [PATCH v2 2/3] selftests: fix condition in run_tests Date: Fri, 15 May 2020 15:00:25 +0300 Message-Id: <20200515120026.113278-3-yauheni.kaliuta@redhat.com> In-Reply-To: <20200515120026.113278-1-yauheni.kaliuta@redhat.com> References: <20200515120026.113278-1-yauheni.kaliuta@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Sender: bpf-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org The check if there are any files to install in case of no files compares "X " with "X" so never false. Remove extra spaces. It may make sense to use make's $(if) function here. Signed-off-by: Yauheni Kaliuta Acked-by: Jiri Benc --- tools/testing/selftests/lib.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk index 5b82433d88e3..7a17ea815736 100644 --- a/tools/testing/selftests/lib.mk +++ b/tools/testing/selftests/lib.mk @@ -70,7 +70,7 @@ endef run_tests: all ifdef building_out_of_srctree - @if [ "X$(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES)" != "X" ]; then \ + @if [ "X$(TEST_PROGS)$(TEST_PROGS_EXTENDED)$(TEST_FILES)" != "X" ]; then \ rsync -aq $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES) $(OUTPUT); \ fi @if [ "X$(TEST_PROGS)" != "X" ]; then \ From patchwork Fri May 15 12:00:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yauheni Kaliuta X-Patchwork-Id: 1291073 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: incoming-bpf@patchwork.ozlabs.org Delivered-To: patchwork-incoming-bpf@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=bpf-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=SamXQe+3; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 49Nn6z05GVz9sV1 for ; Fri, 15 May 2020 22:00:59 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726160AbgEOMA5 (ORCPT ); Fri, 15 May 2020 08:00:57 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:39005 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726202AbgEOMA4 (ORCPT ); Fri, 15 May 2020 08:00:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1589544055; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KeFCFQKYr22MWNIUPQRp475JW512YZ2vYFblYXBP+94=; b=SamXQe+3OdLBnViWvmKQ7IHrZ15uCQQ5BfghHnRwaP8FhVtzWi3fcMP3iQ6CW3xiMJYQj2 ZB0DbQYKqoUFmLjei0bWt5TVImqO8+93B2wkdkRRZsLKL9c5BwtslD3sJ6r9D9w68WpzYA G0VwKCJcn7+LinuA26lEz86eLzfoi/M= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-323-hwwb6QX7P1KP2O9yk5obgg-1; Fri, 15 May 2020 08:00:53 -0400 X-MC-Unique: hwwb6QX7P1KP2O9yk5obgg-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 93FB7100AA26; Fri, 15 May 2020 12:00:52 +0000 (UTC) Received: from astarta.redhat.com (ovpn-113-25.ams2.redhat.com [10.36.113.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7113760F8D; Fri, 15 May 2020 12:00:47 +0000 (UTC) From: Yauheni Kaliuta To: bpf@vger.kernel.org Cc: Jiri Benc , Jiri Olsa , Shuah Khan Subject: [PATCH v2 3/3] selftests: simplify run_tests Date: Fri, 15 May 2020 15:00:26 +0300 Message-Id: <20200515120026.113278-4-yauheni.kaliuta@redhat.com> In-Reply-To: <20200515120026.113278-1-yauheni.kaliuta@redhat.com> References: <20200515120026.113278-1-yauheni.kaliuta@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Sender: bpf-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org Remove redundant check for TEST_PROGS and use the same command for in- and out-of-source builds, and fix bug with adding $(OUTPUT)/ to first $(TEST_PROGS) element only: 1) use $(addprefix ...) function to add $(OUTPUT). In case of blank $(TEST_PROGS) it will be expanded to blank, so no need for extra check; 2) $(OUTPUT) is always initialized to current dir or supplied value, so it does not make any harm to add it unconditionally. Signed-off-by: Yauheni Kaliuta --- tools/testing/selftests/lib.mk | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk index 7a17ea815736..fac4f7de37fb 100644 --- a/tools/testing/selftests/lib.mk +++ b/tools/testing/selftests/lib.mk @@ -73,14 +73,9 @@ ifdef building_out_of_srctree @if [ "X$(TEST_PROGS)$(TEST_PROGS_EXTENDED)$(TEST_FILES)" != "X" ]; then \ rsync -aq $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES) $(OUTPUT); \ fi - @if [ "X$(TEST_PROGS)" != "X" ]; then \ - $(call RUN_TESTS, $(TEST_GEN_PROGS) $(TEST_CUSTOM_PROGS) $(OUTPUT)/$(TEST_PROGS)) ; \ - else \ - $(call RUN_TESTS, $(TEST_GEN_PROGS) $(TEST_CUSTOM_PROGS)); \ - fi -else - @$(call RUN_TESTS, $(TEST_GEN_PROGS) $(TEST_CUSTOM_PROGS) $(TEST_PROGS)) endif + @$(call RUN_TESTS, $(TEST_GEN_PROGS) $(TEST_CUSTOM_PROGS) \ + $(addprefix $(OUTPUT)/,$(TEST_PROGS))) define INSTALL_SINGLE_RULE $(if $(INSTALL_LIST),@mkdir -p $(INSTALL_PATH))