From aff350cb207e87ca2f9bb171c470e5b7f56928cc Mon Sep 17 00:00:00 2001 From: Anders Roxell Date: Thu, 11 Jul 2024 14:42:19 +0200 Subject: [PATCH] automated: linux: modules: add SKIPLIST Make it possible to skip problematic modules that is known to fail. Signed-off-by: Anders Roxell --- automated/linux/modules/modules.sh | 9 +++++++-- automated/linux/modules/modules.yaml | 6 +++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/automated/linux/modules/modules.sh b/automated/linux/modules/modules.sh index 2c8dbb026..b6e5e8189 100755 --- a/automated/linux/modules/modules.sh +++ b/automated/linux/modules/modules.sh @@ -11,6 +11,7 @@ export RESULT_FILE MODULES_LIST="" MODULES_SUBDIRS="" MODULE_MODPROBE_NUMBER="1" +SKIPLIST="" SHARD_NUMBER=1 SHARD_INDEX=1 @@ -20,17 +21,19 @@ usage() { [-c ] [-i ] [-n ] + [-s ] [-h ]" 1>&2 exit 0 } -while getopts "c:d:i:l:n:h" o; do +while getopts "c:d:i:l:n:s:h" o; do case "$o" in d) MODULES_SUBDIRS="${OPTARG}" ;; l) MODULES_LIST="${OPTARG}" ;; c) MODULE_MODPROBE_NUMBER="${OPTARG}" ;; i) SHARD_INDEX="${OPTARG}" ;; n) SHARD_NUMBER="${OPTARG}" ;; + s) SKIPLIST="${OPTARG}" ;; h|*) usage ;; esac done @@ -38,8 +41,10 @@ done get_modules_list() { if [ -z "${MODULES_LIST}" ]; then subdir=$(echo "${MODULES_SUBDIRS}" | tr ' ' '|') + skiplist=$(echo "${SKIPLIST}" | tr ' ' '|') grep -E "kernel/(${subdir})" /lib/modules/"$(uname -r)"/modules.order | tee /tmp/find_modules.txt - split --verbose --numeric-suffixes=1 -n l/"${SHARD_INDEX}"/"${SHARD_NUMBER}" /tmp/find_modules.txt > /tmp/shardfile + grep -E -v "(${skiplist})" /tmp/find_modules.txt | tee /tmp/modules_to_run.txt + split --verbose --numeric-suffixes=1 -n l/"${SHARD_INDEX}"/"${SHARD_NUMBER}" /tmp/modules_to_run.txt > /tmp/shardfile echo "============== Tests to run ===============" cat /tmp/shardfile echo "===========End Tests to run ===============" diff --git a/automated/linux/modules/modules.yaml b/automated/linux/modules/modules.yaml index 54649264c..44f3e00ee 100644 --- a/automated/linux/modules/modules.yaml +++ b/automated/linux/modules/modules.yaml @@ -16,6 +16,10 @@ metadata: - x86 params: + # If SKIPLIST is specified with a list of space separated modules then + # they will be filtered out and not loaded. + SKIPLIST: "" + # If MODULES_LIST is specified with a list of space separated modules then # MOUDLES_SUBDIRS wont have any affect. MODULES_LIST: "" @@ -36,5 +40,5 @@ params: run: steps: - cd ./automated/linux/modules/ - - ./modules.sh -d "${MODULES_SUBDIRS}" -l "${MODULES_LIST}" -c "${MODULE_MODPROBE_NUMBER}" -n "${SHARD_NUMBER}" -i "${SHARD_INDEX}" + - ./modules.sh -d "${MODULES_SUBDIRS}" -l "${MODULES_LIST}" -c "${MODULE_MODPROBE_NUMBER}" -n "${SHARD_NUMBER}" -i "${SHARD_INDEX}" -s "${SKIPLIST}" - ../../utils/send-to-lava.sh ./output/result.txt