From c9b00f791f5f7dcec7d728c071ef810d71eda430 Mon Sep 17 00:00:00 2001 From: Shaun Tancheff Date: Wed, 21 Feb 2024 12:18:06 -0800 Subject: [PATCH] LU-16793 build: Enable compile tests to require .ko Currently the build tests only demand a kernel api test create an object (.o). Cases that have a missing symbol export, directly or indirectly, will generate an object file and fail to generate a kernel module (.ko). Enable tests to select the stricter criteria. Lustre-change: https://review.whamcloud.com/50849 Lustre-commit: 581db5e89e0d690961e49278a7b50ecce78e5a22 Test-Parameters: trivial Fixes: cc5594df3e ("LU-16759 o2ib: MOFED 5.5+ ib_dma_virt_map_sg") Signed-off-by: Shaun Tancheff Change-Id: Iae481f1287023ea6c2432d147c497fa0a55fd689 Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/54129 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger --- config/lustre-build-linux.m4 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/config/lustre-build-linux.m4 b/config/lustre-build-linux.m4 index 4940482..c269676 100644 --- a/config/lustre-build-linux.m4 +++ b/config/lustre-build-linux.m4 @@ -890,6 +890,7 @@ AC_DEFUN([LB2_LINUX_TEST_SRC], [ # $1 - *unique* name matching the LB2_LINUX_TEST_SRC macro # $2 - run on success (valid .ko generated) # $3 - run on failure (unable to compile) +# $4 - compile only # AC_DEFUN([LB2_LINUX_TEST_RESULT],[ TEST_DIR=${TEST_DIR:-${ac_pwd}/_lpb} @@ -930,8 +931,13 @@ AC_DEFUN([LB2_LINUX_TEST_RESULT],[ # Abort if key does not exist AS_IF([test -f ${O}.tested], [], [AC_MSG_ERROR([*** Compile test for $1 was not run.])]) + # Default is to expect only the .o be generated. + NEED_KO=0 + # Require the .ko file when "module" is passed + AS_IF([test "X'$4'" == "X'module'"], [NEED_KO=1]) # If test was compiled and if we got an object ... - AS_IF([test -f ${O}.o], [touch ${O}.ko]) + AS_IF([test ${NEED_KO} -eq 0], [AS_IF([test ! -f ${O}.ko], [AS_IF( + [test -f ${O}.o], [touch ${O}.ko])])]) # key is valid. Cache should be valid, set the variable AC_CACHE_CHECK([for $1], lb_test, AS_IF([test -f ${O}.ko], -- 1.8.3.1