Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

automated: linux: modules: add SKIPLIST #522

Merged
merged 1 commit into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading