Whamcloud - gitweb
LU-16793 build: Enable compile tests to require <module>.ko
authorShaun Tancheff <shaun.tancheff@hpe.com>
Wed, 21 Feb 2024 20:18:06 +0000 (12:18 -0800)
committerAndreas Dilger <adilger@whamcloud.com>
Sun, 3 Mar 2024 10:18:32 +0000 (10:18 +0000)
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 <shaun.tancheff@hpe.com>
Change-Id: Iae481f1287023ea6c2432d147c497fa0a55fd689
Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/54129
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
config/lustre-build-linux.m4

index 4940482..c269676 100644 (file)
@@ -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 <module>.o be generated.
+       NEED_KO=0
+       # Require the <module>.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],