From patchwork Wed Feb 21 17:17:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcos Paulo de Souza X-Patchwork-Id: 13565988 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 93CB885279; Wed, 21 Feb 2024 17:17:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708535840; cv=none; b=tXM7sigWilkTLjSJwMysqJPjFHkXpQ/BSacHUvtihJJB8mAgre47ixm/sHkChJPpmPomJo7Hi8FU4FF8gNKh5HiX4dFhwo5TQ0THAN4CBqG3puzr5xZfpRx3OZEsmK/X+f4ehIhOoFzU76oBLY/I4lg3INnWIEahoLrDkUg1Ing= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708535840; c=relaxed/simple; bh=mobHejLyMa9lwd2koRFuFHd/TN2Lj+Tpf18ZnDm+jd0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=aKBwlJZsaiOGwekcu3v3IwGwF2OzZTcBgjWAXZSLu32KLo0+FLjZtlwIQZycCHL54w5lmmbGM74QZlctShRAaJWGTTyngje1t6df1ZVBy9HFMojDO4XmFZL3Nr0zzINgRF449GUUjtLzV9tSQ9nnYx2fKOFZ5Clm1ca/0Cuis/g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Received: from imap2.dmz-prg2.suse.org (imap2.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:98]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id ED5901FB74; Wed, 21 Feb 2024 17:17:16 +0000 (UTC) Received: from imap2.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap2.dmz-prg2.suse.org (Postfix) with ESMTPS id 76B7013A25; Wed, 21 Feb 2024 17:17:16 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap2.dmz-prg2.suse.org with ESMTPSA id 1X9qDxww1mUScQAAn2gu4w (envelope-from ); Wed, 21 Feb 2024 17:17:16 +0000 From: Marcos Paulo de Souza Date: Wed, 21 Feb 2024 14:17:03 -0300 Subject: [PATCH v2 1/4] selftests: livepatch: Add initial .gitignore Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240221-lp-selftests-fixes-v2-1-a19be1e029a7@suse.com> References: <20240221-lp-selftests-fixes-v2-0-a19be1e029a7@suse.com> In-Reply-To: <20240221-lp-selftests-fixes-v2-0-a19be1e029a7@suse.com> To: Shuah Khan , Josh Poimboeuf , Jiri Kosina , Miroslav Benes , Petr Mladek , Joe Lawrence Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, live-patching@vger.kernel.org, Marcos Paulo de Souza X-Mailer: b4 0.14-dev X-Developer-Signature: v=1; a=ed25519-sha256; t=1708535830; l=492; i=mpdesouza@suse.com; s=20231031; h=from:subject:message-id; bh=mobHejLyMa9lwd2koRFuFHd/TN2Lj+Tpf18ZnDm+jd0=; b=/hIEGXkpjh7TVD6fXJniB+mfAwmZa4nWRiV3dKm0vlhTfkx8DXT9B3XvSYSJfxnrmh0DZ2KUd q3MPSndVo/yDoZGyK2sgmloaE43WImB0t95JQj3USZD3kQ57dp2dKwB X-Developer-Key: i=mpdesouza@suse.com; a=ed25519; pk=/Ni/TsKkr69EOmdZXkp1Q/BlzDonbOBRsfPa18ySIwU= X-Spam-Level: Authentication-Results: smtp-out2.suse.de; none X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [-4.00 / 50.00]; REPLY(-4.00)[] X-Spam-Score: -4.00 X-Rspamd-Queue-Id: ED5901FB74 X-Spam-Flag: NO Ignore the binary used to test livepatching a syscall. Signed-off-by: Marcos Paulo de Souza --- tools/testing/selftests/livepatch/.gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/testing/selftests/livepatch/.gitignore b/tools/testing/selftests/livepatch/.gitignore new file mode 100644 index 000000000000..f1e9c2a20e99 --- /dev/null +++ b/tools/testing/selftests/livepatch/.gitignore @@ -0,0 +1 @@ +test_klp-call_getpid From patchwork Wed Feb 21 17:17:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcos Paulo de Souza X-Patchwork-Id: 13565989 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ECDC985920; Wed, 21 Feb 2024 17:17:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708535843; cv=none; b=Q8SyVRcTUknVlnkHzdgVQZ3bn130UW0A1K8EQZy4yuhRxC4Pu2HvzzXMgkpwlF7yEfnMgPgzrr8Fr33o5jx/o4GGf7tMNgQhDVek25xuSxaJ9myuOKb4feEcPCoLyQxJRwD1AsaBILDoqXQ2/3hLVFUxKlLeimEvuyxG9Wzq9OM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708535843; c=relaxed/simple; bh=3poRLsl87I5LGoGOxmZJk8+3nZWuoc4lJ1AqHOCLYZI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=M8e6BeU+VK3kio6ZrhSufFhW6IFTcav8l92ulW4Hl+FUn+0P9MlmThr5bjuR9ub0Go9ZHYeWou0+rFgAS6O7agYkyKk9g7m2xJ6j8MZ5LGUnT3Rcj/MZJqgIDhb1zVL5GfV3uYABsNck7YGN8JH8W0Llvk6kTXN6YuznoFzM8TE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Received: from imap2.dmz-prg2.suse.org (imap2.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:98]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 26CBA1FD5F; Wed, 21 Feb 2024 17:17:20 +0000 (UTC) Received: from imap2.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap2.dmz-prg2.suse.org (Postfix) with ESMTPS id A574613A25; Wed, 21 Feb 2024 17:17:19 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap2.dmz-prg2.suse.org with ESMTPSA id p5sFGx8w1mUWcQAAn2gu4w (envelope-from ); Wed, 21 Feb 2024 17:17:19 +0000 From: Marcos Paulo de Souza Date: Wed, 21 Feb 2024 14:17:04 -0300 Subject: [PATCH v2 2/4] selftests: livepatch: Avoid running the tests if kernel-devel is missing Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240221-lp-selftests-fixes-v2-2-a19be1e029a7@suse.com> References: <20240221-lp-selftests-fixes-v2-0-a19be1e029a7@suse.com> In-Reply-To: <20240221-lp-selftests-fixes-v2-0-a19be1e029a7@suse.com> To: Shuah Khan , Josh Poimboeuf , Jiri Kosina , Miroslav Benes , Petr Mladek , Joe Lawrence Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, live-patching@vger.kernel.org, Marcos Paulo de Souza , kernel test robot X-Mailer: b4 0.14-dev X-Developer-Signature: v=1; a=ed25519-sha256; t=1708535830; l=2202; i=mpdesouza@suse.com; s=20231031; h=from:subject:message-id; bh=3poRLsl87I5LGoGOxmZJk8+3nZWuoc4lJ1AqHOCLYZI=; b=MPj10FsveNXGa7hnAV7q6dARSYDTiOPFpQ0FKKtUWcm02p+ZxFSnUtUCDdOKV+Lc8bIZVQQ01 lD49kFKIBw0DvbKQOi5JcJK70lMbtNnNcbCyAYxscWflPw45s/FjXY5 X-Developer-Key: i=mpdesouza@suse.com; a=ed25519; pk=/Ni/TsKkr69EOmdZXkp1Q/BlzDonbOBRsfPa18ySIwU= Authentication-Results: smtp-out2.suse.de; none X-Spamd-Result: default: False [-4.00 / 50.00]; REPLY(-4.00)[] X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Rspamd-Queue-Id: 26CBA1FD5F X-Spam-Level: X-Spam-Score: -4.00 X-Spam-Flag: NO By checking if KDIR is a valid directory we can safely skip the tests if kernel-devel isn't installed (default value of KDIR), or if KDIR variable passed doesn't exists. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202402191417.XULH88Ct-lkp@intel.com/ Signed-off-by: Marcos Paulo de Souza --- tools/testing/selftests/livepatch/functions.sh | 13 +++++++++++++ tools/testing/selftests/livepatch/test_modules/Makefile | 6 ++++++ 2 files changed, 19 insertions(+) diff --git a/tools/testing/selftests/livepatch/functions.sh b/tools/testing/selftests/livepatch/functions.sh index e60cf09491a6..f0ed148d3c51 100644 --- a/tools/testing/selftests/livepatch/functions.sh +++ b/tools/testing/selftests/livepatch/functions.sh @@ -34,6 +34,18 @@ function is_root() { fi } +# Check if we can compile the modules before loading them +function has_kdir() { + if [ -z "$KDIR" ]; then + KDIR="/lib/modules/$(uname -r)/build" + fi + + if [ ! -d "$KDIR" ]; then + echo "skip all tests: KDIR ($KDIR) not available to compile modules." + exit $ksft_skip + fi +} + # die(msg) - game over, man # msg - dying words function die() { @@ -108,6 +120,7 @@ function cleanup() { # the ftrace_enabled sysctl. function setup_config() { is_root + has_kdir push_config set_dynamic_debug set_ftrace_enabled 1 diff --git a/tools/testing/selftests/livepatch/test_modules/Makefile b/tools/testing/selftests/livepatch/test_modules/Makefile index f5e880269bff..e6e638c4bcba 100644 --- a/tools/testing/selftests/livepatch/test_modules/Makefile +++ b/tools/testing/selftests/livepatch/test_modules/Makefile @@ -13,8 +13,14 @@ obj-m += test_klp_atomic_replace.o \ test_klp_shadow_vars.o \ test_klp_syscall.o +# Ensure that KDIR exists, otherwise skip the compilation modules: +ifneq ("$(wildcard $(KDIR))", "") $(Q)$(MAKE) -C $(KDIR) modules KBUILD_EXTMOD=$(TESTMODS_DIR) +endif +# Ensure that KDIR exists, otherwise skip the clean target clean: +ifneq ("$(wildcard $(KDIR))", "") $(Q)$(MAKE) -C $(KDIR) clean KBUILD_EXTMOD=$(TESTMODS_DIR) +endif From patchwork Wed Feb 21 17:17:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcos Paulo de Souza X-Patchwork-Id: 13565990 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 02F6385923; Wed, 21 Feb 2024 17:17:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708535847; cv=none; b=N1PYkOgh+hJPAaA7a/3YTF1AYnyPXxeGFw1VbCECGe6TxsEZSG+aYvh/wPQRd1O7tjyhaTSJe5VrfKVI+8dpMnLGHt09tb/dZnYSYh0nTfcAcWVZF3QC0URR0W6fbwyuRDlR+xo8OQAtZuJpCFrcK/2st83SmAl1Ya7E8SsqWx0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708535847; c=relaxed/simple; bh=/oVRt9J85nXIjb42Ew5A1lAd/g3N6kuHuj8z2sOBZ30=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=XY8NlBpbMOnyLZa9QTWo4zUVt9Njx1fmJYJCiBbLVb+wAMtcc2pYQkHnm4fviVeFnhcJp9J2F30ZiqHlyrYZl7RzIWebEshUULb8sHns5WGykclEPJxzhyRkNftaHJCS9NwwjfRO+bSgADuYzjDF0SuvsHIHLNfd/Ah/kXkLZCQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Received: from imap2.dmz-prg2.suse.org (imap2.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:98]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 517531FB73; Wed, 21 Feb 2024 17:17:23 +0000 (UTC) Received: from imap2.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap2.dmz-prg2.suse.org (Postfix) with ESMTPS id D2CEE13A25; Wed, 21 Feb 2024 17:17:22 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap2.dmz-prg2.suse.org with ESMTPSA id CvCdJSIw1mUbcQAAn2gu4w (envelope-from ); Wed, 21 Feb 2024 17:17:22 +0000 From: Marcos Paulo de Souza Date: Wed, 21 Feb 2024 14:17:05 -0300 Subject: [PATCH v2 3/4] selftests: lib.mk: Do not process TEST_GEN_MODS_DIR Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240221-lp-selftests-fixes-v2-3-a19be1e029a7@suse.com> References: <20240221-lp-selftests-fixes-v2-0-a19be1e029a7@suse.com> In-Reply-To: <20240221-lp-selftests-fixes-v2-0-a19be1e029a7@suse.com> To: Shuah Khan , Josh Poimboeuf , Jiri Kosina , Miroslav Benes , Petr Mladek , Joe Lawrence Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, live-patching@vger.kernel.org, Marcos Paulo de Souza X-Mailer: b4 0.14-dev X-Developer-Signature: v=1; a=ed25519-sha256; t=1708535830; l=1247; i=mpdesouza@suse.com; s=20231031; h=from:subject:message-id; bh=/oVRt9J85nXIjb42Ew5A1lAd/g3N6kuHuj8z2sOBZ30=; b=kwJuKPHcJm3are3nXOWsN5KVb0sSlHQg9wSH6Hq7Fy65NGToMKeDvQGCzGl04KfZTT6b17dzJ G4Baf1x9fGsChkCAp3eu9qILMcCO9LxTjGg0JKNZ2Ofhk5gIs2UptyI X-Developer-Key: i=mpdesouza@suse.com; a=ed25519; pk=/Ni/TsKkr69EOmdZXkp1Q/BlzDonbOBRsfPa18ySIwU= X-Spam-Level: Authentication-Results: smtp-out2.suse.de; none X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [-4.00 / 50.00]; REPLY(-4.00)[] X-Spam-Score: -4.00 X-Rspamd-Queue-Id: 517531FB73 X-Spam-Flag: NO The directory itself doesn't need have path handling, since it's only to mean where is the directory that contains modules to be built. Signed-off-by: Marcos Paulo de Souza --- tools/testing/selftests/lib.mk | 3 --- 1 file changed, 3 deletions(-) diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk index 0d8b7db92715..286ce0ee102b 100644 --- a/tools/testing/selftests/lib.mk +++ b/tools/testing/selftests/lib.mk @@ -54,12 +54,9 @@ endif # TEST_PROGS are for test shell scripts. # TEST_CUSTOM_PROGS and TEST_PROGS will be run by common run_tests # and install targets. Common clean doesn't touch them. -# TEST_GEN_MODS_DIR is used to specify a directory with modules to be built -# before the test executes. These modules are cleaned on the clean target as well. TEST_GEN_PROGS := $(patsubst %,$(OUTPUT)/%,$(TEST_GEN_PROGS)) TEST_GEN_PROGS_EXTENDED := $(patsubst %,$(OUTPUT)/%,$(TEST_GEN_PROGS_EXTENDED)) TEST_GEN_FILES := $(patsubst %,$(OUTPUT)/%,$(TEST_GEN_FILES)) -TEST_GEN_MODS_DIR := $(patsubst %,$(OUTPUT)/%,$(TEST_GEN_MODS_DIR)) all: $(TEST_GEN_PROGS) $(TEST_GEN_PROGS_EXTENDED) $(TEST_GEN_FILES) \ $(if $(TEST_GEN_MODS_DIR),gen_mods_dir) From patchwork Wed Feb 21 17:17:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcos Paulo de Souza X-Patchwork-Id: 13565991 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 361E282D7B; Wed, 21 Feb 2024 17:17:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708535849; cv=none; b=KPcE+bU3b4ulW791Swx4+iBUAlPBf+SCOclVYwW26xUtD1hHnzXEqsUHgBp5JcdtGtfXmU2iFjEDoonG9oGOcBS9JPciD8UObPYVGg+wYfFikVcydrwM9SoIxUpIxBhWs/CHWFMG+6G5rMBJ+c8gzcV6bJ3pEV66ApUUosV/HIU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708535849; c=relaxed/simple; bh=4sRYEFsMr0x8AvEq/m65uPROo9JRLFixj6hIrz82inQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=D4ldHZ9PRQQACiZBOcxVZGOSa4Pu8dLQR2A86bjQNrCr07t2opDsXfo5sCDwASRAketz/vX6TXEx8zXX1e4h6+Bz+T2ShSR6W2A1coyz/aMdy2oMA70Cl3P9WGLD20sCHF36EBLw36FxWDebRoltzB/VRCQTZzpCHd8rYTmxe2s= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Received: from imap2.dmz-prg2.suse.org (imap2.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:98]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 7D1DD22102; Wed, 21 Feb 2024 17:17:26 +0000 (UTC) Received: from imap2.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap2.dmz-prg2.suse.org (Postfix) with ESMTPS id 0480813A25; Wed, 21 Feb 2024 17:17:25 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap2.dmz-prg2.suse.org with ESMTPSA id NDH0LiUw1mUfcQAAn2gu4w (envelope-from ); Wed, 21 Feb 2024 17:17:25 +0000 From: Marcos Paulo de Souza Date: Wed, 21 Feb 2024 14:17:06 -0300 Subject: [PATCH v2 4/4] selftests: lib.mk: Simplify TEST_GEN_MODS_DIR handling Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240221-lp-selftests-fixes-v2-4-a19be1e029a7@suse.com> References: <20240221-lp-selftests-fixes-v2-0-a19be1e029a7@suse.com> In-Reply-To: <20240221-lp-selftests-fixes-v2-0-a19be1e029a7@suse.com> To: Shuah Khan , Josh Poimboeuf , Jiri Kosina , Miroslav Benes , Petr Mladek , Joe Lawrence Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, live-patching@vger.kernel.org, Marcos Paulo de Souza X-Mailer: b4 0.14-dev X-Developer-Signature: v=1; a=ed25519-sha256; t=1708535830; l=1959; i=mpdesouza@suse.com; s=20231031; h=from:subject:message-id; bh=4sRYEFsMr0x8AvEq/m65uPROo9JRLFixj6hIrz82inQ=; b=k6aiuIGTtALvQQFLvW+j9toVR32WNNHnB+49PPw7VA8Piw3BViCkI+7gk2tvRfCvK8nNHpNmf +GfzkX3mrywBQDOhYhJOj0Oc6/3/ZgsNF/dVbog8Tek694UPM3odrvF X-Developer-Key: i=mpdesouza@suse.com; a=ed25519; pk=/Ni/TsKkr69EOmdZXkp1Q/BlzDonbOBRsfPa18ySIwU= X-Spam-Level: Authentication-Results: smtp-out1.suse.de; none X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [-4.00 / 50.00]; REPLY(-4.00)[] X-Spam-Score: -4.00 X-Rspamd-Queue-Id: 7D1DD22102 X-Spam-Flag: NO We don't need new targets only to run two make modules and make clean. We can test if TEST_GEN_MODS_DIR is specified, and then run the commands. Signed-off-by: Marcos Paulo de Souza --- tools/testing/selftests/lib.mk | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk index 286ce0ee102b..eddcd4a849dc 100644 --- a/tools/testing/selftests/lib.mk +++ b/tools/testing/selftests/lib.mk @@ -58,8 +58,9 @@ TEST_GEN_PROGS := $(patsubst %,$(OUTPUT)/%,$(TEST_GEN_PROGS)) TEST_GEN_PROGS_EXTENDED := $(patsubst %,$(OUTPUT)/%,$(TEST_GEN_PROGS_EXTENDED)) TEST_GEN_FILES := $(patsubst %,$(OUTPUT)/%,$(TEST_GEN_FILES)) -all: $(TEST_GEN_PROGS) $(TEST_GEN_PROGS_EXTENDED) $(TEST_GEN_FILES) \ - $(if $(TEST_GEN_MODS_DIR),gen_mods_dir) +all: $(TEST_GEN_PROGS) $(TEST_GEN_PROGS_EXTENDED) $(TEST_GEN_FILES) + $(if $(TEST_GEN_MODS_DIR), \ + $(Q)$(MAKE) -C $(TEST_GEN_MODS_DIR)) define RUN_TESTS BASE_DIR="$(selfdir)"; \ @@ -85,11 +86,6 @@ else @$(call RUN_TESTS, $(TEST_GEN_PROGS) $(TEST_CUSTOM_PROGS) $(TEST_PROGS)) endif -gen_mods_dir: - $(Q)$(MAKE) -C $(TEST_GEN_MODS_DIR) - -clean_mods_dir: - $(Q)$(MAKE) -C $(TEST_GEN_MODS_DIR) clean define INSTALL_SINGLE_RULE $(if $(INSTALL_LIST),@mkdir -p $(INSTALL_PATH)) @@ -133,9 +129,11 @@ endif define CLEAN $(RM) -r $(TEST_GEN_PROGS) $(TEST_GEN_PROGS_EXTENDED) $(TEST_GEN_FILES) $(EXTRA_CLEAN) + $(if $(TEST_GEN_MODS_DIR), \ + $(Q)$(MAKE) -C $(TEST_GEN_MODS_DIR) clean) endef -clean: $(if $(TEST_GEN_MODS_DIR),clean_mods_dir) +clean: $(CLEAN) # Enables to extend CFLAGS and LDFLAGS from command line, e.g. @@ -166,4 +164,4 @@ $(OUTPUT)/%:%.S $(LINK.S) $^ $(LDLIBS) -o $@ endif -.PHONY: run_tests all clean install emit_tests gen_mods_dir clean_mods_dir +.PHONY: run_tests all clean install emit_tests