Message ID | 20220912054600.310858-1-shinichiro.kawasaki@wdc.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [blktests] common/rc: support compressed module files | expand |
diff --git a/common/rc b/common/rc index a764b57..e490041 100644 --- a/common/rc +++ b/common/rc @@ -36,8 +36,8 @@ _module_file_exists() local -i count libpath="/lib/modules/$(uname -r)/kernel" - count=$(find "$libpath" -name "$ko_underscore" -o \ - -name "$ko_hyphen" | wc -l) + count=$(find "$libpath" -name "$ko_underscore*" -o \ + -name "$ko_hyphen*" | wc -l) ((count)) && return 0 return 1 }
The commit 8017ea524367 ("common/rc: ensure modules are loadable in _have_modules()") introduced a helper function _module_file_exists() which assumes module files have extension ".ko". However, the assumption is not true when module files are compressed. In this case, extensions of modules files have abbreviations of compression algorithm such as ".ko.xz",".ko.gz" or ".ko.zstd". This results in module file existence check failure and unexpected test skips. Fix this by changing module file search condition to cover module file extensions with the compression algorithm abbreviations. Fixes: 8017ea524367 ("common/rc: ensure modules are loadable in _have_modules()") Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com> Link: https://github.com/osandov/blktests/issues/101 --- common/rc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)