@@ -439,6 +439,19 @@ _test_dev_is_zoned() {
$(cat "${TEST_DEV_SYSFS}/queue/zoned") != none ]]
}
+# Arguments: module to unload ($1) and retry count ($2).
+_unload_module() {
+ local i m=$1 rc=${2:-1}
+
+ [ ! -e "/sys/module/$m" ] && return 0
+ for ((i=rc;i>0;i--)); do
+ modprobe -r "$m"
+ [ ! -e "/sys/module/$m" ] && return 0
+ sleep .1
+ done
+ return 1
+}
+
_run_test() {
TEST_NAME="$1"
CAN_BE_ZONED=0
@@ -384,19 +384,6 @@ _uptime_s() {
awk '{ print int($1) }' /proc/uptime
}
-# Arguments: module to unload ($1) and retry count ($2).
-_unload_module() {
- local i m=$1 rc=${2:-1}
-
- [ ! -e "/sys/module/$m" ] && return 0
- for ((i=rc;i>0;i--)); do
- modprobe -r "$m"
- [ ! -e "/sys/module/$m" ] && return 0
- sleep .1
- done
- return 1
-}
-
_have_writeable_kmsg() {
if [[ ! -w /dev/kmsg ]]; then
SKIP_REASONS+=("cannot write to /dev/kmsg")
To use in the 'check' script in the following commit, move the helper function _unload_module() from 'common/rc' to 'check'. Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com> --- check | 13 +++++++++++++ common/rc | 13 ------------- 2 files changed, 13 insertions(+), 13 deletions(-)