Skip to content

Commit

Permalink
automated: linux: modules: add SKIPLIST
Browse files Browse the repository at this point in the history
Make it possible to skip problematic modules that is known to fail.

Signed-off-by: Anders Roxell <[email protected]>
  • Loading branch information
roxell authored and nareshkamboju committed Jul 24, 2024
1 parent 50c9c41 commit 8aa8dbf
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
9 changes: 7 additions & 2 deletions automated/linux/modules/modules.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export RESULT_FILE
MODULES_LIST=""
MODULES_SUBDIRS=""
MODULE_MODPROBE_NUMBER="1"
SKIPLIST=""
SHARD_NUMBER=1
SHARD_INDEX=1

Expand All @@ -20,26 +21,30 @@ usage() {
[-c <Number of load/unload of a module> ]
[-i <sharding bucket to run> ]
[-n <number of shard buckets to create> ]
[-s <skiplist modules to skip> ]
[-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

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 ==============="
Expand Down
6 changes: 5 additions & 1 deletion automated/linux/modules/modules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: ""
Expand All @@ -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

0 comments on commit 8aa8dbf

Please sign in to comment.