[LU-1229] test-framework not able to set module parameters from modprobe.conf Created: 16/Mar/12 Updated: 16/Apr/13 Resolved: 16/Apr/13 |
|
| Status: | Resolved |
| Project: | Lustre |
| Component/s: | None |
| Affects Version/s: | Lustre 2.1.0, Lustre 2.2.0, Lustre 2.1.1 |
| Fix Version/s: | Lustre 2.4.0 |
| Type: | Bug | Priority: | Minor |
| Reporter: | Alexey Lyashkov | Assignee: | Keith Mannthey (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | patch | ||
| Story Points: | 1 |
| Severity: | 3 |
| Rank (Obsolete): | 6432 |
| Description |
|
Loading modules from /Users/shadow/work/lustre/work/BUGS/CLSTR-136/lustre/lustre/tests/.. that is result more then one parameter in modprobe.conf
options mdt mdt_num_threads=5 |
| Comments |
| Comment by Andreas Dilger [ 16/Mar/12 ] |
|
Looks like this should be straightforward to fix. The current code in load_module() does: set -- $(grep -P "^options\\s+${BASE}" $MODPROBECONF)
# Get rid of "options $module"
(($# > 0)) && shift 2
but it could do something like the following to handle multi-line options: set -- $(grep "^options[ \t]*$BASE" | sed -e 's/.*$BASE//') |
| Comment by Alexey Lyashkov [ 16/Mar/12 ] |
--- a/lustre/tests/test-framework.sh
+++ b/lustre/tests/test-framework.sh
@@ -278,6 +278,8 @@ module_loaded () {
#
load_module() {
local optvar
+ local opt
+
EXT=".ko"
module=$1
shift
@@ -294,18 +296,18 @@ load_module() {
eval set -- \$$optvar
if [ $# -eq 0 -a -n "$MODPROBECONF" ]; then
# Nothing in $MODOPTS_<MODULE>; try modprobe.conf
- set -- $(grep -P "^options\\s+${BASE}" $MODPROBECONF)
+ opt=$(grep -P "^options\\s+${BASE}" $MODPROBECONF | sed -e "s/options\(\\s\)\+${BASE}/ /g")
# Get rid of "options $module"
- (($# > 0)) && shift 2
+ #(($# > 0)) && shift 2
# Ensure we have accept=all for lnet
if [ $(basename $module) = lnet ]; then
# OK, this is a bit wordy...
local arg accept_all_present=false
- for arg in "$@"; do
+ for arg in "$opt"; do
[ "$arg" = accept=all ] && accept_all_present=true
done
- $accept_all_present || set -- "$@" accept=all
+ $accept_all_present || set -- "$opt" accept=all
fi
fi
fi
@@ -318,14 +320,14 @@ load_module() {
[ -f ${LUSTRE}/../lnet/selftest/${module}${EXT} ]; then
insmod ${LUSTRE}/../lnet/selftest/${module}${EXT}
elif [ -f ${LUSTRE}/${module}${EXT} ]; then
- insmod ${LUSTRE}/${module}${EXT} "$@"
+ insmod ${LUSTRE}/${module}${EXT} "$opt"
else
# must be testing a "make install" or "rpm" installation
# note failed to load ptlrpc_gss is considered not fatal
if [ "$BASE" == "ptlrpc_gss" ]; then
- modprobe $BASE "$@" 2>/dev/null || echo "gss/krb5 is not supported"
+ modprobe $BASE "$opt" 2>/dev/null || echo "gss/krb5 is not supported"
else
- modprobe $BASE "$@"
+ modprobe $BASE "$opt"
fi
fi
}
|
| Comment by Alexey Lyashkov [ 16/Mar/12 ] |
|
i didn't like plays with "$@" |
| Comment by Alexey Lyashkov [ 17/Mar/12 ] |
|
remote: New Changes: |
| Comment by Keith Mannthey (Inactive) [ 16/Oct/12 ] |
|
Alexey, Are you going to peruse acceptance of this code? |
| Comment by James A Simmons [ 15/Nov/12 ] |
|
Seeing some problem with this code. A shell debug run shows this: load_module ptlrpc/gss/ptlrpc_gss Then its stops running |
| Comment by James A Simmons [ 15/Nov/12 ] |
|
My system really doesn't like that grep. What I found that does work is local opt ' $MODPROBECONF) As a side note I tested this with conf-sanity 53 to see if it fixed it, Nope |
| Comment by Alexey Lyashkov [ 16/Nov/12 ] |
|
James, did you system is debian based? |
| Comment by James A Simmons [ 16/Nov/12 ] |
|
No its a RHEL6 image. Mind you its a stripped down image. Besides this fix I'm investigation why config-sanity 53 fails dues to modprobe options. I hope to have fix for that as well. |
| Comment by Nathan Rutman [ 21/Nov/12 ] |
|
Xyratex-bug-id: MRP-657 |
| Comment by James A Simmons [ 30/Nov/12 ] |
|
Found the problem Alexey. My bash environment was turning off globing. Anyways I have a patch at |
| Comment by Andreas Dilger [ 20/Dec/12 ] |
|
Patch is landed to master. |